1 Index: linux-2.6.21.7/arch/arm/mach-ixp4xx/Kconfig
2 ===================================================================
3 --- linux-2.6.21.7.orig/arch/arm/mach-ixp4xx/Kconfig
4 +++ linux-2.6.21.7/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 v2 / WAG302 v2"
13 + Say 'Y' here if you want your kernel to support Netgear's
14 + WG302 v2 or WAG302 v2 Access Points. For more information
15 + on this platform, see http://openwrt.org
20 Index: linux-2.6.21.7/arch/arm/mach-ixp4xx/Makefile
21 ===================================================================
22 --- linux-2.6.21.7.orig/arch/arm/mach-ixp4xx/Makefile
23 +++ linux-2.6.21.7/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_WG302V2) += wg302v2-pci.o
32 @@ -26,5 +27,6 @@ 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_WG302V2) += wg302v2-setup.o
38 obj-$(CONFIG_PCI) += $(obj-pci-$(CONFIG_PCI)) common-pci.o
39 Index: linux-2.6.21.7/arch/arm/mach-ixp4xx/wg302v2-pci.c
40 ===================================================================
42 +++ linux-2.6.21.7/arch/arm/mach-ixp4xx/wg302v2-pci.c
45 + * arch/arch/mach-ixp4xx/wg302v2-pci.c
47 + * PCI setup routines for the Netgear WG302 v2 and WAG302 v2
49 + * Copyright (C) 2006 Imre Kaloz <kaloz@openwrt.org>
51 + * based on coyote-pci.c:
52 + * Copyright (C) 2002 Jungo Software Technologies.
53 + * Copyright (C) 2003 MontaVista Software, Inc.
55 + * Maintainer: Imre Kaloz <kaloz@openwrt.org>
57 + * This program is free software; you can redistribute it and/or modify
58 + * it under the terms of the GNU General Public License version 2 as
59 + * published by the Free Software Foundation.
63 +#include <linux/kernel.h>
64 +#include <linux/pci.h>
65 +#include <linux/init.h>
66 +#include <linux/irq.h>
68 +#include <asm/mach-types.h>
69 +#include <asm/hardware.h>
72 +#include <asm/mach/pci.h>
74 +extern void ixp4xx_pci_preinit(void);
75 +extern int ixp4xx_setup(int nr, struct pci_sys_data *sys);
76 +extern struct pci_bus *ixp4xx_scan_bus(int nr, struct pci_sys_data *sys);
78 +void __init wg302v2_pci_preinit(void)
80 + set_irq_type(IRQ_IXP4XX_GPIO8, IRQT_LOW);
81 + set_irq_type(IRQ_IXP4XX_GPIO9, IRQT_LOW);
83 + ixp4xx_pci_preinit();
86 +static int __init wg302v2_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
89 + return IRQ_IXP4XX_GPIO8;
91 + return IRQ_IXP4XX_GPIO9;
95 +struct hw_pci wg302v2_pci __initdata = {
96 + .nr_controllers = 1,
97 + .preinit = wg302v2_pci_preinit,
98 + .swizzle = pci_std_swizzle,
99 + .setup = ixp4xx_setup,
100 + .scan = ixp4xx_scan_bus,
101 + .map_irq = wg302v2_map_irq,
104 +int __init wg302v2_pci_init(void)
106 + if (machine_is_wg302v2())
107 + pci_common_init(&wg302v2_pci);
111 +subsys_initcall(wg302v2_pci_init);
112 Index: linux-2.6.21.7/arch/arm/mach-ixp4xx/wg302v2-setup.c
113 ===================================================================
115 +++ linux-2.6.21.7/arch/arm/mach-ixp4xx/wg302v2-setup.c
118 + * arch/arm/mach-ixp4xx/wg302-setup.c
120 + * Board setup for the Netgear WG302 v2 and WAG302 v2
122 + * based on coyote-setup.c:
123 + * Copyright (C) 2003-2005 MontaVista Software, Inc.
125 + * Maintainer: Imre Kaloz <kaloz@openwrt.org>
129 +#include <linux/kernel.h>
130 +#include <linux/init.h>
131 +#include <linux/device.h>
132 +#include <linux/serial.h>
133 +#include <linux/tty.h>
134 +#include <linux/serial_8250.h>
135 +#include <linux/slab.h>
137 +#include <asm/types.h>
138 +#include <asm/setup.h>
139 +#include <asm/memory.h>
140 +#include <asm/hardware.h>
141 +#include <asm/irq.h>
142 +#include <asm/mach-types.h>
143 +#include <asm/mach/arch.h>
144 +#include <asm/mach/flash.h>
146 +static struct flash_platform_data wg302v2_flash_data = {
147 + .map_name = "cfi_probe",
151 +static struct resource wg302v2_flash_resource = {
152 + .flags = IORESOURCE_MEM,
155 +static struct platform_device wg302v2_flash = {
156 + .name = "IXP4XX-Flash",
159 + .platform_data = &wg302v2_flash_data,
161 + .num_resources = 1,
162 + .resource = &wg302v2_flash_resource,
165 +static struct resource wg302v2_uart_resource = {
166 + .start = IXP4XX_UART2_BASE_PHYS,
167 + .end = IXP4XX_UART2_BASE_PHYS + 0x0fff,
168 + .flags = IORESOURCE_MEM,
171 +static struct plat_serial8250_port wg302v2_uart_data[] = {
173 + .mapbase = IXP4XX_UART2_BASE_PHYS,
174 + .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET,
175 + .irq = IRQ_IXP4XX_UART2,
176 + .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
177 + .iotype = UPIO_MEM,
179 + .uartclk = IXP4XX_UART_XTAL,
184 +static struct platform_device wg302v2_uart = {
185 + .name = "serial8250",
186 + .id = PLAT8250_DEV_PLATFORM,
188 + .platform_data = wg302v2_uart_data,
190 + .num_resources = 1,
191 + .resource = &wg302v2_uart_resource,
194 +static struct platform_device *wg302v2_devices[] __initdata = {
199 +static void __init wg302v2_init(void)
203 + wg302v2_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
204 + wg302v2_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_32M - 1;
206 + *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE;
207 + *IXP4XX_EXP_CS1 = *IXP4XX_EXP_CS0;
209 + platform_add_devices(wg302v2_devices, ARRAY_SIZE(wg302v2_devices));
212 +#ifdef CONFIG_MACH_WG302V2
213 +MACHINE_START(WG302V2, "Netgear WG302 v2 / WAG302 v2")
214 + /* Maintainer: Imre Kaloz <kaloz@openwrt.org> */
215 + .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
216 + .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
217 + .map_io = ixp4xx_map_io,
218 + .init_irq = ixp4xx_init_irq,
219 + .timer = &ixp4xx_timer,
220 + .boot_params = 0x0100,
221 + .init_machine = wg302v2_init,
224 Index: linux-2.6.21.7/include/asm-arm/arch-ixp4xx/uncompress.h
225 ===================================================================
226 --- linux-2.6.21.7.orig/include/asm-arm/arch-ixp4xx/uncompress.h
227 +++ linux-2.6.21.7/include/asm-arm/arch-ixp4xx/uncompress.h
228 @@ -40,7 +40,7 @@ static __inline__ void __arch_decomp_set
230 * Some boards are using UART2 as console
232 - if (machine_is_adi_coyote() || machine_is_gtwx5715() || machine_is_gateway7001())
233 + if (machine_is_adi_coyote() || machine_is_gtwx5715() || machine_is_gateway7001() || machine_is_wg302v2())
234 uart_base = (volatile u32*) IXP4XX_UART2_BASE_PHYS;
236 uart_base = (volatile u32*) IXP4XX_UART1_BASE_PHYS;