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_data/sa11x0-serial.h>
10 #include <linux/platform_device.h>
11 #include <linux/irq.h>
13 #include <linux/mtd/partitions.h>
15 #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 <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
[] = {
40 [0] = DEFINE_RES_MEM(PLEB_ETH0_P
, 0x04000000),
41 #if 0 /* Autoprobe instead, to get rising/falling edge characteristic right */
42 [1] = DEFINE_RES_IRQ(IRQ_GPIO_ETH0_IRQ
),
47 static struct platform_device smc91x_device
= {
50 .num_resources
= ARRAY_SIZE(smc91x_resources
),
51 .resource
= smc91x_resources
,
54 static struct platform_device
*devices
[] __initdata
= {
61 * has flash memory (typically 4 or 8 meg) selected by
62 * the two SA1100 lowest chip select outputs.
64 static struct resource pleb_flash_resources
[] = {
65 [0] = DEFINE_RES_MEM(SA1100_CS0_PHYS
, SZ_8M
),
66 [1] = DEFINE_RES_MEM(SA1100_CS1_PHYS
, SZ_8M
),
70 static struct mtd_partition pleb_partitions
[] = {
77 .offset
= MTDPART_OFS_APPEND
,
81 .offset
= MTDPART_OFS_APPEND
,
87 static struct flash_platform_data pleb_flash_data
= {
88 .map_name
= "cfi_probe",
89 .parts
= pleb_partitions
,
90 .nr_parts
= ARRAY_SIZE(pleb_partitions
),
94 static void __init
pleb_init(void)
96 sa11x0_register_mtd(&pleb_flash_data
, pleb_flash_resources
,
97 ARRAY_SIZE(pleb_flash_resources
));
100 platform_add_devices(devices
, ARRAY_SIZE(devices
));
104 static void __init
pleb_map_io(void)
108 sa1100_register_uart(0, 3);
109 sa1100_register_uart(1, 1);
111 GAFR
|= (GPIO_UART_TXD
| GPIO_UART_RXD
);
112 GPDR
|= GPIO_UART_TXD
;
113 GPDR
&= ~GPIO_UART_RXD
;
117 * Fix expansion memory timing for network card
119 MECR
= ((2<<10) | (2<<5) | (2<<0));
122 * Enable the SMC ethernet controller
124 GPDR
|= GPIO_ETH0_EN
; /* set to output */
125 GPCR
= GPIO_ETH0_EN
; /* clear MCLK (enable smc) */
127 GPDR
&= ~GPIO_ETH0_IRQ
;
129 irq_set_irq_type(GPIO_ETH0_IRQ
, IRQ_TYPE_EDGE_FALLING
);
132 MACHINE_START(PLEB
, "PLEB")
133 .map_io
= pleb_map_io
,
134 .nr_irqs
= SA1100_NR_IRQS
,
135 .init_irq
= sa1100_init_irq
,
136 .init_time
= sa1100_timer_init
,
137 .init_machine
= pleb_init
,
138 .init_late
= sa11x0_init_late
,
139 .restart
= sa11x0_restart
,