1 --- a/arch/arm/mach-ixp4xx/Kconfig
2 +++ b/arch/arm/mach-ixp4xx/Kconfig
3 @@ -93,6 +93,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
15 config MACH_COMPEXWP18
16 bool "Compex WP18 / NP18A"
18 --- a/arch/arm/mach-ixp4xx/Makefile
19 +++ b/arch/arm/mach-ixp4xx/Makefile
20 @@ -27,6 +27,7 @@ obj-pci-$(CONFIG_MACH_WRT300NV2) += wrt
21 obj-pci-$(CONFIG_MACH_AP1000) += ixdp425-pci.o
22 obj-pci-$(CONFIG_MACH_TW5334) += tw5334-pci.o
23 obj-pci-$(CONFIG_MACH_MI424WR) += mi424wr-pci.o
24 +obj-pci-$(CONFIG_MACH_USR8200) += usr8200-pci.o
28 @@ -55,6 +56,7 @@ obj-$(CONFIG_MACH_WRT300NV2) += wrt300nv
29 obj-$(CONFIG_MACH_AP1000) += ap1000-setup.o
30 obj-$(CONFIG_MACH_TW5334) += tw5334-setup.o
31 obj-$(CONFIG_MACH_MI424WR) += mi424wr-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
36 --- a/arch/arm/mach-ixp4xx/include/mach/uncompress.h
37 +++ b/arch/arm/mach-ixp4xx/include/mach/uncompress.h
38 @@ -44,7 +44,8 @@ static __inline__ void __arch_decomp_set
39 machine_is_gateway7001() || machine_is_wg302v2() ||
40 machine_is_devixp() || machine_is_miccpt() || machine_is_mic256() ||
41 machine_is_pronghorn() || machine_is_pronghorn_metro() ||
42 - machine_is_wrt300nv2() || machine_is_tw5334())
43 + machine_is_wrt300nv2() || machine_is_tw5334() ||
44 + machine_is_usr8200())
45 uart_base = (volatile u32*) IXP4XX_UART2_BASE_PHYS;
47 uart_base = (volatile u32*) IXP4XX_UART1_BASE_PHYS;
49 +++ b/arch/arm/mach-ixp4xx/usr8200-pci.c
52 + * arch/arch/mach-ixp4xx/usr8200-pci.c
54 + * PCI setup routines for USRobotics USR8200
56 + * Copyright (C) 2008 Peter Denison <openwrt@marshadder.org>
58 + * based on pronghorn-pci.c
59 + * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
60 + * based on coyote-pci.c:
61 + * Copyright (C) 2002 Jungo Software Technologies.
62 + * Copyright (C) 2003 MontaVista Softwrae, Inc.
64 + * Maintainer: Peter Denison <openwrt@marshadder.org>
66 + * This program is free software; you can redistribute it and/or modify
67 + * it under the terms of the GNU General Public License version 2 as
68 + * published by the Free Software Foundation.
72 +#include <linux/kernel.h>
73 +#include <linux/pci.h>
74 +#include <linux/init.h>
75 +#include <linux/irq.h>
77 +#include <asm/mach-types.h>
78 +#include <mach/hardware.h>
80 +#include <asm/mach/pci.h>
82 +void __init usr8200_pci_preinit(void)
84 + irq_set_irq_type(IRQ_IXP4XX_GPIO7, IRQ_TYPE_LEVEL_LOW);
85 + irq_set_irq_type(IRQ_IXP4XX_GPIO8, IRQ_TYPE_LEVEL_LOW);
86 + irq_set_irq_type(IRQ_IXP4XX_GPIO9, IRQ_TYPE_LEVEL_LOW);
87 + irq_set_irq_type(IRQ_IXP4XX_GPIO10, IRQ_TYPE_LEVEL_LOW);
88 + irq_set_irq_type(IRQ_IXP4XX_GPIO11, IRQ_TYPE_LEVEL_LOW);
90 + ixp4xx_pci_preinit();
93 +static int __init usr8200_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
96 + return IRQ_IXP4XX_GPIO7;
97 + else if (slot == 15)
98 + return IRQ_IXP4XX_GPIO8;
99 + else if (slot == 16) {
101 + return IRQ_IXP4XX_GPIO11;
103 + return IRQ_IXP4XX_GPIO10;
105 + return IRQ_IXP4XX_GPIO9;
112 +struct hw_pci usr8200_pci __initdata = {
113 + .nr_controllers = 1,
114 + .preinit = usr8200_pci_preinit,
115 + .ops = &ixp4xx_ops,
116 + .setup = ixp4xx_setup,
117 + .map_irq = usr8200_map_irq,
120 +int __init usr8200_pci_init(void)
122 + if (machine_is_usr8200())
123 + pci_common_init(&usr8200_pci);
127 +subsys_initcall(usr8200_pci_init);
129 +++ b/arch/arm/mach-ixp4xx/usr8200-setup.c
132 + * arch/arm/mach-ixp4xx/usr8200-setup.c
134 + * Board setup for the USRobotics USR8200
136 + * Copyright (C) 2008 Peter Denison <openwrt@marshadder.org>
138 + * based on pronghorn-setup.c:
139 + * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
140 + * based on coyote-setup.c:
141 + * Copyright (C) 2003-2005 MontaVista Software, Inc.
143 + * Author: Peter Denison <openwrt@marshadder.org>
146 +#include <linux/kernel.h>
147 +#include <linux/init.h>
148 +#include <linux/device.h>
149 +#include <linux/serial.h>
150 +#include <linux/tty.h>
151 +#include <linux/serial_8250.h>
152 +#include <linux/slab.h>
153 +#include <linux/types.h>
154 +#include <linux/memory.h>
155 +#include <linux/i2c-gpio.h>
156 +#include <linux/leds.h>
157 +#include <linux/dma-mapping.h>
159 +#include <asm/setup.h>
160 +#include <mach/hardware.h>
161 +#include <asm/irq.h>
162 +#include <asm/mach-types.h>
163 +#include <asm/mach/arch.h>
164 +#include <asm/mach/flash.h>
166 +static struct flash_platform_data usr8200_flash_data = {
167 + .map_name = "cfi_probe",
171 +static struct resource usr8200_flash_resource = {
172 + .flags = IORESOURCE_MEM,
175 +static struct platform_device usr8200_flash = {
176 + .name = "IXP4XX-Flash",
179 + .platform_data = &usr8200_flash_data,
181 + .num_resources = 1,
182 + .resource = &usr8200_flash_resource,
185 +static struct resource usr8200_uart_resources [] = {
187 + .start = IXP4XX_UART2_BASE_PHYS,
188 + .end = IXP4XX_UART2_BASE_PHYS + 0x0fff,
189 + .flags = IORESOURCE_MEM
192 + .start = IXP4XX_UART1_BASE_PHYS,
193 + .end = IXP4XX_UART1_BASE_PHYS + 0x0fff,
194 + .flags = IORESOURCE_MEM
198 +static struct plat_serial8250_port usr8200_uart_data[] = {
200 + .mapbase = IXP4XX_UART2_BASE_PHYS,
201 + .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET,
202 + .irq = IRQ_IXP4XX_UART2,
203 + .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
204 + .iotype = UPIO_MEM,
206 + .uartclk = IXP4XX_UART_XTAL,
209 + .mapbase = IXP4XX_UART1_BASE_PHYS,
210 + .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET,
211 + .irq = IRQ_IXP4XX_UART1,
212 + .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
213 + .iotype = UPIO_MEM,
215 + .uartclk = IXP4XX_UART_XTAL,
220 +static struct platform_device usr8200_uart = {
221 + .name = "serial8250",
222 + .id = PLAT8250_DEV_PLATFORM,
224 + .platform_data = usr8200_uart_data,
226 + .num_resources = 2,
227 + .resource = usr8200_uart_resources,
230 +static struct gpio_led usr8200_led_pin[] = {
232 + .name = "usr8200:usb1",
237 + .name = "usr8200:usb2",
242 + .name = "usr8200:ieee1394",
247 + .name = "usr8200:internal",
252 + .name = "usr8200:power",
257 +static struct gpio_led_platform_data usr8200_led_data = {
258 + .num_leds = ARRAY_SIZE(usr8200_led_pin),
259 + .leds = usr8200_led_pin,
262 +static struct platform_device usr8200_led = {
263 + .name = "leds-gpio",
265 + .dev.platform_data = &usr8200_led_data,
268 +static struct eth_plat_info usr8200_plat_eth[] = {
269 + { /* NPEC - LAN with Marvell 88E6060 switch */
270 + .phy = IXP4XX_ETH_PHY_MAX_ADDR,
271 + .phy_mask = 0x0F0000,
274 + }, { /* NPEB - WAN */
281 +static struct platform_device usr8200_eth[] = {
283 + .name = "ixp4xx_eth",
284 + .id = IXP4XX_ETH_NPEC,
285 + .dev.platform_data = usr8200_plat_eth,
286 + .dev.coherent_dma_mask = DMA_BIT_MASK(32),
288 + .name = "ixp4xx_eth",
289 + .id = IXP4XX_ETH_NPEB,
290 + .dev.platform_data = usr8200_plat_eth + 1,
291 + .dev.coherent_dma_mask = DMA_BIT_MASK(32),
295 +static struct resource usr8200_rtc_resources = {
296 + .flags = IORESOURCE_MEM
299 +static struct platform_device usr8200_rtc = {
302 + .num_resources = 1,
303 + .resource = &usr8200_rtc_resources,
306 +static struct platform_device *usr8200_devices[] __initdata = {
315 +static void __init usr8200_init(void)
319 + usr8200_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
320 + usr8200_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_16M - 1;
322 + usr8200_rtc_resources.start = IXP4XX_EXP_BUS_BASE(2);
323 + usr8200_rtc_resources.end = IXP4XX_EXP_BUS_BASE(2) + 0x01ff;
325 + *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE;
326 + *IXP4XX_EXP_CS2 = 0x3fff000 | IXP4XX_EXP_BUS_SIZE(0) | IXP4XX_EXP_BUS_WR_EN |
327 + IXP4XX_EXP_BUS_CS_EN | IXP4XX_EXP_BUS_BYTE_EN;
328 + *IXP4XX_GPIO_GPCLKR = 0x01100000;
330 + /* configure button as input */
331 + gpio_line_config(12, IXP4XX_GPIO_IN);
333 + platform_add_devices(usr8200_devices, ARRAY_SIZE(usr8200_devices));
336 +MACHINE_START(USR8200, "USRobotics USR8200")
337 + /* Maintainer: Peter Denison <openwrt@marshadder.org> */
338 + .map_io = ixp4xx_map_io,
339 + .init_irq = ixp4xx_init_irq,
340 + .init_time = ixp4xx_timer_init,
341 + .atag_offset = 0x0100,
342 + .init_machine = usr8200_init,
343 +#if defined(CONFIG_PCI)
344 + .dma_zone_size = SZ_64M,
346 + .restart = ixp4xx_restart,