1 --- a/arch/arm/mach-ixp4xx/Kconfig
2 +++ b/arch/arm/mach-ixp4xx/Kconfig
3 @@ -97,6 +97,14 @@ config MACH_SIDEWINDER
4 Engineering Sidewinder board. For more information on this
5 platform, see http://www.adiengineering.com
8 + bool "USRobotics USR8200"
11 + Say 'Y' here if you want your kernel to support the USRobotics
12 + USR8200 router board. For more information on this platform, see
16 bool "Compex WP18 / NP18A"
18 --- a/arch/arm/mach-ixp4xx/Makefile
19 +++ b/arch/arm/mach-ixp4xx/Makefile
20 @@ -24,6 +24,7 @@ obj-pci-$(CONFIG_MACH_COMPEX) += ixdp42
21 obj-pci-$(CONFIG_MACH_WRT300NV2) += wrt300nv2-pci.o
22 obj-pci-$(CONFIG_MACH_AP1000) += ixdp425-pci.o
23 obj-pci-$(CONFIG_MACH_TW5334) += tw5334-pci.o
24 +obj-pci-$(CONFIG_MACH_USR8200) += usr8200-pci.o
28 @@ -46,6 +47,7 @@ obj-$(CONFIG_MACH_COMPEX) += compex-setu
29 obj-$(CONFIG_MACH_WRT300NV2) += wrt300nv2-setup.o
30 obj-$(CONFIG_MACH_AP1000) += ap1000-setup.o
31 obj-$(CONFIG_MACH_TW5334) += tw5334-setup.o
32 +obj-$(CONFIG_MACH_USR8200) += usr8200-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/usr8200-pci.c
40 + * arch/arch/mach-ixp4xx/usr8200-pci.c
42 + * PCI setup routines for USRobotics USR8200
44 + * Copyright (C) 2008 Peter Denison <openwrt@marshadder.org>
46 + * based on pronghorn-pci.c
47 + * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
48 + * based on coyote-pci.c:
49 + * Copyright (C) 2002 Jungo Software Technologies.
50 + * Copyright (C) 2003 MontaVista Softwrae, Inc.
52 + * Maintainer: Peter Denison <openwrt@marshadder.org>
54 + * This program is free software; you can redistribute it and/or modify
55 + * it under the terms of the GNU General Public License version 2 as
56 + * published by the Free Software Foundation.
60 +#include <linux/kernel.h>
61 +#include <linux/pci.h>
62 +#include <linux/init.h>
63 +#include <linux/irq.h>
65 +#include <asm/mach-types.h>
66 +#include <asm/hardware.h>
68 +#include <asm/mach/pci.h>
70 +void __init usr8200_pci_preinit(void)
72 + set_irq_type(IRQ_IXP4XX_GPIO7, IRQT_LOW);
73 + set_irq_type(IRQ_IXP4XX_GPIO8, IRQT_LOW);
74 + set_irq_type(IRQ_IXP4XX_GPIO9, IRQT_LOW);
75 + set_irq_type(IRQ_IXP4XX_GPIO10, IRQT_LOW);
76 + set_irq_type(IRQ_IXP4XX_GPIO11, IRQT_LOW);
78 + ixp4xx_pci_preinit();
81 +static int __init usr8200_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
84 + return IRQ_IXP4XX_GPIO7;
85 + else if (slot == 15)
86 + return IRQ_IXP4XX_GPIO8;
87 + else if (slot == 16) {
89 + return IRQ_IXP4XX_GPIO11;
91 + return IRQ_IXP4XX_GPIO10;
93 + return IRQ_IXP4XX_GPIO9;
100 +struct hw_pci usr8200_pci __initdata = {
101 + .nr_controllers = 1,
102 + .preinit = usr8200_pci_preinit,
103 + .swizzle = pci_std_swizzle,
104 + .setup = ixp4xx_setup,
105 + .scan = ixp4xx_scan_bus,
106 + .map_irq = usr8200_map_irq,
109 +int __init usr8200_pci_init(void)
111 + if (machine_is_usr8200())
112 + pci_common_init(&usr8200_pci);
116 +subsys_initcall(usr8200_pci_init);
118 +++ b/arch/arm/mach-ixp4xx/usr8200-setup.c
121 + * arch/arm/mach-ixp4xx/usr8200-setup.c
123 + * Board setup for the USRobotics USR8200
125 + * Copyright (C) 2008 Peter Denison <openwrt@marshadder.org>
127 + * based on pronghorn-setup.c:
128 + * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
129 + * based on coyote-setup.c:
130 + * Copyright (C) 2003-2005 MontaVista Software, Inc.
132 + * Author: Peter Denison <openwrt@marshadder.org>
135 +#include <linux/kernel.h>
136 +#include <linux/init.h>
137 +#include <linux/device.h>
138 +#include <linux/serial.h>
139 +#include <linux/tty.h>
140 +#include <linux/serial_8250.h>
141 +#include <linux/slab.h>
142 +#include <linux/types.h>
143 +#include <linux/memory.h>
144 +#include <linux/i2c-gpio.h>
145 +#include <linux/leds.h>
147 +#include <asm/setup.h>
148 +#include <asm/hardware.h>
149 +#include <asm/irq.h>
150 +#include <asm/mach-types.h>
151 +#include <asm/mach/arch.h>
152 +#include <asm/mach/flash.h>
154 +static struct flash_platform_data usr8200_flash_data = {
155 + .map_name = "cfi_probe",
159 +static struct resource usr8200_flash_resource = {
160 + .flags = IORESOURCE_MEM,
163 +static struct platform_device usr8200_flash = {
164 + .name = "IXP4XX-Flash",
167 + .platform_data = &usr8200_flash_data,
169 + .num_resources = 1,
170 + .resource = &usr8200_flash_resource,
173 +static struct resource usr8200_uart_resources [] = {
175 + .start = IXP4XX_UART2_BASE_PHYS,
176 + .end = IXP4XX_UART2_BASE_PHYS + 0x0fff,
177 + .flags = IORESOURCE_MEM
180 + .start = IXP4XX_UART1_BASE_PHYS,
181 + .end = IXP4XX_UART1_BASE_PHYS + 0x0fff,
182 + .flags = IORESOURCE_MEM
186 +static struct plat_serial8250_port usr8200_uart_data[] = {
188 + .mapbase = IXP4XX_UART2_BASE_PHYS,
189 + .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET,
190 + .irq = IRQ_IXP4XX_UART2,
191 + .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
192 + .iotype = UPIO_MEM,
194 + .uartclk = IXP4XX_UART_XTAL,
197 + .mapbase = IXP4XX_UART1_BASE_PHYS,
198 + .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET,
199 + .irq = IRQ_IXP4XX_UART1,
200 + .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
201 + .iotype = UPIO_MEM,
203 + .uartclk = IXP4XX_UART_XTAL,
208 +static struct platform_device usr8200_uart = {
209 + .name = "serial8250",
210 + .id = PLAT8250_DEV_PLATFORM,
212 + .platform_data = usr8200_uart_data,
214 + .num_resources = 2,
215 + .resource = usr8200_uart_resources,
219 +static struct i2c_gpio_platform_data usr8200_i2c_gpio_data = {
224 +static struct platform_device usr8200_i2c_gpio = {
225 + .name = "i2c-gpio",
228 + .platform_data = &usr8200_i2c_gpio_data,
232 +static struct gpio_led usr8200_led_pin[] = {
234 + .name = "usr8200:green:status",
239 +static struct gpio_led_platform_data usr8200_led_data = {
241 + .leds = usr8200_led_pin,
244 +static struct platform_device usr8200_led = {
245 + .name = "leds-gpio",
247 + .dev.platform_data = &usr8200_led_data,
251 +static struct eth_plat_info usr8200_plat_eth[] = {
263 +static struct platform_device usr8200_eth[] = {
265 + .name = "ixp4xx_eth",
266 + .id = IXP4XX_ETH_NPEB,
267 + .dev.platform_data = usr8200_plat_eth,
269 + .name = "ixp4xx_eth",
270 + .id = IXP4XX_ETH_NPEC,
271 + .dev.platform_data = usr8200_plat_eth + 1,
275 +static struct platform_device *usr8200_devices[] __initdata = {
279 + &usr8200_i2c_gpio, */
284 +static void __init usr8200_init(void)
288 + usr8200_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
289 + usr8200_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_64M - 1;
291 + *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE;
292 + *IXP4XX_EXP_CS1 = *IXP4XX_EXP_CS0;
294 + platform_add_devices(usr8200_devices, ARRAY_SIZE(usr8200_devices));
297 +MACHINE_START(USR8200, "USRobotics USR8200")
298 + /* Maintainer: Peter Denison <openwrt@marshadder.org> */
299 + .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
300 + .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
301 + .map_io = ixp4xx_map_io,
302 + .init_irq = ixp4xx_init_irq,
303 + .timer = &ixp4xx_timer,
304 + .boot_params = 0x0100,
305 + .init_machine = usr8200_init,
307 --- a/include/asm-arm/arch-ixp4xx/uncompress.h
308 +++ b/include/asm-arm/arch-ixp4xx/uncompress.h
309 @@ -43,7 +43,7 @@ static __inline__ void __arch_decomp_set
310 if (machine_is_adi_coyote() || machine_is_gtwx5715() ||
311 machine_is_gateway7001() || machine_is_wg302v2() ||
312 machine_is_pronghorn() || machine_is_pronghorn_metro() || machine_is_wrt300nv2() ||
313 - machine_is_tw5334())
314 + machine_is_tw5334() || machine_is_usr8200())
315 uart_base = (volatile u32*) IXP4XX_UART2_BASE_PHYS;
317 uart_base = (volatile u32*) IXP4XX_UART1_BASE_PHYS;