1 Index: linux-2.6.23.17/arch/arm/mach-ixp4xx/Kconfig
2 ===================================================================
3 --- linux-2.6.23.17.orig/arch/arm/mach-ixp4xx/Kconfig
4 +++ linux-2.6.23.17/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.23.17/arch/arm/mach-ixp4xx/Makefile
30 ===================================================================
31 --- linux-2.6.23.17.orig/arch/arm/mach-ixp4xx/Makefile
32 +++ linux-2.6.23.17/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,5 +37,6 @@ obj-$(CONFIG_MACH_FSG) += fsg-setup.o f
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 Index: linux-2.6.23.17/arch/arm/mach-ixp4xx/sidewinder-pci.c
49 ===================================================================
51 +++ linux-2.6.23.17/arch/arm/mach-ixp4xx/sidewinder-pci.c
54 + * arch/arch/mach-ixp4xx/pronghornmetro-pci.c
56 + * PCI setup routines for ADI Engineering Sidewinder
58 + * Copyright (C) 2007 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: Imre Kaloz <kaloz@openwrt.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 <asm/hardware.h>
81 +#include <asm/mach/pci.h>
83 +extern void ixp4xx_pci_preinit(void);
84 +extern int ixp4xx_setup(int nr, struct pci_sys_data *sys);
85 +extern struct pci_bus *ixp4xx_scan_bus(int nr, struct pci_sys_data *sys);
87 +void __init sidewinder_pci_preinit(void)
89 + set_irq_type(IRQ_IXP4XX_GPIO11, IRQT_LOW);
90 + set_irq_type(IRQ_IXP4XX_GPIO10, IRQT_LOW);
91 + set_irq_type(IRQ_IXP4XX_GPIO9, IRQT_LOW);
93 + ixp4xx_pci_preinit();
96 +static int __init sidewinder_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
99 + return IRQ_IXP4XX_GPIO11;
100 + else if (slot == 2)
101 + return IRQ_IXP4XX_GPIO10;
102 + else if (slot == 3)
103 + return IRQ_IXP4XX_GPIO9;
107 +struct hw_pci sidewinder_pci __initdata = {
108 + .nr_controllers = 1,
109 + .preinit = sidewinder_pci_preinit,
110 + .swizzle = pci_std_swizzle,
111 + .setup = ixp4xx_setup,
112 + .scan = ixp4xx_scan_bus,
113 + .map_irq = sidewinder_map_irq,
116 +int __init sidewinder_pci_init(void)
118 + if (machine_is_sidewinder())
119 + pci_common_init(&sidewinder_pci);
123 +subsys_initcall(sidewinder_pci_init);
124 Index: linux-2.6.23.17/arch/arm/mach-ixp4xx/sidewinder-setup.c
125 ===================================================================
127 +++ linux-2.6.23.17/arch/arm/mach-ixp4xx/sidewinder-setup.c
130 + * arch/arm/mach-ixp4xx/sidewinder-setup.c
132 + * Board setup for the ADI Engineering Sidewinder
134 + * Copyright (C) 2007 Imre Kaloz <Kaloz@openwrt.org>
136 + * based on coyote-setup.c:
137 + * Copyright (C) 2003-2005 MontaVista Software, Inc.
139 + * Author: Imre Kaloz <Kaloz@openwrt.org>
142 +#include <linux/kernel.h>
143 +#include <linux/serial.h>
144 +#include <linux/serial_8250.h>
146 +#include <asm/mach-types.h>
147 +#include <asm/mach/arch.h>
148 +#include <asm/mach/flash.h>
150 +static struct flash_platform_data sidewinder_flash_data = {
151 + .map_name = "cfi_probe",
155 +static struct resource sidewinder_flash_resource = {
156 + .flags = IORESOURCE_MEM,
159 +static struct platform_device sidewinder_flash = {
160 + .name = "IXP4XX-Flash",
163 + .platform_data = &sidewinder_flash_data,
165 + .num_resources = 1,
166 + .resource = &sidewinder_flash_resource,
169 +static struct resource sidewinder_uart_resources[] = {
171 + .start = IXP4XX_UART1_BASE_PHYS,
172 + .end = IXP4XX_UART1_BASE_PHYS + 0x0fff,
173 + .flags = IORESOURCE_MEM,
176 + .start = IXP4XX_UART2_BASE_PHYS,
177 + .end = IXP4XX_UART2_BASE_PHYS + 0x0fff,
178 + .flags = IORESOURCE_MEM,
182 +static struct plat_serial8250_port sidewinder_uart_data[] = {
184 + .mapbase = IXP4XX_UART1_BASE_PHYS,
185 + .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET,
186 + .irq = IRQ_IXP4XX_UART1,
187 + .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
188 + .iotype = UPIO_MEM,
190 + .uartclk = IXP4XX_UART_XTAL,
193 + .mapbase = IXP4XX_UART2_BASE_PHYS,
194 + .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET,
195 + .irq = IRQ_IXP4XX_UART2,
196 + .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
197 + .iotype = UPIO_MEM,
199 + .uartclk = IXP4XX_UART_XTAL,
204 +static struct platform_device sidewinder_uart = {
205 + .name = "serial8250",
206 + .id = PLAT8250_DEV_PLATFORM,
208 + .platform_data = sidewinder_uart_data,
210 + .num_resources = ARRAY_SIZE(sidewinder_uart_resources),
211 + .resource = sidewinder_uart_resources,
214 +static struct platform_device *sidewinder_devices[] __initdata = {
219 +static void __init sidewinder_init(void)
223 + sidewinder_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
224 + sidewinder_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_64M - 1;
226 + *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE;
227 + *IXP4XX_EXP_CS1 = *IXP4XX_EXP_CS0;
229 + platform_add_devices(sidewinder_devices, ARRAY_SIZE(sidewinder_devices));
232 +#ifdef CONFIG_MACH_SIDEWINDER
233 +MACHINE_START(SIDEWINDER, "ADI Engineering Sidewinder")
234 + /* Maintainer: Imre Kaloz <kaloz@openwrt.org> */
235 + .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
236 + .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
237 + .map_io = ixp4xx_map_io,
238 + .init_irq = ixp4xx_init_irq,
239 + .timer = &ixp4xx_timer,
240 + .boot_params = 0x0100,
241 + .init_machine = sidewinder_init,