1 Index: linux-2.6.23.17/arch/arm/mach-ixp4xx/Kconfig
2 ===================================================================
3 --- linux-2.6.23.17.orig/arch/arm/mach-ixp4xx/Kconfig
4 +++ linux-2.6.23.17/arch/arm/mach-ixp4xx/Kconfig
5 @@ -49,6 +49,14 @@ config MACH_GATEWAY7001
6 7001 Access Point. For more information on this platform,
10 + bool "Netgear WG302 v1 / WAG302 v1"
13 + Say 'Y' here if you want your kernel to support Netgear's
14 + WG302 v1 or WAG302 v1 Access Points. For more information
15 + on this platform, see http://openwrt.org
18 bool "Netgear WG302 v2 / WAG302 v2"
20 Index: linux-2.6.23.17/arch/arm/mach-ixp4xx/Makefile
21 ===================================================================
22 --- linux-2.6.23.17.orig/arch/arm/mach-ixp4xx/Makefile
23 +++ linux-2.6.23.17/arch/arm/mach-ixp4xx/Makefile
24 @@ -14,6 +14,7 @@ obj-pci-$(CONFIG_MACH_NSLU2) += nslu2-p
25 obj-pci-$(CONFIG_MACH_NAS100D) += nas100d-pci.o
26 obj-pci-$(CONFIG_MACH_DSMG600) += dsmg600-pci.o
27 obj-pci-$(CONFIG_MACH_GATEWAY7001) += gateway7001-pci.o
28 +obj-pci-$(CONFIG_MACH_WG302V1) += wg302v1-pci.o
29 obj-pci-$(CONFIG_MACH_WG302V2) += wg302v2-pci.o
30 obj-pci-$(CONFIG_MACH_FSG) += fsg-pci.o
31 obj-pci-$(CONFIG_MACH_PRONGHORNMETRO) += pronghornmetro-pci.o
32 @@ -33,6 +34,7 @@ obj-$(CONFIG_MACH_NSLU2) += nslu2-setup.
33 obj-$(CONFIG_MACH_NAS100D) += nas100d-setup.o nas100d-power.o
34 obj-$(CONFIG_MACH_DSMG600) += dsmg600-setup.o dsmg600-power.o
35 obj-$(CONFIG_MACH_GATEWAY7001) += gateway7001-setup.o
36 +obj-$(CONFIG_MACH_WG302V1) += wg302v1-setup.o
37 obj-$(CONFIG_MACH_WG302V2) += wg302v2-setup.o
38 obj-$(CONFIG_MACH_FSG) += fsg-setup.o fsg-power.o
39 obj-$(CONFIG_MACH_PRONGHORNMETRO) += pronghornmetro-setup.o
40 Index: linux-2.6.23.17/arch/arm/mach-ixp4xx/wg302v1-pci.c
41 ===================================================================
43 +++ linux-2.6.23.17/arch/arm/mach-ixp4xx/wg302v1-pci.c
46 + * arch/arch/mach-ixp4xx/wg302v1-pci.c
48 + * PCI setup routines for the Netgear WG302 v1 and WAG302 v1
50 + * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
52 + * based on coyote-pci.c:
53 + * Copyright (C) 2002 Jungo Software Technologies.
54 + * Copyright (C) 2003 MontaVista Software, Inc.
56 + * Maintainer: Imre Kaloz <kaloz@openwrt.org>
58 + * This program is free software; you can redistribute it and/or modify
59 + * it under the terms of the GNU General Public License version 2 as
60 + * published by the Free Software Foundation.
64 +#include <linux/kernel.h>
65 +#include <linux/pci.h>
66 +#include <linux/init.h>
67 +#include <linux/irq.h>
69 +#include <asm/mach-types.h>
70 +#include <asm/hardware.h>
72 +#include <asm/mach/pci.h>
74 +void __init wg302v1_pci_preinit(void)
76 + set_irq_type(IRQ_IXP4XX_GPIO8, IRQT_LOW);
77 + set_irq_type(IRQ_IXP4XX_GPIO10, IRQT_LOW);
79 + ixp4xx_pci_preinit();
82 +static int __init wg302v1_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
85 + return IRQ_IXP4XX_GPIO8;
87 + return IRQ_IXP4XX_GPIO10;
91 +struct hw_pci wg302v1_pci __initdata = {
92 + .nr_controllers = 1,
93 + .preinit = wg302v1_pci_preinit,
94 + .swizzle = pci_std_swizzle,
95 + .setup = ixp4xx_setup,
96 + .scan = ixp4xx_scan_bus,
97 + .map_irq = wg302v1_map_irq,
100 +int __init wg302v1_pci_init(void)
102 + if (machine_is_wg302v1())
103 + pci_common_init(&wg302v1_pci);
107 +subsys_initcall(wg302v1_pci_init);
108 Index: linux-2.6.23.17/arch/arm/mach-ixp4xx/wg302v1-setup.c
109 ===================================================================
111 +++ linux-2.6.23.17/arch/arm/mach-ixp4xx/wg302v1-setup.c
114 + * arch/arm/mach-ixp4xx/wg302v1-setup.c
116 + * Board setup for the Netgear WG302 v1 and WAG302 v1
118 + * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
120 + * based on coyote-setup.c:
121 + * Copyright (C) 2003-2005 MontaVista Software, Inc.
123 + * Author: Imre Kaloz <kaloz@openwrt.org>
127 +#include <linux/kernel.h>
128 +#include <linux/init.h>
129 +#include <linux/device.h>
130 +#include <linux/serial.h>
131 +#include <linux/tty.h>
132 +#include <linux/serial_8250.h>
133 +#include <linux/slab.h>
135 +#include <asm/types.h>
136 +#include <asm/setup.h>
137 +#include <asm/memory.h>
138 +#include <asm/hardware.h>
139 +#include <asm/irq.h>
140 +#include <asm/mach-types.h>
141 +#include <asm/mach/arch.h>
142 +#include <asm/mach/flash.h>
144 +static struct flash_platform_data wg302v1_flash_data = {
145 + .map_name = "cfi_probe",
149 +static struct resource wg302v1_flash_resource = {
150 + .flags = IORESOURCE_MEM,
153 +static struct platform_device wg302v1_flash = {
154 + .name = "IXP4XX-Flash",
157 + .platform_data = &wg302v1_flash_data,
159 + .num_resources = 1,
160 + .resource = &wg302v1_flash_resource,
163 +static struct resource wg302v1_uart_resource = {
164 + .start = IXP4XX_UART1_BASE_PHYS,
165 + .end = IXP4XX_UART1_BASE_PHYS + 0x0fff,
166 + .flags = IORESOURCE_MEM,
169 +static struct plat_serial8250_port wg302v1_uart_data[] = {
171 + .mapbase = IXP4XX_UART1_BASE_PHYS,
172 + .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET,
173 + .irq = IRQ_IXP4XX_UART1,
174 + .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
175 + .iotype = UPIO_MEM,
177 + .uartclk = IXP4XX_UART_XTAL,
182 +static struct platform_device wg302v1_uart = {
183 + .name = "serial8250",
184 + .id = PLAT8250_DEV_PLATFORM,
186 + .platform_data = wg302v1_uart_data,
188 + .num_resources = 1,
189 + .resource = &wg302v1_uart_resource,
192 +static struct platform_device *wg302v1_devices[] __initdata = {
197 +static void __init wg302v1_init(void)
201 + wg302v1_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
202 + wg302v1_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_32M - 1;
204 + *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE;
205 + *IXP4XX_EXP_CS1 = *IXP4XX_EXP_CS0;
207 + platform_add_devices(wg302v1_devices, ARRAY_SIZE(wg302v1_devices));
210 +#ifdef CONFIG_MACH_WG302V1
211 +MACHINE_START(WG302V1, "Netgear WG302 v1 / WAG302 v1")
212 + /* Maintainer: Imre Kaloz <kaloz@openwrt.org> */
213 + .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
214 + .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
215 + .map_io = ixp4xx_map_io,
216 + .init_irq = ixp4xx_init_irq,
217 + .timer = &ixp4xx_timer,
218 + .boot_params = 0x0100,
219 + .init_machine = wg302v1_init,