2 * linux/arch/arm/mach-sa1100/pleb.c
5 #include <linux/init.h>
6 #include <linux/kernel.h>
8 #include <linux/ioport.h>
9 #include <linux/platform_device.h>
10 #include <linux/irq.h>
12 #include <linux/mtd/partitions.h>
14 #include <mach/hardware.h>
16 #include <asm/setup.h>
17 #include <asm/mach-types.h>
19 #include <asm/mach/arch.h>
20 #include <asm/mach/map.h>
21 #include <asm/mach/flash.h>
22 #include <asm/mach/serial_sa1100.h>
23 #include <mach/irqs.h>
29 * Ethernet IRQ mappings
32 #define PLEB_ETH0_P (0x20000300) /* Ethernet 0 in PCMCIA0 IO */
33 #define PLEB_ETH0_V (0xf6000300)
35 #define GPIO_ETH0_IRQ GPIO_GPIO(21)
36 #define GPIO_ETH0_EN GPIO_GPIO(26)
38 #define IRQ_GPIO_ETH0_IRQ IRQ_GPIO21
40 static struct resource smc91x_resources[] = {
43 .end = PLEB_ETH0_P | 0x03ffffff,
44 .flags = IORESOURCE_MEM,
46 #if 0 /* Autoprobe instead, to get rising/falling edge characteristic right */
48 .start = IRQ_GPIO_ETH0_IRQ,
49 .end = IRQ_GPIO_ETH0_IRQ,
50 .flags = IORESOURCE_IRQ,
56 static struct platform_device smc91x_device = {
59 .num_resources = ARRAY_SIZE(smc91x_resources),
60 .resource = smc91x_resources,
63 static struct platform_device *devices[] __initdata = {
70 * has flash memory (typically 4 or 8 meg) selected by
71 * the two SA1100 lowest chip select outputs.
73 static struct resource pleb_flash_resources[] = {
75 .start = SA1100_CS0_PHYS,
76 .end = SA1100_CS0_PHYS + SZ_8M - 1,
77 .flags = IORESOURCE_MEM,
80 .start = SA1100_CS1_PHYS,
81 .end = SA1100_CS1_PHYS + SZ_8M - 1,
82 .flags = IORESOURCE_MEM,
87 static struct mtd_partition pleb_partitions[] = {
94 .offset = MTDPART_OFS_APPEND,
98 .offset = MTDPART_OFS_APPEND,
104 static struct flash_platform_data pleb_flash_data = {
105 .map_name = "cfi_probe",
106 .parts = pleb_partitions,
107 .nr_parts = ARRAY_SIZE(pleb_partitions),
111 static void __init pleb_init(void)
113 sa11x0_set_flash_data(&pleb_flash_data, pleb_flash_resources,
114 ARRAY_SIZE(pleb_flash_resources));
117 platform_add_devices(devices, ARRAY_SIZE(devices));
121 static void __init pleb_map_io(void)
125 sa1100_register_uart(0, 3);
126 sa1100_register_uart(1, 1);
128 GAFR |= (GPIO_UART_TXD | GPIO_UART_RXD);
129 GPDR |= GPIO_UART_TXD;
130 GPDR &= ~GPIO_UART_RXD;
134 * Fix expansion memory timing for network card
136 MECR = ((2<<10) | (2<<5) | (2<<0));
139 * Enable the SMC ethernet controller
141 GPDR |= GPIO_ETH0_EN; /* set to output */
142 GPCR = GPIO_ETH0_EN; /* clear MCLK (enable smc) */
144 GPDR &= ~GPIO_ETH0_IRQ;
146 set_irq_type(GPIO_ETH0_IRQ, IRQ_TYPE_EDGE_FALLING);
149 MACHINE_START(PLEB, "PLEB")
150 .phys_io = 0x80000000,
151 .io_pg_offst = ((0xf8000000) >> 18) & 0xfffc,
152 .map_io = pleb_map_io,
153 .init_irq = sa1100_init_irq,
154 .timer = &sa1100_timer,
155 .init_machine = pleb_init,