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 #include <mach/hardware.h>
32 static struct resource omixp_flash_resources
[] = {
34 .flags
= IORESOURCE_MEM
,
36 .flags
= IORESOURCE_MEM
,
40 static struct mtd_partition omixp_partitions
[] = {
42 .name
= "Recovery Bootloader",
46 .name
= "Calibration Data",
50 .name
= "Recovery FPGA",
54 .name
= "Release Bootloader",
58 .name
= "Release FPGA",
70 .name
= "Persistent Storage",
76 static struct flash_platform_data omixp_flash_data
[] = {
78 .map_name
= "cfi_probe",
79 .parts
= omixp_partitions
,
80 .nr_parts
= ARRAY_SIZE(omixp_partitions
),
82 .map_name
= "cfi_probe",
88 static struct platform_device omixp_flash_device
[] = {
90 .name
= "IXP4XX-Flash",
93 .platform_data
= &omixp_flash_data
[0],
95 .resource
= &omixp_flash_resources
[0],
98 .name
= "IXP4XX-Flash",
101 .platform_data
= &omixp_flash_data
[1],
103 .resource
= &omixp_flash_resources
[1],
108 /* Swap UART's - These boards have the console on UART2. The following
109 * configuration is used:
112 * This way standard images can be used with the kernel that expect
113 * the console on ttyS0.
115 static struct resource omixp_uart_resources
[] = {
117 .start
= IXP4XX_UART2_BASE_PHYS
,
118 .end
= IXP4XX_UART2_BASE_PHYS
+ 0x0fff,
119 .flags
= IORESOURCE_MEM
,
121 .start
= IXP4XX_UART1_BASE_PHYS
,
122 .end
= IXP4XX_UART1_BASE_PHYS
+ 0x0fff,
123 .flags
= IORESOURCE_MEM
,
127 static struct plat_serial8250_port omixp_uart_data
[] = {
129 .mapbase
= IXP4XX_UART2_BASE_PHYS
,
130 .membase
= (char *)IXP4XX_UART2_BASE_VIRT
+ REG_OFFSET
,
131 .irq
= IRQ_IXP4XX_UART2
,
132 .flags
= UPF_BOOT_AUTOCONF
| UPF_SKIP_TEST
,
135 .uartclk
= IXP4XX_UART_XTAL
,
137 .mapbase
= IXP4XX_UART1_BASE_PHYS
,
138 .membase
= (char *)IXP4XX_UART1_BASE_VIRT
+ REG_OFFSET
,
139 .irq
= IRQ_IXP4XX_UART1
,
140 .flags
= UPF_BOOT_AUTOCONF
| UPF_SKIP_TEST
,
143 .uartclk
= IXP4XX_UART_XTAL
,
145 /* list termination */
149 static struct platform_device omixp_uart
= {
150 .name
= "serial8250",
151 .id
= PLAT8250_DEV_PLATFORM
,
152 .dev
.platform_data
= omixp_uart_data
,
154 .resource
= omixp_uart_resources
,
157 static struct gpio_led mic256_led_pins
[] = {
164 static struct gpio_led_platform_data mic256_led_data
= {
165 .num_leds
= ARRAY_SIZE(mic256_led_pins
),
166 .leds
= mic256_led_pins
,
169 static struct platform_device mic256_leds
= {
172 .dev
.platform_data
= &mic256_led_data
,
175 /* Built-in 10/100 Ethernet MAC interfaces */
176 static struct eth_plat_info ixdp425_plat_eth
[] = {
188 static struct platform_device ixdp425_eth
[] = {
190 .name
= "ixp4xx_eth",
191 .id
= IXP4XX_ETH_NPEB
,
192 .dev
.platform_data
= ixdp425_plat_eth
,
194 .name
= "ixp4xx_eth",
195 .id
= IXP4XX_ETH_NPEC
,
196 .dev
.platform_data
= ixdp425_plat_eth
+ 1,
201 static struct platform_device
*devixp_pldev
[] __initdata
= {
203 &omixp_flash_device
[0],
208 static struct platform_device
*mic256_pldev
[] __initdata
= {
210 &omixp_flash_device
[0],
216 static struct platform_device
*miccpt_pldev
[] __initdata
= {
218 &omixp_flash_device
[0],
219 &omixp_flash_device
[1],
224 static void __init
omixp_init(void)
228 /* 16MiB Boot Flash */
229 omixp_flash_resources
[0].start
= IXP4XX_EXP_BUS_BASE(0);
230 omixp_flash_resources
[0].end
= IXP4XX_EXP_BUS_END(0);
232 /* 32 MiB Data Flash */
233 omixp_flash_resources
[1].start
= IXP4XX_EXP_BUS_BASE(2);
234 omixp_flash_resources
[1].end
= IXP4XX_EXP_BUS_END(2);
236 if (machine_is_devixp())
237 platform_add_devices(devixp_pldev
, ARRAY_SIZE(devixp_pldev
));
238 else if (machine_is_miccpt())
239 platform_add_devices(miccpt_pldev
, ARRAY_SIZE(miccpt_pldev
));
240 else if (machine_is_mic256())
241 platform_add_devices(mic256_pldev
, ARRAY_SIZE(mic256_pldev
));
244 #ifdef CONFIG_MACH_DEVIXP
245 MACHINE_START(DEVIXP
, "Omicron DEVIXP")
246 .atag_offset
= 0x100,
247 .map_io
= ixp4xx_map_io
,
248 .init_early
= ixp4xx_init_early
,
249 .init_irq
= ixp4xx_init_irq
,
250 .init_time
= ixp4xx_timer_init
,
251 .init_machine
= omixp_init
,
252 .restart
= ixp4xx_restart
,
256 #ifdef CONFIG_MACH_MICCPT
257 MACHINE_START(MICCPT
, "Omicron MICCPT")
258 .atag_offset
= 0x100,
259 .map_io
= ixp4xx_map_io
,
260 .init_early
= ixp4xx_init_early
,
261 .init_irq
= ixp4xx_init_irq
,
262 .init_time
= ixp4xx_timer_init
,
263 .init_machine
= omixp_init
,
264 #if defined(CONFIG_PCI)
265 .dma_zone_size
= SZ_64M
,
267 .restart
= ixp4xx_restart
,
271 #ifdef CONFIG_MACH_MIC256
272 MACHINE_START(MIC256
, "Omicron MIC256")
273 .atag_offset
= 0x100,
274 .map_io
= ixp4xx_map_io
,
275 .init_early
= ixp4xx_init_early
,
276 .init_irq
= ixp4xx_init_irq
,
277 .init_time
= ixp4xx_timer_init
,
278 .init_machine
= omixp_init
,
279 .restart
= ixp4xx_restart
,