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 @@ -73,6 +73,14 @@ config MACH_COMPEX
6 WP18 or NP18A boards. For more information on this
7 platform, see http://openwrt.org
10 + bool "Linksys WRT300N v2"
13 + Say 'Y' here if you want your kernel to support Linksys'
14 + WRT300N v2 router. For more information on this
15 + 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 @@ -17,6 +17,7 @@ obj-pci-$(CONFIG_MACH_GATEWAY7001) += ga
25 obj-pci-$(CONFIG_MACH_WG302V2) += wg302v2-pci.o
26 obj-pci-$(CONFIG_MACH_PRONGHORNMETRO) += pronghornmetro-pci.o
27 obj-pci-$(CONFIG_MACH_COMPEX) += ixdp425-pci.o
28 +obj-pci-$(CONFIG_MACH_WRT300NV2) += wrt300nv2-pci.o
32 @@ -32,5 +33,6 @@ obj-$(CONFIG_MACH_GATEWAY7001) += gatewa
33 obj-$(CONFIG_MACH_WG302V2) += wg302v2-setup.o
34 obj-$(CONFIG_MACH_PRONGHORNMETRO) += pronghornmetro-setup.o
35 obj-$(CONFIG_MACH_COMPEX) += compex-setup.o
36 +obj-$(CONFIG_MACH_WRT300NV2) += wrt300nv2-setup.o
38 obj-$(CONFIG_PCI) += $(obj-pci-$(CONFIG_PCI)) common-pci.o
39 Index: linux-2.6.21.7/arch/arm/mach-ixp4xx/wrt300nv2-pci.c
40 ===================================================================
42 +++ linux-2.6.21.7/arch/arm/mach-ixp4xx/wrt300nv2-pci.c
45 + * arch/arch/mach-ixp4xx/wrt300nv2-pci.c
47 + * PCI setup routines for Linksys WRT300N v2
49 + * Copyright (C) 2007 Imre Kaloz <kaloz@openwrt.org>
51 + * based on coyote-pci.c:
52 + * Copyright (C) 2002 Jungo Software Technologies.
53 + * Copyright (C) 2003 MontaVista Softwrae, 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 wrt300nv2_pci_preinit(void)
80 + set_irq_type(IRQ_IXP4XX_GPIO8, IRQT_LOW);
82 + ixp4xx_pci_preinit();
85 +static int __init wrt300nv2_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
88 + return IRQ_IXP4XX_GPIO8;
92 +struct hw_pci wrt300nv2_pci __initdata = {
93 + .nr_controllers = 1,
94 + .preinit = wrt300nv2_pci_preinit,
95 + .swizzle = pci_std_swizzle,
96 + .setup = ixp4xx_setup,
97 + .scan = ixp4xx_scan_bus,
98 + .map_irq = wrt300nv2_map_irq,
101 +int __init wrt300nv2_pci_init(void)
103 + if (machine_is_wrt300nv2())
104 + pci_common_init(&wrt300nv2_pci);
108 +subsys_initcall(wrt300nv2_pci_init);
109 Index: linux-2.6.21.7/arch/arm/mach-ixp4xx/wrt300nv2-setup.c
110 ===================================================================
112 +++ linux-2.6.21.7/arch/arm/mach-ixp4xx/wrt300nv2-setup.c
115 + * arch/arm/mach-ixp4xx/wrt300nv2-setup.c
117 + * Board setup for the Linksys WRT300N v2
119 + * Copyright (C) 2007 Imre Kaloz <Kaloz@openwrt.org>
121 + * based on coyote-setup.c:
122 + * Copyright (C) 2003-2005 MontaVista Software, Inc.
124 + * 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 wrt300nv2_flash_data = {
145 + .map_name = "cfi_probe",
149 +static struct resource wrt300nv2_flash_resource = {
150 + .flags = IORESOURCE_MEM,
153 +static struct platform_device wrt300nv2_flash = {
154 + .name = "IXP4XX-Flash",
157 + .platform_data = &wrt300nv2_flash_data,
159 + .num_resources = 1,
160 + .resource = &wrt300nv2_flash_resource,
163 +static struct resource wrt300nv2_uart_resource = {
164 + .start = IXP4XX_UART2_BASE_PHYS,
165 + .end = IXP4XX_UART2_BASE_PHYS + 0x0fff,
166 + .flags = IORESOURCE_MEM,
169 +static struct plat_serial8250_port wrt300nv2_uart_data[] = {
171 + .mapbase = IXP4XX_UART2_BASE_PHYS,
172 + .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET,
173 + .irq = IRQ_IXP4XX_UART2,
174 + .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
175 + .iotype = UPIO_MEM,
177 + .uartclk = IXP4XX_UART_XTAL,
182 +static struct platform_device wrt300nv2_uart = {
183 + .name = "serial8250",
184 + .id = PLAT8250_DEV_PLATFORM,
186 + .platform_data = wrt300nv2_uart_data,
188 + .num_resources = 1,
189 + .resource = &wrt300nv2_uart_resource,
192 +static struct platform_device *wrt300nv2_devices[] __initdata = {
197 +static void __init wrt300nv2_init(void)
201 + wrt300nv2_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
202 + wrt300nv2_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(wrt300nv2_devices, ARRAY_SIZE(wrt300nv2_devices));
210 +#ifdef CONFIG_MACH_WRT300NV2
211 +MACHINE_START(WRT300NV2, "Linksys WRT300N v2")
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 = wrt300nv2_init,
222 Index: linux-2.6.21.7/include/asm-arm/arch-ixp4xx/uncompress.h
223 ===================================================================
224 --- linux-2.6.21.7.orig/include/asm-arm/arch-ixp4xx/uncompress.h
225 +++ linux-2.6.21.7/include/asm-arm/arch-ixp4xx/uncompress.h
226 @@ -40,7 +40,7 @@ static __inline__ void __arch_decomp_set
228 * Some boards are using UART2 as console
230 - if (machine_is_adi_coyote() || machine_is_gtwx5715() || machine_is_gateway7001() || machine_is_wg302v2() || machine_is_pronghorn_metro())
231 + if (machine_is_adi_coyote() || machine_is_gtwx5715() || machine_is_gateway7001() || machine_is_wg302v2() || machine_is_pronghorn_metro() || machine_is_wrt300nv2())
232 uart_base = (volatile u32*) IXP4XX_UART2_BASE_PHYS;
234 uart_base = (volatile u32*) IXP4XX_UART1_BASE_PHYS;