1 This patch adds support for the Gateworks Avila Network Platform in
2 a separate set of setup files to the IXDP425. This is necessary now
3 that a driver for the Avila CF card slot is available. It also adds
4 support for a minor variant on the Avila board known as the Loft,
5 which has a different number of maximum PCI devices.
7 Signed-off-by: Michael-Luke Jones <mlj28 <at> cam.ac.uk>
9 Index: linux-2.6.19/arch/arm/mach-ixp4xx/Kconfig
10 ===================================================================
11 --- linux-2.6.19.orig/arch/arm/mach-ixp4xx/Kconfig
12 +++ linux-2.6.19/arch/arm/mach-ixp4xx/Kconfig
13 @@ -17,7 +17,7 @@ config MACH_NSLU2
14 NSLU2 NAS device. For more information on this platform,
15 see http://www.nslu2-linux.org
22 @@ -25,6 +25,14 @@ config ARCH_AVILA
23 Avila Network Platform. For more information on this platform,
24 see <file:Documentation/arm/IXP4xx>.
28 + depends on MACH_AVILA
30 + Say 'Y' here if you want your kernel to support the Giant
31 + Shoulder Inc Loft board (a minor variation on the standard
32 + Gateworks Avila Network Platform).
34 config ARCH_ADI_COYOTE
37 @@ -86,7 +94,7 @@ config MACH_NAS100D
41 - depends on ARCH_IXDP425 || ARCH_AVILA || MACH_IXDP465
42 + depends on ARCH_IXDP425 || MACH_IXDP465
46 Index: linux-2.6.19/arch/arm/mach-ixp4xx/Makefile
47 ===================================================================
48 --- linux-2.6.19.orig/arch/arm/mach-ixp4xx/Makefile
49 +++ linux-2.6.19/arch/arm/mach-ixp4xx/Makefile
50 @@ -6,6 +6,7 @@ obj-pci-y :=
53 obj-pci-$(CONFIG_ARCH_IXDP4XX) += ixdp425-pci.o
54 +obj-pci-$(CONFIG_MACH_AVILA) += avila-pci.o
55 obj-pci-$(CONFIG_MACH_IXDPG425) += ixdpg425-pci.o
56 obj-pci-$(CONFIG_ARCH_ADI_COYOTE) += coyote-pci.o
57 obj-pci-$(CONFIG_MACH_GTWX5715) += gtwx5715-pci.o
58 @@ -15,6 +16,7 @@ obj-pci-$(CONFIG_MACH_NAS100D) += nas10
61 obj-$(CONFIG_ARCH_IXDP4XX) += ixdp425-setup.o
62 +obj-$(CONFIG_MACH_AVILA) += avila-setup.o
63 obj-$(CONFIG_MACH_IXDPG425) += coyote-setup.o
64 obj-$(CONFIG_ARCH_ADI_COYOTE) += coyote-setup.o
65 obj-$(CONFIG_MACH_GTWX5715) += gtwx5715-setup.o
66 Index: linux-2.6.19/arch/arm/mach-ixp4xx/avila-pci.c
67 ===================================================================
69 +++ linux-2.6.19/arch/arm/mach-ixp4xx/avila-pci.c
72 + * arch/arm/mach-ixp4xx/avila-pci.c
74 + * Gateworks Avila board-level PCI initialization
76 + * Author: Michael-Luke Jones <mlj28@cam.ac.uk>
78 + * Based on ixdp-pci.c
79 + * Copyright (C) 2002 Intel Corporation.
80 + * Copyright (C) 2003-2004 MontaVista Software, Inc.
82 + * Maintainer: Deepak Saxena <dsaxena@plexity.net>
84 + * This program is free software; you can redistribute it and/or modify
85 + * it under the terms of the GNU General Public License version 2 as
86 + * published by the Free Software Foundation.
90 +#include <linux/kernel.h>
91 +#include <linux/pci.h>
92 +#include <linux/init.h>
93 +#include <linux/irq.h>
94 +#include <linux/delay.h>
96 +#include <asm/mach/pci.h>
98 +#include <asm/hardware.h>
99 +#include <asm/mach-types.h>
101 +void __init avila_pci_preinit(void)
103 + set_irq_type(IRQ_AVILA_PCI_INTA, IRQT_LOW);
104 + set_irq_type(IRQ_AVILA_PCI_INTB, IRQT_LOW);
105 + set_irq_type(IRQ_AVILA_PCI_INTC, IRQT_LOW);
106 + set_irq_type(IRQ_AVILA_PCI_INTD, IRQT_LOW);
108 + ixp4xx_pci_preinit();
111 +static int __init avila_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
113 + static int pci_irq_table[AVILA_PCI_IRQ_LINES] = {
114 + IRQ_AVILA_PCI_INTA,
115 + IRQ_AVILA_PCI_INTB,
116 + IRQ_AVILA_PCI_INTC,
123 + slot <= (machine_is_loft() ? LOFT_PCI_MAX_DEV : AVILA_PCI_MAX_DEV) &&
124 + pin >= 1 && pin <= AVILA_PCI_IRQ_LINES) {
125 + irq = pci_irq_table[(slot + pin - 2) % 4];
131 +struct hw_pci avila_pci __initdata = {
132 + .nr_controllers = 1,
133 + .preinit = avila_pci_preinit,
134 + .swizzle = pci_std_swizzle,
135 + .setup = ixp4xx_setup,
136 + .scan = ixp4xx_scan_bus,
137 + .map_irq = avila_map_irq,
140 +int __init avila_pci_init(void)
142 + if (machine_is_avila() || machine_is_loft())
143 + pci_common_init(&avila_pci);
147 +subsys_initcall(avila_pci_init);
149 Index: linux-2.6.19/arch/arm/mach-ixp4xx/avila-setup.c
150 ===================================================================
152 +++ linux-2.6.19/arch/arm/mach-ixp4xx/avila-setup.c
155 + * arch/arm/mach-ixp4xx/avila-setup.c
157 + * Gateworks Avila board-setup
159 + * Author: Michael-Luke Jones <mlj28@cam.ac.uk>
161 + * Based on ixdp-setup.c
162 + * Copyright (C) 2003-2005 MontaVista Software, Inc.
164 + * Author: Deepak Saxena <dsaxena@plexity.net>
167 +#include <linux/kernel.h>
168 +#include <linux/init.h>
169 +#include <linux/device.h>
170 +#include <linux/serial.h>
171 +#include <linux/tty.h>
172 +#include <linux/serial_8250.h>
173 +#include <linux/slab.h>
175 +#include <asm/types.h>
176 +#include <asm/setup.h>
177 +#include <asm/memory.h>
178 +#include <asm/hardware.h>
179 +#include <asm/mach-types.h>
180 +#include <asm/irq.h>
181 +#include <asm/mach/arch.h>
182 +#include <asm/mach/flash.h>
184 +static struct flash_platform_data avila_flash_data = {
185 + .map_name = "cfi_probe",
189 +static struct resource avila_flash_resource = {
190 + .flags = IORESOURCE_MEM,
193 +static struct platform_device avila_flash = {
194 + .name = "IXP4XX-Flash",
197 + .platform_data = &avila_flash_data,
199 + .num_resources = 1,
200 + .resource = &avila_flash_resource,
203 +static struct ixp4xx_i2c_pins avila_i2c_gpio_pins = {
204 + .sda_pin = AVILA_SDA_PIN,
205 + .scl_pin = AVILA_SCL_PIN,
208 +static struct platform_device avila_i2c_controller = {
209 + .name = "IXP4XX-I2C",
212 + .platform_data = &avila_i2c_gpio_pins,
217 +static struct resource avila_uart_resources[] = {
219 + .start = IXP4XX_UART1_BASE_PHYS,
220 + .end = IXP4XX_UART1_BASE_PHYS + 0x0fff,
221 + .flags = IORESOURCE_MEM
224 + .start = IXP4XX_UART2_BASE_PHYS,
225 + .end = IXP4XX_UART2_BASE_PHYS + 0x0fff,
226 + .flags = IORESOURCE_MEM
230 +static struct plat_serial8250_port avila_uart_data[] = {
232 + .mapbase = IXP4XX_UART1_BASE_PHYS,
233 + .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET,
234 + .irq = IRQ_IXP4XX_UART1,
235 + .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
236 + .iotype = UPIO_MEM,
238 + .uartclk = IXP4XX_UART_XTAL,
241 + .mapbase = IXP4XX_UART2_BASE_PHYS,
242 + .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET,
243 + .irq = IRQ_IXP4XX_UART2,
244 + .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
245 + .iotype = UPIO_MEM,
247 + .uartclk = IXP4XX_UART_XTAL,
252 +static struct platform_device avila_uart = {
253 + .name = "serial8250",
254 + .id = PLAT8250_DEV_PLATFORM,
255 + .dev.platform_data = avila_uart_data,
256 + .num_resources = 2,
257 + .resource = avila_uart_resources
260 +static struct platform_device *avila_devices[] __initdata = {
261 + &avila_i2c_controller,
266 +static void __init avila_init(void)
270 + avila_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
271 + avila_flash_resource.end =
272 + IXP4XX_EXP_BUS_BASE(0) + ixp4xx_exp_bus_size - 1;
274 + platform_add_devices(avila_devices, ARRAY_SIZE(avila_devices));
277 +MACHINE_START(AVILA, "Gateworks Avila Network Platform")
278 + /* Maintainer: Deepak Saxena <dsaxena@plexity.net> */
279 + .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
280 + .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
281 + .map_io = ixp4xx_map_io,
282 + .init_irq = ixp4xx_init_irq,
283 + .timer = &ixp4xx_timer,
284 + .boot_params = 0x0100,
285 + .init_machine = avila_init,
289 + * Loft is functionally equivalent to Avila except that it has a
290 + * different number for the maximum PCI devices. The MACHINE
291 + * structure below is identical to Avila except for the comment.
293 +#ifdef CONFIG_MACH_LOFT
294 +MACHINE_START(LOFT, "Giant Shoulder Inc Loft board")
295 + /* Maintainer: Tom Billman <kernel@giantshoulderinc.com> */
296 + .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
297 + .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
298 + .map_io = ixp4xx_map_io,
299 + .init_irq = ixp4xx_init_irq,
300 + .timer = &ixp4xx_timer,
301 + .boot_params = 0x0100,
302 + .init_machine = avila_init,
306 Index: linux-2.6.19/include/asm-arm/arch-ixp4xx/avila.h
307 ===================================================================
309 +++ linux-2.6.19/include/asm-arm/arch-ixp4xx/avila.h
312 + * include/asm-arm/arch-ixp4xx/avila.h
314 + * Gateworks Avila platform specific definitions
316 + * Author: Michael-Luke Jones <mlj28@cam.ac.uk>
318 + * Based on ixdp425.h
319 + * Author: Deepak Saxena <dsaxena@plexity.net>
321 + * Copyright 2004 (c) MontaVista, Software, Inc.
323 + * This file is licensed under the terms of the GNU General Public
324 + * License version 2. This program is licensed "as is" without any
325 + * warranty of any kind, whether express or implied.
328 +#ifndef __ASM_ARCH_HARDWARE_H__
329 +#error "Do not include this directly, instead #include <asm/hardware.h>"
332 +#define AVILA_SDA_PIN 7
333 +#define AVILA_SCL_PIN 6
338 +#define AVILA_PCI_MAX_DEV 4
339 +#define LOFT_PCI_MAX_DEV 6
340 +#define AVILA_PCI_IRQ_LINES 4
343 +/* PCI controller GPIO to IRQ pin mappings */
344 +#define AVILA_PCI_INTA_PIN 11
345 +#define AVILA_PCI_INTB_PIN 10
346 +#define AVILA_PCI_INTC_PIN 9
347 +#define AVILA_PCI_INTD_PIN 8
350 Index: linux-2.6.19/include/asm-arm/arch-ixp4xx/hardware.h
351 ===================================================================
352 --- linux-2.6.19.orig/include/asm-arm/arch-ixp4xx/hardware.h
353 +++ linux-2.6.19/include/asm-arm/arch-ixp4xx/hardware.h
354 @@ -42,6 +42,7 @@ extern unsigned int processor_id;
356 /* Platform specific details */
360 #include "prpmc1100.h"
362 Index: linux-2.6.19/include/asm-arm/arch-ixp4xx/irqs.h
363 ===================================================================
364 --- linux-2.6.19.orig/include/asm-arm/arch-ixp4xx/irqs.h
365 +++ linux-2.6.19/include/asm-arm/arch-ixp4xx/irqs.h
367 #define IRQ_IXDP425_PCI_INTD IRQ_IXP4XX_GPIO8
370 + * Gateworks Avila board IRQs
372 +#define IRQ_AVILA_PCI_INTA IRQ_IXP4XX_GPIO11
373 +#define IRQ_AVILA_PCI_INTB IRQ_IXP4XX_GPIO10
374 +#define IRQ_AVILA_PCI_INTC IRQ_IXP4XX_GPIO9
375 +#define IRQ_AVILA_PCI_INTD IRQ_IXP4XX_GPIO8
379 * PrPMC1100 Board IRQs
381 #define IRQ_PRPMC1100_PCI_INTA IRQ_IXP4XX_GPIO11