GUI: Fix Tomato RAF theme for all builds. Compilation typo.
[tomato.git] / release / src-rt-6.x.4708 / linux / linux-2.6.36 / arch / arm / mach-sa1100 / pleb.c
blob834e789769f7113d3d1e0a484a14291bb0c7d284
1 /*
2 * linux/arch/arm/mach-sa1100/pleb.c
3 */
5 #include <linux/init.h>
6 #include <linux/kernel.h>
7 #include <linux/tty.h>
8 #include <linux/ioport.h>
9 #include <linux/platform_device.h>
10 #include <linux/irq.h>
11 #include <linux/io.h>
12 #include <linux/mtd/partitions.h>
14 #include <mach/hardware.h>
15 #include <asm/setup.h>
16 #include <asm/mach-types.h>
18 #include <asm/mach/arch.h>
19 #include <asm/mach/map.h>
20 #include <asm/mach/flash.h>
21 #include <asm/mach/serial_sa1100.h>
22 #include <mach/irqs.h>
24 #include "generic.h"
28 * Ethernet IRQ mappings
31 #define PLEB_ETH0_P (0x20000300) /* Ethernet 0 in PCMCIA0 IO */
32 #define PLEB_ETH0_V (0xf6000300)
34 #define GPIO_ETH0_IRQ GPIO_GPIO(21)
35 #define GPIO_ETH0_EN GPIO_GPIO(26)
37 #define IRQ_GPIO_ETH0_IRQ IRQ_GPIO21
39 static struct resource smc91x_resources[] = {
40 [0] = {
41 .start = PLEB_ETH0_P,
42 .end = PLEB_ETH0_P | 0x03ffffff,
43 .flags = IORESOURCE_MEM,
48 static struct platform_device smc91x_device = {
49 .name = "smc91x",
50 .id = 0,
51 .num_resources = ARRAY_SIZE(smc91x_resources),
52 .resource = smc91x_resources,
55 static struct platform_device *devices[] __initdata = {
56 &smc91x_device,
61 * Pleb's memory map
62 * has flash memory (typically 4 or 8 meg) selected by
63 * the two SA1100 lowest chip select outputs.
65 static struct resource pleb_flash_resources[] = {
66 [0] = {
67 .start = SA1100_CS0_PHYS,
68 .end = SA1100_CS0_PHYS + SZ_8M - 1,
69 .flags = IORESOURCE_MEM,
71 [1] = {
72 .start = SA1100_CS1_PHYS,
73 .end = SA1100_CS1_PHYS + SZ_8M - 1,
74 .flags = IORESOURCE_MEM,
79 static struct mtd_partition pleb_partitions[] = {
81 .name = "blob",
82 .offset = 0,
83 .size = 0x00020000,
84 }, {
85 .name = "kernel",
86 .offset = MTDPART_OFS_APPEND,
87 .size = 0x000e0000,
88 }, {
89 .name = "rootfs",
90 .offset = MTDPART_OFS_APPEND,
91 .size = 0x00300000,
96 static struct flash_platform_data pleb_flash_data = {
97 .map_name = "cfi_probe",
98 .parts = pleb_partitions,
99 .nr_parts = ARRAY_SIZE(pleb_partitions),
103 static void __init pleb_init(void)
105 sa11x0_register_mtd(&pleb_flash_data, pleb_flash_resources,
106 ARRAY_SIZE(pleb_flash_resources));
109 platform_add_devices(devices, ARRAY_SIZE(devices));
113 static void __init pleb_map_io(void)
115 sa1100_map_io();
117 sa1100_register_uart(0, 3);
118 sa1100_register_uart(1, 1);
120 GAFR |= (GPIO_UART_TXD | GPIO_UART_RXD);
121 GPDR |= GPIO_UART_TXD;
122 GPDR &= ~GPIO_UART_RXD;
123 PPAR |= PPAR_UPR;
126 * Fix expansion memory timing for network card
128 MECR = ((2<<10) | (2<<5) | (2<<0));
131 * Enable the SMC ethernet controller
133 GPDR |= GPIO_ETH0_EN; /* set to output */
134 GPCR = GPIO_ETH0_EN; /* clear MCLK (enable smc) */
136 GPDR &= ~GPIO_ETH0_IRQ;
138 set_irq_type(GPIO_ETH0_IRQ, IRQ_TYPE_EDGE_FALLING);
141 MACHINE_START(PLEB, "PLEB")
142 .phys_io = 0x80000000,
143 .io_pg_offst = ((0xf8000000) >> 18) & 0xfffc,
144 .map_io = pleb_map_io,
145 .init_irq = sa1100_init_irq,
146 .timer = &sa1100_timer,
147 .init_machine = pleb_init,
148 MACHINE_END