1 --- a/arch/arm/mach-ixp4xx/Kconfig
2 +++ b/arch/arm/mach-ixp4xx/Kconfig
3 @@ -93,6 +93,14 @@ config MACH_COMPEXWP18
4 WP18 or NP18A boards. For more information on this
5 platform, see http://www.compex.com.sg/home/OEM/product_ap.htm
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
20 @@ -22,6 +22,7 @@ obj-pci-$(CONFIG_MACH_ARCOM_VULCAN) += v
21 obj-pci-$(CONFIG_MACH_PRONGHORN) += pronghorn-pci.o
22 obj-pci-$(CONFIG_MACH_SIDEWINDER) += sidewinder-pci.o
23 obj-pci-$(CONFIG_MACH_COMPEXWP18) += ixdp425-pci.o
24 +obj-pci-$(CONFIG_MACH_WRT300NV2) += wrt300nv2-pci.o
28 @@ -45,6 +46,7 @@ obj-$(CONFIG_MACH_ARCOM_VULCAN) += vulca
29 obj-$(CONFIG_MACH_PRONGHORN) += pronghorn-setup.o
30 obj-$(CONFIG_MACH_SIDEWINDER) += sidewinder-setup.o
31 obj-$(CONFIG_MACH_COMPEXWP18) += compex42x-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
36 --- a/arch/arm/mach-ixp4xx/include/mach/uncompress.h
37 +++ b/arch/arm/mach-ixp4xx/include/mach/uncompress.h
38 @@ -43,7 +43,8 @@ static __inline__ void __arch_decomp_set
39 if (machine_is_adi_coyote() || machine_is_gtwx5715() ||
40 machine_is_gateway7001() || machine_is_wg302v2() ||
41 machine_is_devixp() || machine_is_miccpt() || machine_is_mic256() ||
42 - machine_is_pronghorn() || machine_is_pronghorn_metro())
43 + machine_is_pronghorn() || machine_is_pronghorn_metro() ||
44 + machine_is_wrt300nv2())
45 uart_base = (volatile u32*) IXP4XX_UART2_BASE_PHYS;
47 uart_base = (volatile u32*) IXP4XX_UART1_BASE_PHYS;
49 +++ b/arch/arm/mach-ixp4xx/wrt300nv2-pci.c
52 + * arch/arch/mach-ixp4xx/wrt300nv2-pci.c
54 + * PCI setup routines for Linksys WRT300N v2
56 + * Copyright (C) 2007 Imre Kaloz <kaloz@openwrt.org>
58 + * based on coyote-pci.c:
59 + * Copyright (C) 2002 Jungo Software Technologies.
60 + * Copyright (C) 2003 MontaVista Softwrae, Inc.
62 + * Maintainer: Imre Kaloz <kaloz@openwrt.org>
64 + * This program is free software; you can redistribute it and/or modify
65 + * it under the terms of the GNU General Public License version 2 as
66 + * published by the Free Software Foundation.
70 +#include <linux/kernel.h>
71 +#include <linux/pci.h>
72 +#include <linux/init.h>
73 +#include <linux/irq.h>
75 +#include <asm/mach-types.h>
76 +#include <mach/hardware.h>
79 +#include <asm/mach/pci.h>
81 +extern void ixp4xx_pci_preinit(void);
82 +extern int ixp4xx_setup(int nr, struct pci_sys_data *sys);
83 +extern struct pci_bus *ixp4xx_scan_bus(int nr, struct pci_sys_data *sys);
85 +void __init wrt300nv2_pci_preinit(void)
87 + irq_set_irq_type(IRQ_IXP4XX_GPIO8, IRQ_TYPE_LEVEL_LOW);
89 + ixp4xx_pci_preinit();
92 +static int __init wrt300nv2_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
95 + return IRQ_IXP4XX_GPIO8;
99 +struct hw_pci wrt300nv2_pci __initdata = {
100 + .nr_controllers = 1,
101 + .preinit = wrt300nv2_pci_preinit,
102 + .ops = &ixp4xx_ops,
103 + .setup = ixp4xx_setup,
104 + .map_irq = wrt300nv2_map_irq,
107 +int __init wrt300nv2_pci_init(void)
109 + if (machine_is_wrt300nv2())
110 + pci_common_init(&wrt300nv2_pci);
114 +subsys_initcall(wrt300nv2_pci_init);
116 +++ b/arch/arm/mach-ixp4xx/wrt300nv2-setup.c
119 + * arch/arm/mach-ixp4xx/wrt300nv2-setup.c
121 + * Board setup for the Linksys WRT300N v2
123 + * Copyright (C) 2007 Imre Kaloz <Kaloz@openwrt.org>
125 + * based on coyote-setup.c:
126 + * Copyright (C) 2003-2005 MontaVista Software, Inc.
128 + * Author: Imre Kaloz <Kaloz@openwrt.org>
131 +#include <linux/kernel.h>
132 +#include <linux/init.h>
133 +#include <linux/device.h>
134 +#include <linux/serial.h>
135 +#include <linux/tty.h>
136 +#include <linux/serial_8250.h>
137 +#include <linux/slab.h>
139 +#include <asm/types.h>
140 +#include <asm/setup.h>
141 +#include <asm/memory.h>
142 +#include <mach/hardware.h>
143 +#include <asm/irq.h>
144 +#include <asm/mach-types.h>
145 +#include <asm/mach/arch.h>
146 +#include <asm/mach/flash.h>
148 +static struct flash_platform_data wrt300nv2_flash_data = {
149 + .map_name = "cfi_probe",
153 +static struct resource wrt300nv2_flash_resource = {
154 + .flags = IORESOURCE_MEM,
157 +static struct platform_device wrt300nv2_flash = {
158 + .name = "IXP4XX-Flash",
161 + .platform_data = &wrt300nv2_flash_data,
163 + .num_resources = 1,
164 + .resource = &wrt300nv2_flash_resource,
167 +static struct resource wrt300nv2_uart_resource = {
168 + .start = IXP4XX_UART2_BASE_PHYS,
169 + .end = IXP4XX_UART2_BASE_PHYS + 0x0fff,
170 + .flags = IORESOURCE_MEM,
173 +static struct plat_serial8250_port wrt300nv2_uart_data[] = {
175 + .mapbase = IXP4XX_UART2_BASE_PHYS,
176 + .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET,
177 + .irq = IRQ_IXP4XX_UART2,
178 + .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
179 + .iotype = UPIO_MEM,
181 + .uartclk = IXP4XX_UART_XTAL,
186 +static struct platform_device wrt300nv2_uart = {
187 + .name = "serial8250",
188 + .id = PLAT8250_DEV_PLATFORM,
190 + .platform_data = wrt300nv2_uart_data,
192 + .num_resources = 1,
193 + .resource = &wrt300nv2_uart_resource,
196 +static struct platform_device *wrt300nv2_devices[] __initdata = {
201 +static void __init wrt300nv2_init(void)
205 + wrt300nv2_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
206 + wrt300nv2_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_32M - 1;
208 + *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE;
209 + *IXP4XX_EXP_CS1 = *IXP4XX_EXP_CS0;
211 + platform_add_devices(wrt300nv2_devices, ARRAY_SIZE(wrt300nv2_devices));
214 +#ifdef CONFIG_MACH_WRT300NV2
215 +MACHINE_START(WRT300NV2, "Linksys WRT300N v2")
216 + /* Maintainer: Imre Kaloz <kaloz@openwrt.org> */
217 + .map_io = ixp4xx_map_io,
218 + .init_irq = ixp4xx_init_irq,
219 + .init_time = ixp4xx_timer_init,
220 + .atag_offset = 0x0100,
221 + .init_machine = wrt300nv2_init,
222 +#if defined(CONFIG_PCI)
223 + .dma_zone_size = SZ_64M,
225 + .restart = ixp4xx_restart,