1 --- a/arch/arm/mach-ixp4xx/Kconfig
2 +++ b/arch/arm/mach-ixp4xx/Kconfig
4 Engineering Pronghorn Metro Platform. For more
5 information on this platform, see <file:Documentation/arm/IXP4xx>.
7 +config MACH_SIDEWINDER
11 + Say 'Y' here if you want your kernel to support the ADI
12 + Engineering Sidewinder Platform. For more
13 + information on this platform, see <file:Documentation/arm/IXP4xx>.
16 bool "Compex WP18 / NP18A"
22 - depends on MACH_IXDP465
23 + depends on MACH_IXDP465 || MACH_SIDEWINDER
27 --- a/arch/arm/mach-ixp4xx/Makefile
28 +++ b/arch/arm/mach-ixp4xx/Makefile
30 obj-pci-$(CONFIG_MACH_PRONGHORNMETRO) += pronghornmetro-pci.o
31 obj-pci-$(CONFIG_MACH_COMPEX) += ixdp425-pci.o
32 obj-pci-$(CONFIG_MACH_WRT300NV2) += wrt300nv2-pci.o
33 +obj-pci-$(CONFIG_MACH_SIDEWINDER) += sidewinder-pci.o
38 obj-$(CONFIG_MACH_PRONGHORNMETRO) += pronghornmetro-setup.o
39 obj-$(CONFIG_MACH_COMPEX) += compex-setup.o
40 obj-$(CONFIG_MACH_WRT300NV2) += wrt300nv2-setup.o
41 +obj-$(CONFIG_MACH_SIDEWINDER) += sidewinder-setup.o
43 obj-$(CONFIG_PCI) += $(obj-pci-$(CONFIG_PCI)) common-pci.o
44 obj-$(CONFIG_IXP4XX_QMGR) += ixp4xx_qmgr.o
46 +++ b/arch/arm/mach-ixp4xx/sidewinder-pci.c
49 + * arch/arch/mach-ixp4xx/pronghornmetro-pci.c
51 + * PCI setup routines for ADI Engineering Sidewinder
53 + * Copyright (C) 2007 Imre Kaloz <kaloz@openwrt.org>
55 + * based on coyote-pci.c:
56 + * Copyright (C) 2002 Jungo Software Technologies.
57 + * Copyright (C) 2003 MontaVista Softwrae, Inc.
59 + * Maintainer: Imre Kaloz <kaloz@openwrt.org>
61 + * This program is free software; you can redistribute it and/or modify
62 + * it under the terms of the GNU General Public License version 2 as
63 + * published by the Free Software Foundation.
67 +#include <linux/kernel.h>
68 +#include <linux/pci.h>
69 +#include <linux/init.h>
70 +#include <linux/irq.h>
72 +#include <asm/mach-types.h>
73 +#include <asm/hardware.h>
76 +#include <asm/mach/pci.h>
78 +extern void ixp4xx_pci_preinit(void);
79 +extern int ixp4xx_setup(int nr, struct pci_sys_data *sys);
80 +extern struct pci_bus *ixp4xx_scan_bus(int nr, struct pci_sys_data *sys);
82 +void __init sidewinder_pci_preinit(void)
84 + set_irq_type(IRQ_IXP4XX_GPIO11, IRQT_LOW);
85 + set_irq_type(IRQ_IXP4XX_GPIO10, IRQT_LOW);
86 + set_irq_type(IRQ_IXP4XX_GPIO9, IRQT_LOW);
88 + ixp4xx_pci_preinit();
91 +static int __init sidewinder_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
94 + return IRQ_IXP4XX_GPIO11;
96 + return IRQ_IXP4XX_GPIO10;
98 + return IRQ_IXP4XX_GPIO9;
102 +struct hw_pci sidewinder_pci __initdata = {
103 + .nr_controllers = 1,
104 + .preinit = sidewinder_pci_preinit,
105 + .swizzle = pci_std_swizzle,
106 + .setup = ixp4xx_setup,
107 + .scan = ixp4xx_scan_bus,
108 + .map_irq = sidewinder_map_irq,
111 +int __init sidewinder_pci_init(void)
113 + if (machine_is_sidewinder())
114 + pci_common_init(&sidewinder_pci);
118 +subsys_initcall(sidewinder_pci_init);
120 +++ b/arch/arm/mach-ixp4xx/sidewinder-setup.c
123 + * arch/arm/mach-ixp4xx/sidewinder-setup.c
125 + * Board setup for the ADI Engineering Sidewinder
127 + * Copyright (C) 2007 Imre Kaloz <Kaloz@openwrt.org>
129 + * based on coyote-setup.c:
130 + * Copyright (C) 2003-2005 MontaVista Software, Inc.
132 + * Author: Imre Kaloz <Kaloz@openwrt.org>
135 +#include <linux/kernel.h>
136 +#include <linux/serial.h>
137 +#include <linux/serial_8250.h>
139 +#include <asm/mach-types.h>
140 +#include <asm/mach/arch.h>
141 +#include <asm/mach/flash.h>
143 +static struct flash_platform_data sidewinder_flash_data = {
144 + .map_name = "cfi_probe",
148 +static struct resource sidewinder_flash_resource = {
149 + .flags = IORESOURCE_MEM,
152 +static struct platform_device sidewinder_flash = {
153 + .name = "IXP4XX-Flash",
156 + .platform_data = &sidewinder_flash_data,
158 + .num_resources = 1,
159 + .resource = &sidewinder_flash_resource,
162 +static struct resource sidewinder_uart_resources[] = {
164 + .start = IXP4XX_UART1_BASE_PHYS,
165 + .end = IXP4XX_UART1_BASE_PHYS + 0x0fff,
166 + .flags = IORESOURCE_MEM,
169 + .start = IXP4XX_UART2_BASE_PHYS,
170 + .end = IXP4XX_UART2_BASE_PHYS + 0x0fff,
171 + .flags = IORESOURCE_MEM,
175 +static struct plat_serial8250_port sidewinder_uart_data[] = {
177 + .mapbase = IXP4XX_UART1_BASE_PHYS,
178 + .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET,
179 + .irq = IRQ_IXP4XX_UART1,
180 + .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
181 + .iotype = UPIO_MEM,
183 + .uartclk = IXP4XX_UART_XTAL,
186 + .mapbase = IXP4XX_UART2_BASE_PHYS,
187 + .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET,
188 + .irq = IRQ_IXP4XX_UART2,
189 + .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
190 + .iotype = UPIO_MEM,
192 + .uartclk = IXP4XX_UART_XTAL,
197 +static struct platform_device sidewinder_uart = {
198 + .name = "serial8250",
199 + .id = PLAT8250_DEV_PLATFORM,
201 + .platform_data = sidewinder_uart_data,
203 + .num_resources = ARRAY_SIZE(sidewinder_uart_resources),
204 + .resource = sidewinder_uart_resources,
207 +static struct platform_device *sidewinder_devices[] __initdata = {
212 +static void __init sidewinder_init(void)
216 + sidewinder_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
217 + sidewinder_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_64M - 1;
219 + *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE;
220 + *IXP4XX_EXP_CS1 = *IXP4XX_EXP_CS0;
222 + platform_add_devices(sidewinder_devices, ARRAY_SIZE(sidewinder_devices));
225 +#ifdef CONFIG_MACH_SIDEWINDER
226 +MACHINE_START(SIDEWINDER, "ADI Engineering Sidewinder")
227 + /* Maintainer: Imre Kaloz <kaloz@openwrt.org> */
228 + .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
229 + .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
230 + .map_io = ixp4xx_map_io,
231 + .init_irq = ixp4xx_init_irq,
232 + .timer = &ixp4xx_timer,
233 + .boot_params = 0x0100,
234 + .init_machine = sidewinder_init,