17 #include <linux/kernel.h>
18 #include <linux/export.h>
20 #include <linux/ctype.h>
21 #include <linux/string.h>
27 #include <linux/input.h>
30 #include <asm/bootinfo.h>
41 #define ETH0_RX_DMA_ADDR (DMA0_BASE_ADDR + 0 * DMA_CHAN_OFFSET)
42 #define ETH0_TX_DMA_ADDR (DMA0_BASE_ADDR + 1 * DMA_CHAN_OFFSET)
54 dev3.state = (dev3.state |
or_mask) & ~nand_mask;
55 writeb(dev3.state, dev3.base);
57 spin_unlock_irqrestore(&dev3.lock, flags);
67 static struct resource korina_dev0_res[] = {
69 .name =
"korina_regs",
94 .name =
"korina_dma_rx",
99 .name =
"korina_dma_tx",
108 .mac = {0xde, 0xca, 0xff, 0xc0, 0xff, 0xee}
114 .resource = korina_dev0_res,
118 static struct resource cf_slot0_res[] = {
120 .name =
"cf_membase",
130 static struct cf_device cf_slot0_data = {
136 .name =
"pata-rb532-cf",
137 .dev.platform_data = &cf_slot0_data,
138 .resource = cf_slot0_res,
143 static int rb532_dev_ready(
struct mtd_info *mtd)
148 static void rb532_cmd_ctrl(
struct mtd_info *mtd,
int cmd,
unsigned int ctrl)
151 unsigned char orbits, nandbits;
158 nandbits |= (~ctrl &
NAND_ALE) >> 1;
166 static struct resource nand_slot0_res[] = {
168 .name =
"nand_membase",
174 .ctrl.dev_ready = rb532_dev_ready,
175 .ctrl.cmd_ctrl = rb532_cmd_ctrl,
181 .resource = nand_slot0_res,
183 .dev.platform_data = &rb532_nand_data,
188 .name =
"Routerboard NAND boot",
190 .size = 4 * 1024 * 1024,
204 .name =
"rb532-button",
208 static struct resource rb532_wdt_res[] = {
210 .name =
"rb532_wdt_res",
218 .name =
"rc32434_wdt",
220 .resource = rb532_wdt_res,
238 .name =
"serial8250",
240 .dev.platform_data = &rb532_uart_res,
253 static void __init parse_mac_addr(
char *macstr)
257 for (i = 0; i < 6; i++) {
258 if (i != 5 && *(macstr + 2) !=
':')
270 korina_dev0_data.
mac[
i] = (h << 4) + l;
276 #define NAND_CHIP_DELAY 25
278 static void __init rb532_nand_setup(
void)
292 rb532_nand_data.
chip.nr_chips = 1;
293 rb532_nand_data.
chip.nr_partitions =
ARRAY_SIZE(rb532_partition_info);
294 rb532_nand_data.
chip.partitions = rb532_partition_info;
299 static int __init plat_setup_devices(
void)
303 rb532_devs[2] =
NULL;
305 cf_slot0_res[0].
start =
307 cf_slot0_res[0].
end = cf_slot0_res[0].
start + 0x1000;
312 nand_slot0_res[0].
end = nand_slot0_res[0].
start + 0x1000;
333 static int __init setup_kmac(
char *
s)