2 * arch/arm/mach-ixp4xx/wg302-setup.c
4 * Board setup for the Netgear WG302 v2 and WAG302 v2
6 * Copyright (C) 2007 Imre Kaloz <Kaloz@openwrt.org>
8 * based on coyote-setup.c:
9 * Copyright (C) 2003-2005 MontaVista Software, Inc.
11 * Author: Imre Kaloz <kaloz@openwrt.org>
15 #include <linux/kernel.h>
16 #include <linux/init.h>
17 #include <linux/device.h>
18 #include <linux/serial.h>
19 #include <linux/tty.h>
20 #include <linux/serial_8250.h>
22 #include <asm/types.h>
23 #include <asm/setup.h>
24 #include <asm/memory.h>
25 #include <mach/hardware.h>
27 #include <asm/mach-types.h>
28 #include <asm/mach/arch.h>
29 #include <asm/mach/flash.h>
31 static struct flash_platform_data wg302v2_flash_data
= {
32 .map_name
= "cfi_probe",
36 static struct resource wg302v2_flash_resource
= {
37 .flags
= IORESOURCE_MEM
,
40 static struct platform_device wg302v2_flash
= {
41 .name
= "IXP4XX-Flash",
44 .platform_data
= &wg302v2_flash_data
,
47 .resource
= &wg302v2_flash_resource
,
50 static struct resource wg302v2_uart_resource
= {
51 .start
= IXP4XX_UART2_BASE_PHYS
,
52 .end
= IXP4XX_UART2_BASE_PHYS
+ 0x0fff,
53 .flags
= IORESOURCE_MEM
,
56 static struct plat_serial8250_port wg302v2_uart_data
[] = {
58 .mapbase
= IXP4XX_UART2_BASE_PHYS
,
59 .membase
= (char *)IXP4XX_UART2_BASE_VIRT
+ REG_OFFSET
,
60 .irq
= IRQ_IXP4XX_UART2
,
61 .flags
= UPF_BOOT_AUTOCONF
| UPF_SKIP_TEST
,
64 .uartclk
= IXP4XX_UART_XTAL
,
69 static struct platform_device wg302v2_uart
= {
71 .id
= PLAT8250_DEV_PLATFORM
,
73 .platform_data
= wg302v2_uart_data
,
76 .resource
= &wg302v2_uart_resource
,
79 static struct platform_device
*wg302v2_devices
[] __initdata
= {
84 static void __init
wg302v2_init(void)
88 wg302v2_flash_resource
.start
= IXP4XX_EXP_BUS_BASE(0);
89 wg302v2_flash_resource
.end
= IXP4XX_EXP_BUS_BASE(0) + SZ_32M
- 1;
91 *IXP4XX_EXP_CS0
|= IXP4XX_FLASH_WRITABLE
;
92 *IXP4XX_EXP_CS1
= *IXP4XX_EXP_CS0
;
94 platform_add_devices(wg302v2_devices
, ARRAY_SIZE(wg302v2_devices
));
97 #ifdef CONFIG_MACH_WG302V2
98 MACHINE_START(WG302V2
, "Netgear WG302 v2 / WAG302 v2")
99 /* Maintainer: Imre Kaloz <kaloz@openwrt.org> */
100 .map_io
= ixp4xx_map_io
,
101 .init_irq
= ixp4xx_init_irq
,
102 .timer
= &ixp4xx_timer
,
103 .atag_offset
= 0x100,
104 .init_machine
= wg302v2_init
,
105 #if defined(CONFIG_PCI)
106 .dma_zone_size
= SZ_64M
,