1 // SPDX-License-Identifier: GPL-2.0
3 * arch/arm/mach-ixp4xx/vulcan-setup.c
5 * Arcom/Eurotech Vulcan board-setup
7 * Copyright (C) 2010 Marc Zyngier <maz@misterjones.org>
9 * based on fsg-setup.c:
10 * Copyright (C) 2008 Rod Whitby <rod@whitby.id.au>
13 #include <linux/if_ether.h>
14 #include <linux/irq.h>
15 #include <linux/serial.h>
16 #include <linux/serial_8250.h>
18 #include <linux/w1-gpio.h>
19 #include <linux/mtd/plat-ram.h>
20 #include <asm/mach-types.h>
21 #include <asm/mach/arch.h>
22 #include <asm/mach/flash.h>
24 static struct flash_platform_data vulcan_flash_data
= {
25 .map_name
= "cfi_probe",
29 static struct resource vulcan_flash_resource
= {
30 .flags
= IORESOURCE_MEM
,
33 static struct platform_device vulcan_flash
= {
34 .name
= "IXP4XX-Flash",
37 .platform_data
= &vulcan_flash_data
,
39 .resource
= &vulcan_flash_resource
,
43 static struct platdata_mtd_ram vulcan_sram_data
= {
44 .mapname
= "Vulcan SRAM",
48 static struct resource vulcan_sram_resource
= {
49 .flags
= IORESOURCE_MEM
,
52 static struct platform_device vulcan_sram
= {
56 .platform_data
= &vulcan_sram_data
,
58 .resource
= &vulcan_sram_resource
,
62 static struct resource vulcan_uart_resources
[] = {
64 .start
= IXP4XX_UART1_BASE_PHYS
,
65 .end
= IXP4XX_UART1_BASE_PHYS
+ 0x0fff,
66 .flags
= IORESOURCE_MEM
,
69 .start
= IXP4XX_UART2_BASE_PHYS
,
70 .end
= IXP4XX_UART2_BASE_PHYS
+ 0x0fff,
71 .flags
= IORESOURCE_MEM
,
74 .flags
= IORESOURCE_MEM
,
78 static struct plat_serial8250_port vulcan_uart_data
[] = {
80 .mapbase
= IXP4XX_UART1_BASE_PHYS
,
81 .membase
= (char *)IXP4XX_UART1_BASE_VIRT
+ REG_OFFSET
,
82 .irq
= IRQ_IXP4XX_UART1
,
83 .flags
= UPF_BOOT_AUTOCONF
| UPF_SKIP_TEST
,
86 .uartclk
= IXP4XX_UART_XTAL
,
89 .mapbase
= IXP4XX_UART2_BASE_PHYS
,
90 .membase
= (char *)IXP4XX_UART2_BASE_VIRT
+ REG_OFFSET
,
91 .irq
= IRQ_IXP4XX_UART2
,
92 .flags
= UPF_BOOT_AUTOCONF
| UPF_SKIP_TEST
,
95 .uartclk
= IXP4XX_UART_XTAL
,
98 .irq
= IXP4XX_GPIO_IRQ(4),
99 .irqflags
= IRQF_TRIGGER_LOW
,
100 .flags
= UPF_IOREMAP
| UPF_BOOT_AUTOCONF
| UPF_SKIP_TEST
,
105 .irq
= IXP4XX_GPIO_IRQ(4),
106 .irqflags
= IRQF_TRIGGER_LOW
,
107 .flags
= UPF_IOREMAP
| UPF_BOOT_AUTOCONF
| UPF_SKIP_TEST
,
114 static struct platform_device vulcan_uart
= {
115 .name
= "serial8250",
116 .id
= PLAT8250_DEV_PLATFORM
,
118 .platform_data
= vulcan_uart_data
,
120 .resource
= vulcan_uart_resources
,
121 .num_resources
= ARRAY_SIZE(vulcan_uart_resources
),
124 static struct eth_plat_info vulcan_plat_eth
[] = {
137 static struct platform_device vulcan_eth
[] = {
139 .name
= "ixp4xx_eth",
140 .id
= IXP4XX_ETH_NPEB
,
142 .platform_data
= &vulcan_plat_eth
[0],
146 .name
= "ixp4xx_eth",
147 .id
= IXP4XX_ETH_NPEC
,
149 .platform_data
= &vulcan_plat_eth
[1],
154 static struct resource vulcan_max6369_resource
= {
155 .flags
= IORESOURCE_MEM
,
158 static struct platform_device vulcan_max6369
= {
159 .name
= "max6369_wdt",
161 .resource
= &vulcan_max6369_resource
,
165 static struct w1_gpio_platform_data vulcan_w1_gpio_pdata
= {
167 .ext_pullup_enable_pin
= -EINVAL
,
170 static struct platform_device vulcan_w1_gpio
= {
174 .platform_data
= &vulcan_w1_gpio_pdata
,
178 static struct platform_device
*vulcan_devices
[] __initdata
= {
188 static void __init
vulcan_init(void)
192 /* Flash is spread over both CS0 and CS1 */
193 vulcan_flash_resource
.start
= IXP4XX_EXP_BUS_BASE(0);
194 vulcan_flash_resource
.end
= IXP4XX_EXP_BUS_BASE(0) + SZ_32M
- 1;
195 *IXP4XX_EXP_CS0
= IXP4XX_EXP_BUS_CS_EN
|
196 IXP4XX_EXP_BUS_STROBE_T(3) |
197 IXP4XX_EXP_BUS_SIZE(0xF) |
198 IXP4XX_EXP_BUS_BYTE_RD16
|
199 IXP4XX_EXP_BUS_WR_EN
;
200 *IXP4XX_EXP_CS1
= *IXP4XX_EXP_CS0
;
202 /* SRAM on CS2, (256kB, 8bit, writable) */
203 vulcan_sram_resource
.start
= IXP4XX_EXP_BUS_BASE(2);
204 vulcan_sram_resource
.end
= IXP4XX_EXP_BUS_BASE(2) + SZ_256K
- 1;
205 *IXP4XX_EXP_CS2
= IXP4XX_EXP_BUS_CS_EN
|
206 IXP4XX_EXP_BUS_STROBE_T(1) |
207 IXP4XX_EXP_BUS_HOLD_T(2) |
208 IXP4XX_EXP_BUS_SIZE(9) |
209 IXP4XX_EXP_BUS_SPLT_EN
|
210 IXP4XX_EXP_BUS_WR_EN
|
211 IXP4XX_EXP_BUS_BYTE_EN
;
213 /* XR16L2551 on CS3 (Moto style, 512 bytes, 8bits, writable) */
214 vulcan_uart_resources
[2].start
= IXP4XX_EXP_BUS_BASE(3);
215 vulcan_uart_resources
[2].end
= IXP4XX_EXP_BUS_BASE(3) + 16 - 1;
216 vulcan_uart_data
[2].mapbase
= vulcan_uart_resources
[2].start
;
217 vulcan_uart_data
[3].mapbase
= vulcan_uart_data
[2].mapbase
+ 8;
218 *IXP4XX_EXP_CS3
= IXP4XX_EXP_BUS_CS_EN
|
219 IXP4XX_EXP_BUS_STROBE_T(3) |
220 IXP4XX_EXP_BUS_CYCLES(IXP4XX_EXP_BUS_CYCLES_MOTOROLA
)|
221 IXP4XX_EXP_BUS_WR_EN
|
222 IXP4XX_EXP_BUS_BYTE_EN
;
224 /* GPIOS on CS4 (512 bytes, 8bits, writable) */
225 *IXP4XX_EXP_CS4
= IXP4XX_EXP_BUS_CS_EN
|
226 IXP4XX_EXP_BUS_WR_EN
|
227 IXP4XX_EXP_BUS_BYTE_EN
;
229 /* max6369 on CS5 (512 bytes, 8bits, writable) */
230 vulcan_max6369_resource
.start
= IXP4XX_EXP_BUS_BASE(5);
231 vulcan_max6369_resource
.end
= IXP4XX_EXP_BUS_BASE(5);
232 *IXP4XX_EXP_CS5
= IXP4XX_EXP_BUS_CS_EN
|
233 IXP4XX_EXP_BUS_WR_EN
|
234 IXP4XX_EXP_BUS_BYTE_EN
;
236 platform_add_devices(vulcan_devices
, ARRAY_SIZE(vulcan_devices
));
239 MACHINE_START(ARCOM_VULCAN
, "Arcom/Eurotech Vulcan")
240 /* Maintainer: Marc Zyngier <maz@misterjones.org> */
241 .map_io
= ixp4xx_map_io
,
242 .init_early
= ixp4xx_init_early
,
243 .init_irq
= ixp4xx_init_irq
,
244 .init_time
= ixp4xx_timer_init
,
245 .atag_offset
= 0x100,
246 .init_machine
= vulcan_init
,
247 #if defined(CONFIG_PCI)
248 .dma_zone_size
= SZ_64M
,
250 .restart
= ixp4xx_restart
,