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>
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>
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
[] = {
42 .end
= PLEB_ETH0_P
| 0x03ffffff,
43 .flags
= IORESOURCE_MEM
,
45 #if 0 /* Autoprobe instead, to get rising/falling edge characteristic right */
47 .start
= IRQ_GPIO_ETH0_IRQ
,
48 .end
= IRQ_GPIO_ETH0_IRQ
,
49 .flags
= IORESOURCE_IRQ
,
55 static struct platform_device smc91x_device
= {
58 .num_resources
= ARRAY_SIZE(smc91x_resources
),
59 .resource
= smc91x_resources
,
62 static struct platform_device
*devices
[] __initdata
= {
69 * has flash memory (typically 4 or 8 meg) selected by
70 * the two SA1100 lowest chip select outputs.
72 static struct resource pleb_flash_resources
[] = {
74 .start
= SA1100_CS0_PHYS
,
75 .end
= SA1100_CS0_PHYS
+ SZ_8M
- 1,
76 .flags
= IORESOURCE_MEM
,
79 .start
= SA1100_CS1_PHYS
,
80 .end
= SA1100_CS1_PHYS
+ SZ_8M
- 1,
81 .flags
= IORESOURCE_MEM
,
86 static struct mtd_partition pleb_partitions
[] = {
93 .offset
= MTDPART_OFS_APPEND
,
97 .offset
= MTDPART_OFS_APPEND
,
103 static struct flash_platform_data pleb_flash_data
= {
104 .map_name
= "cfi_probe",
105 .parts
= pleb_partitions
,
106 .nr_parts
= ARRAY_SIZE(pleb_partitions
),
110 static void __init
pleb_init(void)
112 sa11x0_register_mtd(&pleb_flash_data
, pleb_flash_resources
,
113 ARRAY_SIZE(pleb_flash_resources
));
116 platform_add_devices(devices
, ARRAY_SIZE(devices
));
120 static void __init
pleb_map_io(void)
124 sa1100_register_uart(0, 3);
125 sa1100_register_uart(1, 1);
127 GAFR
|= (GPIO_UART_TXD
| GPIO_UART_RXD
);
128 GPDR
|= GPIO_UART_TXD
;
129 GPDR
&= ~GPIO_UART_RXD
;
133 * Fix expansion memory timing for network card
135 MECR
= ((2<<10) | (2<<5) | (2<<0));
138 * Enable the SMC ethernet controller
140 GPDR
|= GPIO_ETH0_EN
; /* set to output */
141 GPCR
= GPIO_ETH0_EN
; /* clear MCLK (enable smc) */
143 GPDR
&= ~GPIO_ETH0_IRQ
;
145 irq_set_irq_type(GPIO_ETH0_IRQ
, IRQ_TYPE_EDGE_FALLING
);
148 MACHINE_START(PLEB
, "PLEB")
149 .map_io
= pleb_map_io
,
150 .init_irq
= sa1100_init_irq
,
151 .timer
= &sa1100_timer
,
152 .init_machine
= pleb_init
,