1 Index: linux-2.6.25.1/arch/arm/mach-ixp4xx/Kconfig
2 ===================================================================
3 --- linux-2.6.25.1.orig/arch/arm/mach-ixp4xx/Kconfig
4 +++ linux-2.6.25.1/arch/arm/mach-ixp4xx/Kconfig
5 @@ -65,6 +65,14 @@ config MACH_PRONGHORNMETRO
6 Engineering Pronghorn Metro Platform. For more
7 information on this platform, see <file:Documentation/arm/IXP4xx>.
9 +config MACH_SIDEWINDER
13 + Say 'Y' here if you want your kernel to support the ADI
14 + Engineering Sidewinder Platform. For more
15 + information on this platform, see <file:Documentation/arm/IXP4xx>.
18 bool "Compex WP18 / NP18A"
20 @@ -163,7 +171,7 @@ config MACH_FSG
24 - depends on MACH_IXDP465
25 + depends on MACH_IXDP465 || MACH_SIDEWINDER
29 Index: linux-2.6.25.1/arch/arm/mach-ixp4xx/Makefile
30 ===================================================================
31 --- linux-2.6.25.1.orig/arch/arm/mach-ixp4xx/Makefile
32 +++ linux-2.6.25.1/arch/arm/mach-ixp4xx/Makefile
33 @@ -19,6 +19,7 @@ obj-pci-$(CONFIG_MACH_FSG) += fsg-pci.o
34 obj-pci-$(CONFIG_MACH_PRONGHORNMETRO) += pronghornmetro-pci.o
35 obj-pci-$(CONFIG_MACH_COMPEX) += ixdp425-pci.o
36 obj-pci-$(CONFIG_MACH_WRT300NV2) += wrt300nv2-pci.o
37 +obj-pci-$(CONFIG_MACH_SIDEWINDER) += sidewinder-pci.o
41 @@ -36,6 +37,7 @@ obj-$(CONFIG_MACH_FSG) += fsg-setup.o
42 obj-$(CONFIG_MACH_PRONGHORNMETRO) += pronghornmetro-setup.o
43 obj-$(CONFIG_MACH_COMPEX) += compex-setup.o
44 obj-$(CONFIG_MACH_WRT300NV2) += wrt300nv2-setup.o
45 +obj-$(CONFIG_MACH_SIDEWINDER) += sidewinder-setup.o
47 obj-$(CONFIG_PCI) += $(obj-pci-$(CONFIG_PCI)) common-pci.o
48 obj-$(CONFIG_IXP4XX_QMGR) += ixp4xx_qmgr.o
49 Index: linux-2.6.25.1/arch/arm/mach-ixp4xx/sidewinder-pci.c
50 ===================================================================
52 +++ linux-2.6.25.1/arch/arm/mach-ixp4xx/sidewinder-pci.c
55 + * arch/arch/mach-ixp4xx/pronghornmetro-pci.c
57 + * PCI setup routines for ADI Engineering Sidewinder
59 + * Copyright (C) 2007 Imre Kaloz <kaloz@openwrt.org>
61 + * based on coyote-pci.c:
62 + * Copyright (C) 2002 Jungo Software Technologies.
63 + * Copyright (C) 2003 MontaVista Softwrae, Inc.
65 + * Maintainer: Imre Kaloz <kaloz@openwrt.org>
67 + * This program is free software; you can redistribute it and/or modify
68 + * it under the terms of the GNU General Public License version 2 as
69 + * published by the Free Software Foundation.
73 +#include <linux/kernel.h>
74 +#include <linux/pci.h>
75 +#include <linux/init.h>
76 +#include <linux/irq.h>
78 +#include <asm/mach-types.h>
79 +#include <asm/hardware.h>
82 +#include <asm/mach/pci.h>
84 +extern void ixp4xx_pci_preinit(void);
85 +extern int ixp4xx_setup(int nr, struct pci_sys_data *sys);
86 +extern struct pci_bus *ixp4xx_scan_bus(int nr, struct pci_sys_data *sys);
88 +void __init sidewinder_pci_preinit(void)
90 + set_irq_type(IRQ_IXP4XX_GPIO11, IRQT_LOW);
91 + set_irq_type(IRQ_IXP4XX_GPIO10, IRQT_LOW);
92 + set_irq_type(IRQ_IXP4XX_GPIO9, IRQT_LOW);
94 + ixp4xx_pci_preinit();
97 +static int __init sidewinder_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
100 + return IRQ_IXP4XX_GPIO11;
101 + else if (slot == 2)
102 + return IRQ_IXP4XX_GPIO10;
103 + else if (slot == 3)
104 + return IRQ_IXP4XX_GPIO9;
108 +struct hw_pci sidewinder_pci __initdata = {
109 + .nr_controllers = 1,
110 + .preinit = sidewinder_pci_preinit,
111 + .swizzle = pci_std_swizzle,
112 + .setup = ixp4xx_setup,
113 + .scan = ixp4xx_scan_bus,
114 + .map_irq = sidewinder_map_irq,
117 +int __init sidewinder_pci_init(void)
119 + if (machine_is_sidewinder())
120 + pci_common_init(&sidewinder_pci);
124 +subsys_initcall(sidewinder_pci_init);
125 Index: linux-2.6.25.1/arch/arm/mach-ixp4xx/sidewinder-setup.c
126 ===================================================================
128 +++ linux-2.6.25.1/arch/arm/mach-ixp4xx/sidewinder-setup.c
131 + * arch/arm/mach-ixp4xx/sidewinder-setup.c
133 + * Board setup for the ADI Engineering Sidewinder
135 + * Copyright (C) 2007 Imre Kaloz <Kaloz@openwrt.org>
137 + * based on coyote-setup.c:
138 + * Copyright (C) 2003-2005 MontaVista Software, Inc.
140 + * Author: Imre Kaloz <Kaloz@openwrt.org>
143 +#include <linux/kernel.h>
144 +#include <linux/serial.h>
145 +#include <linux/serial_8250.h>
147 +#include <asm/mach-types.h>
148 +#include <asm/mach/arch.h>
149 +#include <asm/mach/flash.h>
151 +static struct flash_platform_data sidewinder_flash_data = {
152 + .map_name = "cfi_probe",
156 +static struct resource sidewinder_flash_resource = {
157 + .flags = IORESOURCE_MEM,
160 +static struct platform_device sidewinder_flash = {
161 + .name = "IXP4XX-Flash",
164 + .platform_data = &sidewinder_flash_data,
166 + .num_resources = 1,
167 + .resource = &sidewinder_flash_resource,
170 +static struct resource sidewinder_uart_resources[] = {
172 + .start = IXP4XX_UART1_BASE_PHYS,
173 + .end = IXP4XX_UART1_BASE_PHYS + 0x0fff,
174 + .flags = IORESOURCE_MEM,
177 + .start = IXP4XX_UART2_BASE_PHYS,
178 + .end = IXP4XX_UART2_BASE_PHYS + 0x0fff,
179 + .flags = IORESOURCE_MEM,
183 +static struct plat_serial8250_port sidewinder_uart_data[] = {
185 + .mapbase = IXP4XX_UART1_BASE_PHYS,
186 + .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET,
187 + .irq = IRQ_IXP4XX_UART1,
188 + .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
189 + .iotype = UPIO_MEM,
191 + .uartclk = IXP4XX_UART_XTAL,
194 + .mapbase = IXP4XX_UART2_BASE_PHYS,
195 + .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET,
196 + .irq = IRQ_IXP4XX_UART2,
197 + .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
198 + .iotype = UPIO_MEM,
200 + .uartclk = IXP4XX_UART_XTAL,
205 +static struct platform_device sidewinder_uart = {
206 + .name = "serial8250",
207 + .id = PLAT8250_DEV_PLATFORM,
209 + .platform_data = sidewinder_uart_data,
211 + .num_resources = ARRAY_SIZE(sidewinder_uart_resources),
212 + .resource = sidewinder_uart_resources,
215 +static struct platform_device *sidewinder_devices[] __initdata = {
220 +static void __init sidewinder_init(void)
224 + sidewinder_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
225 + sidewinder_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_64M - 1;
227 + *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE;
228 + *IXP4XX_EXP_CS1 = *IXP4XX_EXP_CS0;
230 + platform_add_devices(sidewinder_devices, ARRAY_SIZE(sidewinder_devices));
233 +#ifdef CONFIG_MACH_SIDEWINDER
234 +MACHINE_START(SIDEWINDER, "ADI Engineering Sidewinder")
235 + /* Maintainer: Imre Kaloz <kaloz@openwrt.org> */
236 + .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
237 + .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
238 + .map_io = ixp4xx_map_io,
239 + .init_irq = ixp4xx_init_irq,
240 + .timer = &ixp4xx_timer,
241 + .boot_params = 0x0100,
242 + .init_machine = sidewinder_init,