1 --- a/arch/arm/mach-ixp4xx/Kconfig
2 +++ b/arch/arm/mach-ixp4xx/Kconfig
4 WP18 or NP18A boards. For more information on this
5 platform, see http://openwrt.org
8 + bool "Linksys WRT300N v2"
11 + Say 'Y' here if you want your kernel to support Linksys'
12 + WRT300N v2 router. For more information on this
13 + platform, see http://openwrt.org
18 --- a/arch/arm/mach-ixp4xx/Makefile
19 +++ b/arch/arm/mach-ixp4xx/Makefile
21 obj-pci-$(CONFIG_MACH_FSG) += fsg-pci.o
22 obj-pci-$(CONFIG_MACH_PRONGHORNMETRO) += pronghornmetro-pci.o
23 obj-pci-$(CONFIG_MACH_COMPEX) += ixdp425-pci.o
24 +obj-pci-$(CONFIG_MACH_WRT300NV2) += wrt300nv2-pci.o
29 obj-$(CONFIG_MACH_FSG) += fsg-setup.o
30 obj-$(CONFIG_MACH_PRONGHORNMETRO) += pronghornmetro-setup.o
31 obj-$(CONFIG_MACH_COMPEX) += compex-setup.o
32 +obj-$(CONFIG_MACH_WRT300NV2) += wrt300nv2-setup.o
34 obj-$(CONFIG_PCI) += $(obj-pci-$(CONFIG_PCI)) common-pci.o
35 obj-$(CONFIG_IXP4XX_QMGR) += ixp4xx_qmgr.o
37 +++ b/arch/arm/mach-ixp4xx/wrt300nv2-pci.c
40 + * arch/arch/mach-ixp4xx/wrt300nv2-pci.c
42 + * PCI setup routines for Linksys WRT300N v2
44 + * Copyright (C) 2007 Imre Kaloz <kaloz@openwrt.org>
46 + * based on coyote-pci.c:
47 + * Copyright (C) 2002 Jungo Software Technologies.
48 + * Copyright (C) 2003 MontaVista Softwrae, Inc.
50 + * Maintainer: Imre Kaloz <kaloz@openwrt.org>
52 + * This program is free software; you can redistribute it and/or modify
53 + * it under the terms of the GNU General Public License version 2 as
54 + * published by the Free Software Foundation.
58 +#include <linux/kernel.h>
59 +#include <linux/pci.h>
60 +#include <linux/init.h>
61 +#include <linux/irq.h>
63 +#include <asm/mach-types.h>
64 +#include <asm/hardware.h>
67 +#include <asm/mach/pci.h>
69 +extern void ixp4xx_pci_preinit(void);
70 +extern int ixp4xx_setup(int nr, struct pci_sys_data *sys);
71 +extern struct pci_bus *ixp4xx_scan_bus(int nr, struct pci_sys_data *sys);
73 +void __init wrt300nv2_pci_preinit(void)
75 + set_irq_type(IRQ_IXP4XX_GPIO8, IRQT_LOW);
77 + ixp4xx_pci_preinit();
80 +static int __init wrt300nv2_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
83 + return IRQ_IXP4XX_GPIO8;
87 +struct hw_pci wrt300nv2_pci __initdata = {
88 + .nr_controllers = 1,
89 + .preinit = wrt300nv2_pci_preinit,
90 + .swizzle = pci_std_swizzle,
91 + .setup = ixp4xx_setup,
92 + .scan = ixp4xx_scan_bus,
93 + .map_irq = wrt300nv2_map_irq,
96 +int __init wrt300nv2_pci_init(void)
98 + if (machine_is_wrt300nv2())
99 + pci_common_init(&wrt300nv2_pci);
103 +subsys_initcall(wrt300nv2_pci_init);
105 +++ b/arch/arm/mach-ixp4xx/wrt300nv2-setup.c
108 + * arch/arm/mach-ixp4xx/wrt300nv2-setup.c
110 + * Board setup for the Linksys WRT300N v2
112 + * Copyright (C) 2007 Imre Kaloz <Kaloz@openwrt.org>
114 + * based on coyote-setup.c:
115 + * Copyright (C) 2003-2005 MontaVista Software, Inc.
117 + * Author: Imre Kaloz <Kaloz@openwrt.org>
120 +#include <linux/kernel.h>
121 +#include <linux/init.h>
122 +#include <linux/device.h>
123 +#include <linux/serial.h>
124 +#include <linux/tty.h>
125 +#include <linux/serial_8250.h>
126 +#include <linux/slab.h>
128 +#include <asm/types.h>
129 +#include <asm/setup.h>
130 +#include <asm/memory.h>
131 +#include <asm/hardware.h>
132 +#include <asm/irq.h>
133 +#include <asm/mach-types.h>
134 +#include <asm/mach/arch.h>
135 +#include <asm/mach/flash.h>
137 +static struct flash_platform_data wrt300nv2_flash_data = {
138 + .map_name = "cfi_probe",
142 +static struct resource wrt300nv2_flash_resource = {
143 + .flags = IORESOURCE_MEM,
146 +static struct platform_device wrt300nv2_flash = {
147 + .name = "IXP4XX-Flash",
150 + .platform_data = &wrt300nv2_flash_data,
152 + .num_resources = 1,
153 + .resource = &wrt300nv2_flash_resource,
156 +static struct resource wrt300nv2_uart_resource = {
157 + .start = IXP4XX_UART2_BASE_PHYS,
158 + .end = IXP4XX_UART2_BASE_PHYS + 0x0fff,
159 + .flags = IORESOURCE_MEM,
162 +static struct plat_serial8250_port wrt300nv2_uart_data[] = {
164 + .mapbase = IXP4XX_UART2_BASE_PHYS,
165 + .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET,
166 + .irq = IRQ_IXP4XX_UART2,
167 + .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
168 + .iotype = UPIO_MEM,
170 + .uartclk = IXP4XX_UART_XTAL,
175 +static struct platform_device wrt300nv2_uart = {
176 + .name = "serial8250",
177 + .id = PLAT8250_DEV_PLATFORM,
179 + .platform_data = wrt300nv2_uart_data,
181 + .num_resources = 1,
182 + .resource = &wrt300nv2_uart_resource,
185 +static struct platform_device *wrt300nv2_devices[] __initdata = {
190 +static void __init wrt300nv2_init(void)
194 + wrt300nv2_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
195 + wrt300nv2_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_32M - 1;
197 + *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE;
198 + *IXP4XX_EXP_CS1 = *IXP4XX_EXP_CS0;
200 + platform_add_devices(wrt300nv2_devices, ARRAY_SIZE(wrt300nv2_devices));
203 +#ifdef CONFIG_MACH_WRT300NV2
204 +MACHINE_START(WRT300NV2, "Linksys WRT300N v2")
205 + /* Maintainer: Imre Kaloz <kaloz@openwrt.org> */
206 + .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
207 + .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
208 + .map_io = ixp4xx_map_io,
209 + .init_irq = ixp4xx_init_irq,
210 + .timer = &ixp4xx_timer,
211 + .boot_params = 0x0100,
212 + .init_machine = wrt300nv2_init,
215 --- a/include/asm-arm/arch-ixp4xx/uncompress.h
216 +++ b/include/asm-arm/arch-ixp4xx/uncompress.h
219 if (machine_is_adi_coyote() || machine_is_gtwx5715() ||
220 machine_is_gateway7001() || machine_is_wg302v2() ||
221 - machine_is_pronghorn_metro())
222 + machine_is_pronghorn_metro() || machine_is_wrt300nv2())
223 uart_base = (volatile u32*) IXP4XX_UART2_BASE_PHYS;
225 uart_base = (volatile u32*) IXP4XX_UART1_BASE_PHYS;