2 * arch/arm/mach-ixp4xx/omixp-setup.c
4 * omicron ixp4xx board setup
5 * Copyright (C) 2009 OMICRON electronics GmbH
7 * based nslu2-setup.c, ixdp425-setup.c:
8 * Copyright (C) 2003-2004 MontaVista Software, Inc.
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
15 #include <linux/kernel.h>
16 #include <linux/serial.h>
17 #include <linux/serial_8250.h>
18 #include <linux/mtd/mtd.h>
19 #include <linux/mtd/partitions.h>
20 #ifdef CONFIG_LEDS_CLASS
21 #include <linux/leds.h>
24 #include <asm/setup.h>
25 #include <asm/memory.h>
26 #include <asm/mach-types.h>
27 #include <asm/mach/arch.h>
28 #include <asm/mach/flash.h>
30 static struct resource omixp_flash_resources
[] = {
32 .flags
= IORESOURCE_MEM
,
34 .flags
= IORESOURCE_MEM
,
38 static struct mtd_partition omixp_partitions
[] = {
40 .name
= "Recovery Bootloader",
44 .name
= "Calibration Data",
48 .name
= "Recovery FPGA",
52 .name
= "Release Bootloader",
56 .name
= "Release FPGA",
68 .name
= "Persistent Storage",
74 static struct flash_platform_data omixp_flash_data
[] = {
76 .map_name
= "cfi_probe",
77 .parts
= omixp_partitions
,
78 .nr_parts
= ARRAY_SIZE(omixp_partitions
),
80 .map_name
= "cfi_probe",
86 static struct platform_device omixp_flash_device
[] = {
88 .name
= "IXP4XX-Flash",
91 .platform_data
= &omixp_flash_data
[0],
93 .resource
= &omixp_flash_resources
[0],
96 .name
= "IXP4XX-Flash",
99 .platform_data
= &omixp_flash_data
[1],
101 .resource
= &omixp_flash_resources
[1],
106 /* Swap UART's - These boards have the console on UART2. The following
107 * configuration is used:
110 * This way standard images can be used with the kernel that expect
111 * the console on ttyS0.
113 static struct resource omixp_uart_resources
[] = {
115 .start
= IXP4XX_UART2_BASE_PHYS
,
116 .end
= IXP4XX_UART2_BASE_PHYS
+ 0x0fff,
117 .flags
= IORESOURCE_MEM
,
119 .start
= IXP4XX_UART1_BASE_PHYS
,
120 .end
= IXP4XX_UART1_BASE_PHYS
+ 0x0fff,
121 .flags
= IORESOURCE_MEM
,
125 static struct plat_serial8250_port omixp_uart_data
[] = {
127 .mapbase
= IXP4XX_UART2_BASE_PHYS
,
128 .membase
= (char *)IXP4XX_UART2_BASE_VIRT
+ REG_OFFSET
,
129 .irq
= IRQ_IXP4XX_UART2
,
130 .flags
= UPF_BOOT_AUTOCONF
| UPF_SKIP_TEST
,
133 .uartclk
= IXP4XX_UART_XTAL
,
135 .mapbase
= IXP4XX_UART1_BASE_PHYS
,
136 .membase
= (char *)IXP4XX_UART1_BASE_VIRT
+ REG_OFFSET
,
137 .irq
= IRQ_IXP4XX_UART1
,
138 .flags
= UPF_BOOT_AUTOCONF
| UPF_SKIP_TEST
,
141 .uartclk
= IXP4XX_UART_XTAL
,
143 /* list termination */
147 static struct platform_device omixp_uart
= {
148 .name
= "serial8250",
149 .id
= PLAT8250_DEV_PLATFORM
,
150 .dev
.platform_data
= omixp_uart_data
,
152 .resource
= omixp_uart_resources
,
155 static struct gpio_led mic256_led_pins
[] = {
162 static struct gpio_led_platform_data mic256_led_data
= {
163 .num_leds
= ARRAY_SIZE(mic256_led_pins
),
164 .leds
= mic256_led_pins
,
167 static struct platform_device mic256_leds
= {
170 .dev
.platform_data
= &mic256_led_data
,
173 /* Built-in 10/100 Ethernet MAC interfaces */
174 static struct eth_plat_info ixdp425_plat_eth
[] = {
186 static struct platform_device ixdp425_eth
[] = {
188 .name
= "ixp4xx_eth",
189 .id
= IXP4XX_ETH_NPEB
,
190 .dev
.platform_data
= ixdp425_plat_eth
,
192 .name
= "ixp4xx_eth",
193 .id
= IXP4XX_ETH_NPEC
,
194 .dev
.platform_data
= ixdp425_plat_eth
+ 1,
199 static struct platform_device
*devixp_pldev
[] __initdata
= {
201 &omixp_flash_device
[0],
206 static struct platform_device
*mic256_pldev
[] __initdata
= {
208 &omixp_flash_device
[0],
214 static struct platform_device
*miccpt_pldev
[] __initdata
= {
216 &omixp_flash_device
[0],
217 &omixp_flash_device
[1],
222 static void __init
omixp_init(void)
226 /* 16MiB Boot Flash */
227 omixp_flash_resources
[0].start
= IXP4XX_EXP_BUS_BASE(0);
228 omixp_flash_resources
[0].end
= IXP4XX_EXP_BUS_END(0);
230 /* 32 MiB Data Flash */
231 omixp_flash_resources
[1].start
= IXP4XX_EXP_BUS_BASE(2);
232 omixp_flash_resources
[1].end
= IXP4XX_EXP_BUS_END(2);
234 if (machine_is_devixp())
235 platform_add_devices(devixp_pldev
, ARRAY_SIZE(devixp_pldev
));
236 else if (machine_is_miccpt())
237 platform_add_devices(miccpt_pldev
, ARRAY_SIZE(miccpt_pldev
));
238 else if (machine_is_mic256())
239 platform_add_devices(mic256_pldev
, ARRAY_SIZE(mic256_pldev
));
242 #ifdef CONFIG_MACH_DEVIXP
243 MACHINE_START(DEVIXP
, "Omicron DEVIXP")
244 .atag_offset
= 0x100,
245 .map_io
= ixp4xx_map_io
,
246 .init_irq
= ixp4xx_init_irq
,
247 .timer
= &ixp4xx_timer
,
248 .init_machine
= omixp_init
,
249 .restart
= ixp4xx_restart
,
253 #ifdef CONFIG_MACH_MICCPT
254 MACHINE_START(MICCPT
, "Omicron MICCPT")
255 .atag_offset
= 0x100,
256 .map_io
= ixp4xx_map_io
,
257 .init_irq
= ixp4xx_init_irq
,
258 .timer
= &ixp4xx_timer
,
259 .init_machine
= omixp_init
,
260 #if defined(CONFIG_PCI)
261 .dma_zone_size
= SZ_64M
,
263 .restart
= ixp4xx_restart
,
267 #ifdef CONFIG_MACH_MIC256
268 MACHINE_START(MIC256
, "Omicron MIC256")
269 .atag_offset
= 0x100,
270 .map_io
= ixp4xx_map_io
,
271 .init_irq
= ixp4xx_init_irq
,
272 .timer
= &ixp4xx_timer
,
273 .init_machine
= omixp_init
,
274 .restart
= ixp4xx_restart
,