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>
66 +#include <asm/mach-types.h>
67 +#include <asm/hardware.h>
69 +#include <asm/mach/pci.h>
71 +void __init usr8200_pci_preinit(void)
73 + set_irq_type(IRQ_IXP4XX_GPIO7, IRQ_TYPE_LEVEL_LOW);
74 + set_irq_type(IRQ_IXP4XX_GPIO8, IRQ_TYPE_LEVEL_LOW);
75 + set_irq_type(IRQ_IXP4XX_GPIO9, IRQ_TYPE_LEVEL_LOW);
76 + set_irq_type(IRQ_IXP4XX_GPIO10, IRQ_TYPE_LEVEL_LOW);
77 + set_irq_type(IRQ_IXP4XX_GPIO11, IRQ_TYPE_LEVEL_LOW);
79 + ixp4xx_pci_preinit();
82 +static int __init usr8200_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
85 + return IRQ_IXP4XX_GPIO7;
86 + else if (slot == 15)
87 + return IRQ_IXP4XX_GPIO8;
88 + else if (slot == 16) {
90 + return IRQ_IXP4XX_GPIO11;
92 + return IRQ_IXP4XX_GPIO10;
94 + return IRQ_IXP4XX_GPIO9;
101 +struct hw_pci usr8200_pci __initdata = {
102 + .nr_controllers = 1,
103 + .preinit = usr8200_pci_preinit,
104 + .swizzle = pci_std_swizzle,
105 + .setup = ixp4xx_setup,
106 + .scan = ixp4xx_scan_bus,
107 + .map_irq = usr8200_map_irq,
110 +int __init usr8200_pci_init(void)
112 + if (machine_is_usr8200())
113 + pci_common_init(&usr8200_pci);
117 +subsys_initcall(usr8200_pci_init);
119 +++ b/arch/arm/mach-ixp4xx/usr8200-setup.c
122 + * arch/arm/mach-ixp4xx/usr8200-setup.c
124 + * Board setup for the USRobotics USR8200
126 + * Copyright (C) 2008 Peter Denison <openwrt@marshadder.org>
128 + * based on pronghorn-setup.c:
129 + * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
130 + * based on coyote-setup.c:
131 + * Copyright (C) 2003-2005 MontaVista Software, Inc.
133 + * Author: Peter Denison <openwrt@marshadder.org>
136 +#include <linux/kernel.h>
137 +#include <linux/init.h>
138 +#include <linux/device.h>
139 +#include <linux/serial.h>
140 +#include <linux/tty.h>
141 +#include <linux/serial_8250.h>
142 +#include <linux/slab.h>
143 +#include <linux/types.h>
144 +#include <linux/memory.h>
145 +#include <linux/i2c-gpio.h>
146 +#include <linux/leds.h>
148 +#include <asm/setup.h>
149 +#include <asm/hardware.h>
150 +#include <asm/irq.h>
151 +#include <asm/mach-types.h>
152 +#include <asm/mach/arch.h>
153 +#include <asm/mach/flash.h>
155 +static struct flash_platform_data usr8200_flash_data = {
156 + .map_name = "cfi_probe",
160 +static struct resource usr8200_flash_resource = {
161 + .flags = IORESOURCE_MEM,
164 +static struct platform_device usr8200_flash = {
165 + .name = "IXP4XX-Flash",
168 + .platform_data = &usr8200_flash_data,
170 + .num_resources = 1,
171 + .resource = &usr8200_flash_resource,
174 +static struct resource usr8200_uart_resources [] = {
176 + .start = IXP4XX_UART2_BASE_PHYS,
177 + .end = IXP4XX_UART2_BASE_PHYS + 0x0fff,
178 + .flags = IORESOURCE_MEM
181 + .start = IXP4XX_UART1_BASE_PHYS,
182 + .end = IXP4XX_UART1_BASE_PHYS + 0x0fff,
183 + .flags = IORESOURCE_MEM
187 +static struct plat_serial8250_port usr8200_uart_data[] = {
189 + .mapbase = IXP4XX_UART2_BASE_PHYS,
190 + .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET,
191 + .irq = IRQ_IXP4XX_UART2,
192 + .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
193 + .iotype = UPIO_MEM,
195 + .uartclk = IXP4XX_UART_XTAL,
198 + .mapbase = IXP4XX_UART1_BASE_PHYS,
199 + .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET,
200 + .irq = IRQ_IXP4XX_UART1,
201 + .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
202 + .iotype = UPIO_MEM,
204 + .uartclk = IXP4XX_UART_XTAL,
209 +static struct platform_device usr8200_uart = {
210 + .name = "serial8250",
211 + .id = PLAT8250_DEV_PLATFORM,
213 + .platform_data = usr8200_uart_data,
215 + .num_resources = 2,
216 + .resource = usr8200_uart_resources,
219 +static struct gpio_led usr8200_led_pin[] = {
221 + .name = "usr8200:usb1",
226 + .name = "usr8200:usb2",
231 + .name = "usr8200:ieee1394",
236 + .name = "usr8200:internal",
241 + .name = "usr8200:power",
246 +static struct gpio_led_platform_data usr8200_led_data = {
247 + .num_leds = ARRAY_SIZE(usr8200_led_pin),
248 + .leds = usr8200_led_pin,
251 +static struct platform_device usr8200_led = {
252 + .name = "leds-gpio",
254 + .dev.platform_data = &usr8200_led_data,
257 +static struct eth_plat_info usr8200_plat_eth[] = {
258 + { /* NPEC - LAN with Marvell 88E6060 switch */
259 + .phy = IXP4XX_ETH_PHY_MAX_ADDR,
260 + .phy_mask = 0x0F0000,
263 + }, { /* NPEB - WAN */
270 +static struct platform_device usr8200_eth[] = {
272 + .name = "ixp4xx_eth",
273 + .id = IXP4XX_ETH_NPEC,
274 + .dev.platform_data = usr8200_plat_eth,
276 + .name = "ixp4xx_eth",
277 + .id = IXP4XX_ETH_NPEB,
278 + .dev.platform_data = usr8200_plat_eth + 1,
282 +static struct resource usr8200_rtc_resources = {
283 + .flags = IORESOURCE_MEM
286 +static struct platform_device usr8200_rtc = {
289 + .resource = &usr8200_rtc_resources,
292 +static struct platform_device *usr8200_devices[] __initdata = {
301 +static void __init usr8200_init(void)
305 + usr8200_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
306 + usr8200_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_16M - 1;
308 + usr8200_rtc_resources.start = IXP4XX_EXP_BUS_BASE(2);
309 + usr8200_rtc_resources.end = IXP4XX_EXP_BUS_BASE(2) + 0x01ff;
311 + *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE;
312 + *IXP4XX_EXP_CS2 = IXP4XX_EXP_BUS_SIZE(0) | IXP4XX_EXP_BUS_WR_EN |
313 + IXP4XX_EXP_BUS_CS_EN | IXP4XX_EXP_BUS_BYTE_EN;
314 + *IXP4XX_GPIO_GPCLKR = 0x01100000;
316 + /* configure button as input */
317 + gpio_line_config(12, IXP4XX_GPIO_IN);
319 + platform_add_devices(usr8200_devices, ARRAY_SIZE(usr8200_devices));
322 +MACHINE_START(USR8200, "USRobotics USR8200")
323 + /* Maintainer: Peter Denison <openwrt@marshadder.org> */
324 + .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
325 + .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
326 + .map_io = ixp4xx_map_io,
327 + .init_irq = ixp4xx_init_irq,
328 + .timer = &ixp4xx_timer,
329 + .boot_params = 0x0100,
330 + .init_machine = usr8200_init,
332 --- a/include/asm-arm/arch-ixp4xx/uncompress.h
333 +++ b/include/asm-arm/arch-ixp4xx/uncompress.h
334 @@ -43,7 +43,7 @@ static __inline__ void __arch_decomp_set
335 if (machine_is_adi_coyote() || machine_is_gtwx5715() ||
336 machine_is_gateway7001() || machine_is_wg302v2() ||
337 machine_is_pronghorn() || machine_is_pronghorn_metro() || machine_is_wrt300nv2() ||
338 - machine_is_tw5334())
339 + machine_is_tw5334() || machine_is_usr8200())
340 uart_base = (volatile u32*) IXP4XX_UART2_BASE_PHYS;
342 uart_base = (volatile u32*) IXP4XX_UART1_BASE_PHYS;