2 * arch/arm/mach-ixp4xx/vulcan-setup.c
4 * Arcom/Eurotech Vulcan board-setup
6 * Copyright (C) 2010 Marc Zyngier <maz@misterjones.org>
8 * based on fsg-setup.c:
9 * Copyright (C) 2008 Rod Whitby <rod@whitby.id.au>
12 #include <linux/if_ether.h>
13 #include <linux/irq.h>
14 #include <linux/serial.h>
15 #include <linux/serial_8250.h>
17 #include <linux/w1-gpio.h>
18 #include <linux/mtd/plat-ram.h>
19 #include <asm/mach-types.h>
20 #include <asm/mach/arch.h>
21 #include <asm/mach/flash.h>
23 static struct flash_platform_data vulcan_flash_data
= {
24 .map_name
= "cfi_probe",
28 static struct resource vulcan_flash_resource
= {
29 .flags
= IORESOURCE_MEM
,
32 static struct platform_device vulcan_flash
= {
33 .name
= "IXP4XX-Flash",
36 .platform_data
= &vulcan_flash_data
,
38 .resource
= &vulcan_flash_resource
,
42 static struct platdata_mtd_ram vulcan_sram_data
= {
43 .mapname
= "Vulcan SRAM",
47 static struct resource vulcan_sram_resource
= {
48 .flags
= IORESOURCE_MEM
,
51 static struct platform_device vulcan_sram
= {
55 .platform_data
= &vulcan_sram_data
,
57 .resource
= &vulcan_sram_resource
,
61 static struct resource vulcan_uart_resources
[] = {
63 .start
= IXP4XX_UART1_BASE_PHYS
,
64 .end
= IXP4XX_UART1_BASE_PHYS
+ 0x0fff,
65 .flags
= IORESOURCE_MEM
,
68 .start
= IXP4XX_UART2_BASE_PHYS
,
69 .end
= IXP4XX_UART2_BASE_PHYS
+ 0x0fff,
70 .flags
= IORESOURCE_MEM
,
73 .flags
= IORESOURCE_MEM
,
77 static struct plat_serial8250_port vulcan_uart_data
[] = {
79 .mapbase
= IXP4XX_UART1_BASE_PHYS
,
80 .membase
= (char *)IXP4XX_UART1_BASE_VIRT
+ REG_OFFSET
,
81 .irq
= IRQ_IXP4XX_UART1
,
82 .flags
= UPF_BOOT_AUTOCONF
| UPF_SKIP_TEST
,
85 .uartclk
= IXP4XX_UART_XTAL
,
88 .mapbase
= IXP4XX_UART2_BASE_PHYS
,
89 .membase
= (char *)IXP4XX_UART2_BASE_VIRT
+ REG_OFFSET
,
90 .irq
= IRQ_IXP4XX_UART2
,
91 .flags
= UPF_BOOT_AUTOCONF
| UPF_SKIP_TEST
,
94 .uartclk
= IXP4XX_UART_XTAL
,
97 .irq
= IXP4XX_GPIO_IRQ(4),
98 .irqflags
= IRQF_TRIGGER_LOW
,
99 .flags
= UPF_IOREMAP
| UPF_BOOT_AUTOCONF
| UPF_SKIP_TEST
,
104 .irq
= IXP4XX_GPIO_IRQ(4),
105 .irqflags
= IRQF_TRIGGER_LOW
,
106 .flags
= UPF_IOREMAP
| UPF_BOOT_AUTOCONF
| UPF_SKIP_TEST
,
113 static struct platform_device vulcan_uart
= {
114 .name
= "serial8250",
115 .id
= PLAT8250_DEV_PLATFORM
,
117 .platform_data
= vulcan_uart_data
,
119 .resource
= vulcan_uart_resources
,
120 .num_resources
= ARRAY_SIZE(vulcan_uart_resources
),
123 static struct eth_plat_info vulcan_plat_eth
[] = {
136 static struct platform_device vulcan_eth
[] = {
138 .name
= "ixp4xx_eth",
139 .id
= IXP4XX_ETH_NPEB
,
141 .platform_data
= &vulcan_plat_eth
[0],
145 .name
= "ixp4xx_eth",
146 .id
= IXP4XX_ETH_NPEC
,
148 .platform_data
= &vulcan_plat_eth
[1],
153 static struct resource vulcan_max6369_resource
= {
154 .flags
= IORESOURCE_MEM
,
157 static struct platform_device vulcan_max6369
= {
158 .name
= "max6369_wdt",
160 .resource
= &vulcan_max6369_resource
,
164 static struct w1_gpio_platform_data vulcan_w1_gpio_pdata
= {
166 .ext_pullup_enable_pin
= -EINVAL
,
169 static struct platform_device vulcan_w1_gpio
= {
173 .platform_data
= &vulcan_w1_gpio_pdata
,
177 static struct platform_device
*vulcan_devices
[] __initdata
= {
187 static void __init
vulcan_init(void)
191 /* Flash is spread over both CS0 and CS1 */
192 vulcan_flash_resource
.start
= IXP4XX_EXP_BUS_BASE(0);
193 vulcan_flash_resource
.end
= IXP4XX_EXP_BUS_BASE(0) + SZ_32M
- 1;
194 *IXP4XX_EXP_CS0
= IXP4XX_EXP_BUS_CS_EN
|
195 IXP4XX_EXP_BUS_STROBE_T(3) |
196 IXP4XX_EXP_BUS_SIZE(0xF) |
197 IXP4XX_EXP_BUS_BYTE_RD16
|
198 IXP4XX_EXP_BUS_WR_EN
;
199 *IXP4XX_EXP_CS1
= *IXP4XX_EXP_CS0
;
201 /* SRAM on CS2, (256kB, 8bit, writable) */
202 vulcan_sram_resource
.start
= IXP4XX_EXP_BUS_BASE(2);
203 vulcan_sram_resource
.end
= IXP4XX_EXP_BUS_BASE(2) + SZ_256K
- 1;
204 *IXP4XX_EXP_CS2
= IXP4XX_EXP_BUS_CS_EN
|
205 IXP4XX_EXP_BUS_STROBE_T(1) |
206 IXP4XX_EXP_BUS_HOLD_T(2) |
207 IXP4XX_EXP_BUS_SIZE(9) |
208 IXP4XX_EXP_BUS_SPLT_EN
|
209 IXP4XX_EXP_BUS_WR_EN
|
210 IXP4XX_EXP_BUS_BYTE_EN
;
212 /* XR16L2551 on CS3 (Moto style, 512 bytes, 8bits, writable) */
213 vulcan_uart_resources
[2].start
= IXP4XX_EXP_BUS_BASE(3);
214 vulcan_uart_resources
[2].end
= IXP4XX_EXP_BUS_BASE(3) + 16 - 1;
215 vulcan_uart_data
[2].mapbase
= vulcan_uart_resources
[2].start
;
216 vulcan_uart_data
[3].mapbase
= vulcan_uart_data
[2].mapbase
+ 8;
217 *IXP4XX_EXP_CS3
= IXP4XX_EXP_BUS_CS_EN
|
218 IXP4XX_EXP_BUS_STROBE_T(3) |
219 IXP4XX_EXP_BUS_CYCLES(IXP4XX_EXP_BUS_CYCLES_MOTOROLA
)|
220 IXP4XX_EXP_BUS_WR_EN
|
221 IXP4XX_EXP_BUS_BYTE_EN
;
223 /* GPIOS on CS4 (512 bytes, 8bits, writable) */
224 *IXP4XX_EXP_CS4
= IXP4XX_EXP_BUS_CS_EN
|
225 IXP4XX_EXP_BUS_WR_EN
|
226 IXP4XX_EXP_BUS_BYTE_EN
;
228 /* max6369 on CS5 (512 bytes, 8bits, writable) */
229 vulcan_max6369_resource
.start
= IXP4XX_EXP_BUS_BASE(5);
230 vulcan_max6369_resource
.end
= IXP4XX_EXP_BUS_BASE(5);
231 *IXP4XX_EXP_CS5
= IXP4XX_EXP_BUS_CS_EN
|
232 IXP4XX_EXP_BUS_WR_EN
|
233 IXP4XX_EXP_BUS_BYTE_EN
;
235 platform_add_devices(vulcan_devices
, ARRAY_SIZE(vulcan_devices
));
238 MACHINE_START(ARCOM_VULCAN
, "Arcom/Eurotech Vulcan")
239 /* Maintainer: Marc Zyngier <maz@misterjones.org> */
240 .map_io
= ixp4xx_map_io
,
241 .init_early
= ixp4xx_init_early
,
242 .init_irq
= ixp4xx_init_irq
,
243 .init_time
= ixp4xx_timer_init
,
244 .atag_offset
= 0x100,
245 .init_machine
= vulcan_init
,
246 #if defined(CONFIG_PCI)
247 .dma_zone_size
= SZ_64M
,
249 .restart
= ixp4xx_restart
,