1 --- a/arch/arm/configs/ixp4xx_defconfig
2 +++ b/arch/arm/configs/ixp4xx_defconfig
5 CONFIG_ARCH_ADI_COYOTE=y
6 CONFIG_MACH_GATEWAY7001=y
10 CONFIG_MACH_IXDPG425=y
11 --- a/arch/arm/mach-ixp4xx/Kconfig
12 +++ b/arch/arm/mach-ixp4xx/Kconfig
14 7001 Access Point. For more information on this platform,
15 see http://openwrt.org
18 + bool "Netgear WG302 v1 / WAG302 v1"
21 + Say 'Y' here if you want your kernel to support Netgear's
22 + WG302 v1 or WAG302 v1 Access Points. For more information
23 + on this platform, see http://openwrt.org
26 bool "Netgear WG302 v2 / WAG302 v2"
28 --- a/arch/arm/mach-ixp4xx/Makefile
29 +++ b/arch/arm/mach-ixp4xx/Makefile
31 obj-pci-$(CONFIG_MACH_NAS100D) += nas100d-pci.o
32 obj-pci-$(CONFIG_MACH_DSMG600) += dsmg600-pci.o
33 obj-pci-$(CONFIG_MACH_GATEWAY7001) += gateway7001-pci.o
34 +obj-pci-$(CONFIG_MACH_WG302V1) += wg302v1-pci.o
35 obj-pci-$(CONFIG_MACH_WG302V2) += wg302v2-pci.o
36 obj-pci-$(CONFIG_MACH_FSG) += fsg-pci.o
39 obj-$(CONFIG_MACH_NAS100D) += nas100d-setup.o
40 obj-$(CONFIG_MACH_DSMG600) += dsmg600-setup.o
41 obj-$(CONFIG_MACH_GATEWAY7001) += gateway7001-setup.o
42 +obj-$(CONFIG_MACH_WG302V1) += wg302v1-setup.o
43 obj-$(CONFIG_MACH_WG302V2) += wg302v2-setup.o
44 obj-$(CONFIG_MACH_FSG) += fsg-setup.o
47 +++ b/arch/arm/mach-ixp4xx/wg302v1-pci.c
50 + * arch/arch/mach-ixp4xx/wg302v1-pci.c
52 + * PCI setup routines for the Netgear WG302 v1 and WAG302 v1
54 + * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
56 + * based on coyote-pci.c:
57 + * Copyright (C) 2002 Jungo Software Technologies.
58 + * Copyright (C) 2003 MontaVista Software, Inc.
60 + * Maintainer: Imre Kaloz <kaloz@openwrt.org>
62 + * This program is free software; you can redistribute it and/or modify
63 + * it under the terms of the GNU General Public License version 2 as
64 + * published by the Free Software Foundation.
68 +#include <linux/kernel.h>
69 +#include <linux/pci.h>
70 +#include <linux/init.h>
71 +#include <linux/irq.h>
73 +#include <asm/mach-types.h>
74 +#include <asm/hardware.h>
76 +#include <asm/mach/pci.h>
78 +void __init wg302v1_pci_preinit(void)
80 + set_irq_type(IRQ_IXP4XX_GPIO8, IRQT_LOW);
81 + set_irq_type(IRQ_IXP4XX_GPIO10, IRQT_LOW);
83 + ixp4xx_pci_preinit();
86 +static int __init wg302v1_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
89 + return IRQ_IXP4XX_GPIO8;
91 + return IRQ_IXP4XX_GPIO10;
96 +struct hw_pci wg302v1_pci __initdata = {
97 + .nr_controllers = 1,
98 + .preinit = wg302v1_pci_preinit,
99 + .swizzle = pci_std_swizzle,
100 + .setup = ixp4xx_setup,
101 + .scan = ixp4xx_scan_bus,
102 + .map_irq = wg302v1_map_irq,
105 +int __init wg302v1_pci_init(void)
107 + if (machine_is_wg302v1())
108 + pci_common_init(&wg302v1_pci);
112 +subsys_initcall(wg302v1_pci_init);
114 +++ b/arch/arm/mach-ixp4xx/wg302v1-setup.c
117 + * arch/arm/mach-ixp4xx/wg302v1-setup.c
119 + * Board setup for the Netgear WG302 v1 and WAG302 v1
121 + * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
123 + * based on coyote-setup.c:
124 + * Copyright (C) 2003-2005 MontaVista Software, Inc.
126 + * Author: Imre Kaloz <kaloz@openwrt.org>
130 +#include <linux/kernel.h>
131 +#include <linux/init.h>
132 +#include <linux/device.h>
133 +#include <linux/serial.h>
134 +#include <linux/tty.h>
135 +#include <linux/serial_8250.h>
136 +#include <linux/slab.h>
137 +#include <linux/types.h>
138 +#include <linux/memory.h>
140 +#include <asm/setup.h>
141 +#include <asm/hardware.h>
142 +#include <asm/irq.h>
143 +#include <asm/mach-types.h>
144 +#include <asm/mach/arch.h>
145 +#include <asm/mach/flash.h>
147 +static struct flash_platform_data wg302v1_flash_data = {
148 + .map_name = "cfi_probe",
152 +static struct resource wg302v1_flash_resource = {
153 + .flags = IORESOURCE_MEM,
156 +static struct platform_device wg302v1_flash = {
157 + .name = "IXP4XX-Flash",
160 + .platform_data = &wg302v1_flash_data,
162 + .num_resources = 1,
163 + .resource = &wg302v1_flash_resource,
166 +static struct resource wg302v1_uart_resource = {
167 + .start = IXP4XX_UART1_BASE_PHYS,
168 + .end = IXP4XX_UART1_BASE_PHYS + 0x0fff,
169 + .flags = IORESOURCE_MEM,
172 +static struct plat_serial8250_port wg302v1_uart_data[] = {
174 + .mapbase = IXP4XX_UART1_BASE_PHYS,
175 + .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET,
176 + .irq = IRQ_IXP4XX_UART1,
177 + .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
178 + .iotype = UPIO_MEM,
180 + .uartclk = IXP4XX_UART_XTAL,
185 +static struct platform_device wg302v1_uart = {
186 + .name = "serial8250",
187 + .id = PLAT8250_DEV_PLATFORM,
189 + .platform_data = wg302v1_uart_data,
191 + .num_resources = 1,
192 + .resource = &wg302v1_uart_resource,
195 +static struct eth_plat_info wg302v1_plat_eth[] = {
203 +static struct platform_device wg302v1_eth[] = {
205 + .name = "ixp4xx_eth",
206 + .id = IXP4XX_ETH_NPEB,
207 + .dev.platform_data = wg302v1_plat_eth,
211 +static struct platform_device *wg302v1_devices[] __initdata = {
217 +static void __init wg302v1_init(void)
221 + wg302v1_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
222 + wg302v1_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_32M - 1;
224 + *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE;
225 + *IXP4XX_EXP_CS1 = *IXP4XX_EXP_CS0;
227 + platform_add_devices(wg302v1_devices, ARRAY_SIZE(wg302v1_devices));
230 +#ifdef CONFIG_MACH_WG302V1
231 +MACHINE_START(WG302V1, "Netgear WG302 v1 / WAG302 v1")
232 + /* Maintainer: Imre Kaloz <kaloz@openwrt.org> */
233 + .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
234 + .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
235 + .map_io = ixp4xx_map_io,
236 + .init_irq = ixp4xx_init_irq,
237 + .timer = &ixp4xx_timer,
238 + .boot_params = 0x0100,
239 + .init_machine = wg302v1_init,