1 diff -Nur linux-2.6.23/arch/arm/mach-ixp4xx/Kconfig linux-2.6.23-owrt/arch/arm/mach-ixp4xx/Kconfig
2 --- linux-2.6.23/arch/arm/mach-ixp4xx/Kconfig 2007-10-23 18:39:29.000000000 +0200
3 +++ linux-2.6.23-owrt/arch/arm/mach-ixp4xx/Kconfig 2007-10-23 19:11:31.000000000 +0200
5 WP18 or NP18A boards. For more information on this
6 platform, see http://openwrt.org
9 + bool "Linksys WRT300N v2"
12 + Say 'Y' here if you want your kernel to support Linksys'
13 + WRT300N v2 router. For more information on this
14 + platform, see http://openwrt.org
19 diff -Nur linux-2.6.23/arch/arm/mach-ixp4xx/Makefile linux-2.6.23-owrt/arch/arm/mach-ixp4xx/Makefile
20 --- linux-2.6.23/arch/arm/mach-ixp4xx/Makefile 2007-10-23 18:39:29.000000000 +0200
21 +++ linux-2.6.23-owrt/arch/arm/mach-ixp4xx/Makefile 2007-10-23 19:11:31.000000000 +0200
23 obj-pci-$(CONFIG_MACH_FSG) += fsg-pci.o
24 obj-pci-$(CONFIG_MACH_PRONGHORNMETRO) += pronghornmetro-pci.o
25 obj-pci-$(CONFIG_MACH_COMPEX) += ixdp425-pci.o
26 +obj-pci-$(CONFIG_MACH_WRT300NV2) += wrt300nv2-pci.o
31 obj-$(CONFIG_MACH_FSG) += fsg-setup.o
32 obj-$(CONFIG_MACH_PRONGHORNMETRO) += pronghornmetro-setup.o
33 obj-$(CONFIG_MACH_COMPEX) += compex-setup.o
34 +obj-$(CONFIG_MACH_WRT300NV2) += wrt300nv2-setup.o
36 obj-$(CONFIG_PCI) += $(obj-pci-$(CONFIG_PCI)) common-pci.o
37 obj-$(CONFIG_IXP4XX_QMGR) += ixp4xx_qmgr.o
38 diff -Nur linux-2.6.23/arch/arm/mach-ixp4xx/wrt300nv2-pci.c linux-2.6.23-owrt/arch/arm/mach-ixp4xx/wrt300nv2-pci.c
39 --- linux-2.6.23/arch/arm/mach-ixp4xx/wrt300nv2-pci.c 1970-01-01 01:00:00.000000000 +0100
40 +++ linux-2.6.23-owrt/arch/arm/mach-ixp4xx/wrt300nv2-pci.c 2007-10-23 19:11:31.000000000 +0200
43 + * arch/arch/mach-ixp4xx/wrt300nv2-pci.c
45 + * PCI setup routines for Linksys WRT300N v2
47 + * Copyright (C) 2007 Imre Kaloz <kaloz@openwrt.org>
49 + * based on coyote-pci.c:
50 + * Copyright (C) 2002 Jungo Software Technologies.
51 + * Copyright (C) 2003 MontaVista Softwrae, Inc.
53 + * Maintainer: Imre Kaloz <kaloz@openwrt.org>
55 + * This program is free software; you can redistribute it and/or modify
56 + * it under the terms of the GNU General Public License version 2 as
57 + * published by the Free Software Foundation.
61 +#include <linux/kernel.h>
62 +#include <linux/pci.h>
63 +#include <linux/init.h>
64 +#include <linux/irq.h>
66 +#include <asm/mach-types.h>
67 +#include <asm/hardware.h>
70 +#include <asm/mach/pci.h>
72 +extern void ixp4xx_pci_preinit(void);
73 +extern int ixp4xx_setup(int nr, struct pci_sys_data *sys);
74 +extern struct pci_bus *ixp4xx_scan_bus(int nr, struct pci_sys_data *sys);
76 +void __init wrt300nv2_pci_preinit(void)
78 + set_irq_type(IRQ_IXP4XX_GPIO8, IRQT_LOW);
80 + ixp4xx_pci_preinit();
83 +static int __init wrt300nv2_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
86 + return IRQ_IXP4XX_GPIO8;
90 +struct hw_pci wrt300nv2_pci __initdata = {
91 + .nr_controllers = 1,
92 + .preinit = wrt300nv2_pci_preinit,
93 + .swizzle = pci_std_swizzle,
94 + .setup = ixp4xx_setup,
95 + .scan = ixp4xx_scan_bus,
96 + .map_irq = wrt300nv2_map_irq,
99 +int __init wrt300nv2_pci_init(void)
101 + if (machine_is_wrt300nv2())
102 + pci_common_init(&wrt300nv2_pci);
106 +subsys_initcall(wrt300nv2_pci_init);
107 diff -Nur linux-2.6.23/arch/arm/mach-ixp4xx/wrt300nv2-setup.c linux-2.6.23-owrt/arch/arm/mach-ixp4xx/wrt300nv2-setup.c
108 --- linux-2.6.23/arch/arm/mach-ixp4xx/wrt300nv2-setup.c 1970-01-01 01:00:00.000000000 +0100
109 +++ linux-2.6.23-owrt/arch/arm/mach-ixp4xx/wrt300nv2-setup.c 2007-10-23 19:11:31.000000000 +0200
112 + * arch/arm/mach-ixp4xx/wrt300nv2-setup.c
114 + * Board setup for the Linksys WRT300N v2
116 + * Copyright (C) 2007 Imre Kaloz <Kaloz@openwrt.org>
118 + * based on coyote-setup.c:
119 + * Copyright (C) 2003-2005 MontaVista Software, Inc.
121 + * Author: Imre Kaloz <Kaloz@openwrt.org>
124 +#include <linux/kernel.h>
125 +#include <linux/init.h>
126 +#include <linux/device.h>
127 +#include <linux/serial.h>
128 +#include <linux/tty.h>
129 +#include <linux/serial_8250.h>
130 +#include <linux/slab.h>
132 +#include <asm/types.h>
133 +#include <asm/setup.h>
134 +#include <asm/memory.h>
135 +#include <asm/hardware.h>
136 +#include <asm/irq.h>
137 +#include <asm/mach-types.h>
138 +#include <asm/mach/arch.h>
139 +#include <asm/mach/flash.h>
141 +static struct flash_platform_data wrt300nv2_flash_data = {
142 + .map_name = "cfi_probe",
146 +static struct resource wrt300nv2_flash_resource = {
147 + .flags = IORESOURCE_MEM,
150 +static struct platform_device wrt300nv2_flash = {
151 + .name = "IXP4XX-Flash",
154 + .platform_data = &wrt300nv2_flash_data,
156 + .num_resources = 1,
157 + .resource = &wrt300nv2_flash_resource,
160 +static struct resource wrt300nv2_uart_resource = {
161 + .start = IXP4XX_UART2_BASE_PHYS,
162 + .end = IXP4XX_UART2_BASE_PHYS + 0x0fff,
163 + .flags = IORESOURCE_MEM,
166 +static struct plat_serial8250_port wrt300nv2_uart_data[] = {
168 + .mapbase = IXP4XX_UART2_BASE_PHYS,
169 + .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET,
170 + .irq = IRQ_IXP4XX_UART2,
171 + .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
172 + .iotype = UPIO_MEM,
174 + .uartclk = IXP4XX_UART_XTAL,
179 +static struct platform_device wrt300nv2_uart = {
180 + .name = "serial8250",
181 + .id = PLAT8250_DEV_PLATFORM,
183 + .platform_data = wrt300nv2_uart_data,
185 + .num_resources = 1,
186 + .resource = &wrt300nv2_uart_resource,
189 +static struct platform_device *wrt300nv2_devices[] __initdata = {
194 +static void __init wrt300nv2_init(void)
198 + wrt300nv2_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
199 + wrt300nv2_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_32M - 1;
201 + *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE;
202 + *IXP4XX_EXP_CS1 = *IXP4XX_EXP_CS0;
204 + platform_add_devices(wrt300nv2_devices, ARRAY_SIZE(wrt300nv2_devices));
207 +#ifdef CONFIG_MACH_WRT300NV2
208 +MACHINE_START(WRT300NV2, "Linksys WRT300N v2")
209 + /* Maintainer: Imre Kaloz <kaloz@openwrt.org> */
210 + .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
211 + .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
212 + .map_io = ixp4xx_map_io,
213 + .init_irq = ixp4xx_init_irq,
214 + .timer = &ixp4xx_timer,
215 + .boot_params = 0x0100,
216 + .init_machine = wrt300nv2_init,
219 diff -Nur linux-2.6.23/include/asm-arm/arch-ixp4xx/uncompress.h linux-2.6.23-owrt/include/asm-arm/arch-ixp4xx/uncompress.h
220 --- linux-2.6.23/include/asm-arm/arch-ixp4xx/uncompress.h 2007-10-23 18:03:35.000000000 +0200
221 +++ linux-2.6.23-owrt/include/asm-arm/arch-ixp4xx/uncompress.h 2007-10-23 19:12:30.000000000 +0200
224 if (machine_is_adi_coyote() || machine_is_gtwx5715() ||
225 machine_is_gateway7001() || machine_is_wg302v2() ||
226 - machine_is_pronghorn_metro())
227 + machine_is_pronghorn_metro() || machine_is_wrt300nv2())
228 uart_base = (volatile u32*) IXP4XX_UART2_BASE_PHYS;
230 uart_base = (volatile u32*) IXP4XX_UART1_BASE_PHYS;