1 Index: linux-2.6.25.1/arch/arm/mach-ixp4xx/Kconfig
2 ===================================================================
3 --- linux-2.6.25.1.orig/arch/arm/mach-ixp4xx/Kconfig
4 +++ linux-2.6.25.1/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.25.1/arch/arm/mach-ixp4xx/Makefile
21 ===================================================================
22 --- linux-2.6.25.1.orig/arch/arm/mach-ixp4xx/Makefile
23 +++ linux-2.6.25.1/arch/arm/mach-ixp4xx/Makefile
24 @@ -18,6 +18,7 @@ obj-pci-$(CONFIG_MACH_WG302V2) += wg302
25 obj-pci-$(CONFIG_MACH_FSG) += fsg-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 @@ -34,6 +35,7 @@ obj-$(CONFIG_MACH_WG302V2) += wg302v2-se
33 obj-$(CONFIG_MACH_FSG) += fsg-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 obj-$(CONFIG_IXP4XX_QMGR) += ixp4xx_qmgr.o
40 Index: linux-2.6.25.1/arch/arm/mach-ixp4xx/wrt300nv2-pci.c
41 ===================================================================
43 +++ linux-2.6.25.1/arch/arm/mach-ixp4xx/wrt300nv2-pci.c
46 + * arch/arch/mach-ixp4xx/wrt300nv2-pci.c
48 + * PCI setup routines for Linksys WRT300N v2
50 + * Copyright (C) 2007 Imre Kaloz <kaloz@openwrt.org>
52 + * based on coyote-pci.c:
53 + * Copyright (C) 2002 Jungo Software Technologies.
54 + * Copyright (C) 2003 MontaVista Softwrae, 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>
73 +#include <asm/mach/pci.h>
75 +extern void ixp4xx_pci_preinit(void);
76 +extern int ixp4xx_setup(int nr, struct pci_sys_data *sys);
77 +extern struct pci_bus *ixp4xx_scan_bus(int nr, struct pci_sys_data *sys);
79 +void __init wrt300nv2_pci_preinit(void)
81 + set_irq_type(IRQ_IXP4XX_GPIO8, IRQT_LOW);
83 + ixp4xx_pci_preinit();
86 +static int __init wrt300nv2_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
89 + return IRQ_IXP4XX_GPIO8;
93 +struct hw_pci wrt300nv2_pci __initdata = {
94 + .nr_controllers = 1,
95 + .preinit = wrt300nv2_pci_preinit,
96 + .swizzle = pci_std_swizzle,
97 + .setup = ixp4xx_setup,
98 + .scan = ixp4xx_scan_bus,
99 + .map_irq = wrt300nv2_map_irq,
102 +int __init wrt300nv2_pci_init(void)
104 + if (machine_is_wrt300nv2())
105 + pci_common_init(&wrt300nv2_pci);
109 +subsys_initcall(wrt300nv2_pci_init);
110 Index: linux-2.6.25.1/arch/arm/mach-ixp4xx/wrt300nv2-setup.c
111 ===================================================================
113 +++ linux-2.6.25.1/arch/arm/mach-ixp4xx/wrt300nv2-setup.c
116 + * arch/arm/mach-ixp4xx/wrt300nv2-setup.c
118 + * Board setup for the Linksys WRT300N v2
120 + * Copyright (C) 2007 Imre Kaloz <Kaloz@openwrt.org>
122 + * based on coyote-setup.c:
123 + * Copyright (C) 2003-2005 MontaVista Software, Inc.
125 + * Author: Imre Kaloz <Kaloz@openwrt.org>
128 +#include <linux/kernel.h>
129 +#include <linux/init.h>
130 +#include <linux/device.h>
131 +#include <linux/serial.h>
132 +#include <linux/tty.h>
133 +#include <linux/serial_8250.h>
134 +#include <linux/slab.h>
136 +#include <asm/types.h>
137 +#include <asm/setup.h>
138 +#include <asm/memory.h>
139 +#include <asm/hardware.h>
140 +#include <asm/irq.h>
141 +#include <asm/mach-types.h>
142 +#include <asm/mach/arch.h>
143 +#include <asm/mach/flash.h>
145 +static struct flash_platform_data wrt300nv2_flash_data = {
146 + .map_name = "cfi_probe",
150 +static struct resource wrt300nv2_flash_resource = {
151 + .flags = IORESOURCE_MEM,
154 +static struct platform_device wrt300nv2_flash = {
155 + .name = "IXP4XX-Flash",
158 + .platform_data = &wrt300nv2_flash_data,
160 + .num_resources = 1,
161 + .resource = &wrt300nv2_flash_resource,
164 +static struct resource wrt300nv2_uart_resource = {
165 + .start = IXP4XX_UART2_BASE_PHYS,
166 + .end = IXP4XX_UART2_BASE_PHYS + 0x0fff,
167 + .flags = IORESOURCE_MEM,
170 +static struct plat_serial8250_port wrt300nv2_uart_data[] = {
172 + .mapbase = IXP4XX_UART2_BASE_PHYS,
173 + .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET,
174 + .irq = IRQ_IXP4XX_UART2,
175 + .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
176 + .iotype = UPIO_MEM,
178 + .uartclk = IXP4XX_UART_XTAL,
183 +static struct platform_device wrt300nv2_uart = {
184 + .name = "serial8250",
185 + .id = PLAT8250_DEV_PLATFORM,
187 + .platform_data = wrt300nv2_uart_data,
189 + .num_resources = 1,
190 + .resource = &wrt300nv2_uart_resource,
193 +static struct platform_device *wrt300nv2_devices[] __initdata = {
198 +static void __init wrt300nv2_init(void)
202 + wrt300nv2_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
203 + wrt300nv2_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_32M - 1;
205 + *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE;
206 + *IXP4XX_EXP_CS1 = *IXP4XX_EXP_CS0;
208 + platform_add_devices(wrt300nv2_devices, ARRAY_SIZE(wrt300nv2_devices));
211 +#ifdef CONFIG_MACH_WRT300NV2
212 +MACHINE_START(WRT300NV2, "Linksys WRT300N v2")
213 + /* Maintainer: Imre Kaloz <kaloz@openwrt.org> */
214 + .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
215 + .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
216 + .map_io = ixp4xx_map_io,
217 + .init_irq = ixp4xx_init_irq,
218 + .timer = &ixp4xx_timer,
219 + .boot_params = 0x0100,
220 + .init_machine = wrt300nv2_init,
223 Index: linux-2.6.25.1/include/asm-arm/arch-ixp4xx/uncompress.h
224 ===================================================================
225 --- linux-2.6.25.1.orig/include/asm-arm/arch-ixp4xx/uncompress.h
226 +++ linux-2.6.25.1/include/asm-arm/arch-ixp4xx/uncompress.h
227 @@ -42,7 +42,7 @@ static __inline__ void __arch_decomp_set
229 if (machine_is_adi_coyote() || machine_is_gtwx5715() ||
230 machine_is_gateway7001() || machine_is_wg302v2() ||
231 - machine_is_pronghorn_metro())
232 + machine_is_pronghorn_metro() || machine_is_wrt300nv2())
233 uart_base = (volatile u32*) IXP4XX_UART2_BASE_PHYS;
235 uart_base = (volatile u32*) IXP4XX_UART1_BASE_PHYS;