add preliminary support for the XScale port, generic endianness indication
[openwrt.git] / openwrt / target / linux / xscale-2.6 / patches / 001-gateway_7001.patch
1 diff -Nur linux-2.6.16.4/arch/arm/mach-ixp4xx/Kconfig linux-2.6.16.4-owrt/arch/arm/mach-ixp4xx/Kconfig
2 --- linux-2.6.16.4/arch/arm/mach-ixp4xx/Kconfig 2006-04-11 19:19:28.000000000 +0200
3 +++ linux-2.6.16.4-owrt/arch/arm/mach-ixp4xx/Kconfig 2006-04-12 16:47:34.000000000 +0200
4 @@ -30,6 +30,13 @@
5 Engineering Coyote Gateway Reference Platform. For more
6 information on this platform, see <file:Documentation/arm/IXP4xx>.
7
8 +config MACH_GATEWAY7001
9 + bool "Gateway 7001"
10 + help
11 + Say 'Y' here if you want your kernel to support Gateway's
12 + 7001 Access Point. For more information on this platform,
13 + see http://openwrt.org
14 +
15 config ARCH_IXDP425
16 bool "IXDP425"
17 help
18 diff -Nur linux-2.6.16.4/arch/arm/mach-ixp4xx/Makefile linux-2.6.16.4-owrt/arch/arm/mach-ixp4xx/Makefile
19 --- linux-2.6.16.4/arch/arm/mach-ixp4xx/Makefile 2006-04-11 19:19:28.000000000 +0200
20 +++ linux-2.6.16.4-owrt/arch/arm/mach-ixp4xx/Makefile 2006-04-12 22:34:09.000000000 +0200
21 @@ -10,4 +10,5 @@
22 obj-$(CONFIG_MACH_GTWX5715) += gtwx5715-pci.o gtwx5715-setup.o
23 obj-$(CONFIG_MACH_NSLU2) += nslu2-pci.o nslu2-setup.o nslu2-power.o
24 obj-$(CONFIG_MACH_NAS100D) += nas100d-pci.o nas100d-setup.o nas100d-power.o
25 +obj-$(CONFIG_MACH_GATEWAY7001) += gateway7001-pci.o gateway7001-setup.o
26
27 diff -Nur linux-2.6.16.4/arch/arm/mach-ixp4xx/gateway7001-pci.c linux-2.6.16.4-owrt/arch/arm/mach-ixp4xx/gateway7001-pci.c
28 --- linux-2.6.16.4/arch/arm/mach-ixp4xx/gateway7001-pci.c 1970-01-01 01:00:00.000000000 +0100
29 +++ linux-2.6.16.4-owrt/arch/arm/mach-ixp4xx/gateway7001-pci.c 2006-04-12 22:35:29.000000000 +0200
30 @@ -0,0 +1,77 @@
31 +/*
32 + * arch/arm/mach-ixp4xx/gateway7001-pci.c
33 + *
34 + * Gateway 7001 board-level PCI initialization
35 + *
36 + * Copyright (c) 2006 Imre Kaloz <kaloz@openwrt.org>
37 + *
38 + * based on ixdp425-pci.c:
39 + * Copyright (C) 2002 Intel Corporation.
40 + * Copyright (C) 2003-2004 MontaVista Software, Inc.
41 + *
42 + * Maintainer: Imre Kaloz <kaloz@openwrt.org>
43 + *
44 + * This program is free software; you can redistribute it and/or modify
45 + * it under the terms of the GNU General Public License version 2 as
46 + * published by the Free Software Foundation.
47 + *
48 + */
49 +
50 +#include <linux/kernel.h>
51 +#include <linux/config.h>
52 +#include <linux/pci.h>
53 +#include <linux/init.h>
54 +#include <linux/delay.h>
55 +
56 +#include <asm/mach/pci.h>
57 +#include <asm/irq.h>
58 +#include <asm/hardware.h>
59 +#include <asm/mach-types.h>
60 +
61 +void __init gateway7001_pci_preinit(void)
62 +{
63 + set_irq_type(IRQ_GATEWAY7001_PCI_INTA, IRQT_LOW);
64 + set_irq_type(IRQ_GATEWAY7001_PCI_INTB, IRQT_LOW);
65 + set_irq_type(IRQ_GATEWAY7001_PCI_INTC, IRQT_LOW);
66 + set_irq_type(IRQ_GATEWAY7001_PCI_INTD, IRQT_LOW);
67 +
68 + ixp4xx_pci_preinit();
69 +}
70 +
71 +static int __init gateway7001_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
72 +{
73 + static int pci_irq_table[GATEWAY7001_PCI_IRQ_LINES] = {
74 + IRQ_GATEWAY7001_PCI_INTA,
75 + IRQ_GATEWAY7001_PCI_INTB,
76 + IRQ_GATEWAY7001_PCI_INTC,
77 + IRQ_GATEWAY7001_PCI_INTD
78 + };
79 +
80 + int irq = -1;
81 +
82 + if (slot >= 1 && slot <= GATEWAY7001_PCI_MAX_DEV &&
83 + pin >= 1 && pin <= GATEWAY7001_PCI_IRQ_LINES) {
84 + irq = pci_irq_table[(slot + pin - 2) % 4];
85 + }
86 +
87 + return irq;
88 +}
89 +
90 +struct hw_pci gateway7001_pci __initdata = {
91 + .nr_controllers = 1,
92 + .preinit = gateway7001_pci_preinit,
93 + .swizzle = pci_std_swizzle,
94 + .setup = ixp4xx_setup,
95 + .scan = ixp4xx_scan_bus,
96 + .map_irq = gateway7001_map_irq,
97 +};
98 +
99 +int __init gateway7001_pci_init(void)
100 +{
101 + if (machine_is_gateway7001())
102 + pci_common_init(&gateway7001_pci);
103 + return 0;
104 +}
105 +
106 +subsys_initcall(gateway7001_pci_init);
107 +
108 diff -Nur linux-2.6.16.4/arch/arm/mach-ixp4xx/gateway7001-setup.c linux-2.6.16.4-owrt/arch/arm/mach-ixp4xx/gateway7001-setup.c
109 --- linux-2.6.16.4/arch/arm/mach-ixp4xx/gateway7001-setup.c 1970-01-01 01:00:00.000000000 +0100
110 +++ linux-2.6.16.4-owrt/arch/arm/mach-ixp4xx/gateway7001-setup.c 2006-04-12 22:45:53.000000000 +0200
111 @@ -0,0 +1,136 @@
112 +/*
113 + * arch/arm/mach-ixp4xx/gateway7001-setup.c
114 + *
115 + * Gateway 7001 board-setup
116 + *
117 + * Copyright (C) 2006 Imre Kaloz <kaloz@openwrt.org>
118 + *
119 + * based-on ixdp425-setup.c:
120 + * Copyright (C) 2003-2005 MontaVista Software, Inc.
121 + *
122 + * Author: Imre Kaloz <kaloz@openwrt.org>
123 + */
124 +
125 +#include <linux/kernel.h>
126 +#include <linux/init.h>
127 +#include <linux/device.h>
128 +#include <linux/serial.h>
129 +#include <linux/tty.h>
130 +#include <linux/serial_8250.h>
131 +#include <linux/slab.h>
132 +
133 +#include <asm/types.h>
134 +#include <asm/setup.h>
135 +#include <asm/memory.h>
136 +#include <asm/hardware.h>
137 +#include <asm/mach-types.h>
138 +#include <asm/irq.h>
139 +#include <asm/mach/arch.h>
140 +#include <asm/mach/flash.h>
141 +
142 +static struct flash_platform_data gateway7001_flash_data = {
143 + .map_name = "cfi_probe",
144 + .width = 2,
145 +};
146 +
147 +static struct resource gateway7001_flash_resource = {
148 + .flags = IORESOURCE_MEM,
149 +};
150 +
151 +static struct platform_device gateway7001_flash = {
152 + .name = "IXP4XX-Flash",
153 + .id = 0,
154 + .dev = {
155 + .platform_data = &gateway7001_flash_data,
156 + },
157 + .num_resources = 1,
158 + .resource = &gateway7001_flash_resource,
159 +};
160 +
161 +static struct ixp4xx_i2c_pins gateway7001_i2c_gpio_pins = {
162 + .sda_pin = GATEWAY7001_SDA_PIN,
163 + .scl_pin = GATEWAY7001_SCL_PIN,
164 +};
165 +
166 +static struct platform_device gateway7001_i2c_controller = {
167 + .name = "IXP4XX-I2C",
168 + .id = 0,
169 + .dev = {
170 + .platform_data = &gateway7001_i2c_gpio_pins,
171 + },
172 + .num_resources = 0
173 +};
174 +
175 +static struct resource gateway7001_uart_resources[] = {
176 + {
177 + .start = IXP4XX_UART1_BASE_PHYS,
178 + .end = IXP4XX_UART1_BASE_PHYS + 0x0fff,
179 + .flags = IORESOURCE_MEM
180 + },
181 + {
182 + .start = IXP4XX_UART2_BASE_PHYS,
183 + .end = IXP4XX_UART2_BASE_PHYS + 0x0fff,
184 + .flags = IORESOURCE_MEM
185 + }
186 +};
187 +
188 +static struct plat_serial8250_port gateway7001_uart_data[] = {
189 + {
190 + .mapbase = IXP4XX_UART1_BASE_PHYS,
191 + .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET,
192 + .irq = IRQ_IXP4XX_UART1,
193 + .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
194 + .iotype = UPIO_MEM,
195 + .regshift = 2,
196 + .uartclk = IXP4XX_UART_XTAL,
197 + },
198 + {
199 + .mapbase = IXP4XX_UART2_BASE_PHYS,
200 + .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET,
201 + .irq = IRQ_IXP4XX_UART2,
202 + .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
203 + .iotype = UPIO_MEM,
204 + .regshift = 2,
205 + .uartclk = IXP4XX_UART_XTAL,
206 + },
207 + { },
208 +};
209 +
210 +static struct platform_device gateway7001_uart = {
211 + .name = "serial8250",
212 + .id = PLAT8250_DEV_PLATFORM,
213 + .dev.platform_data = gateway7001_uart_data,
214 + .num_resources = 2,
215 + .resource = gateway7001_uart_resources
216 +};
217 +
218 +static struct platform_device *gateway7001_devices[] __initdata = {
219 + &gateway7001_i2c_controller,
220 + &gateway7001_flash,
221 + &gateway7001_uart
222 +};
223 +
224 +static void __init gateway7001_init(void)
225 +{
226 + ixp4xx_sys_init();
227 +
228 + gateway7001_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
229 + gateway7001_flash_resource.end =
230 + IXP4XX_EXP_BUS_BASE(0) + ixp4xx_exp_bus_size - 1;
231 +
232 + platform_add_devices(gateway7001_devices, ARRAY_SIZE(gateway7001_devices));
233 +}
234 +
235 +#ifdef CONFIG_MACH_GATEWAY7001
236 +MACHINE_START(GATEWAY7001, "Gateway 7001")
237 + /* Maintainer: Imre Kaloz <kaloz@openwrt.org> */
238 + .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
239 + .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
240 + .map_io = ixp4xx_map_io,
241 + .init_irq = ixp4xx_init_irq,
242 + .timer = &ixp4xx_timer,
243 + .boot_params = 0x0100,
244 + .init_machine = gateway7001_init,
245 +MACHINE_END
246 +#endif
247 +
248 diff -Nur linux-2.6.16.4/include/asm-arm/arch-ixp4xx/gateway7001.h linux-2.6.16.4-owrt/include/asm-arm/arch-ixp4xx/gateway7001.h
249 --- linux-2.6.16.4/include/asm-arm/arch-ixp4xx/gateway7001.h 1970-01-01 01:00:00.000000000 +0100
250 +++ linux-2.6.16.4-owrt/include/asm-arm/arch-ixp4xx/gateway7001.h 2006-04-12 22:34:43.000000000 +0200
251 @@ -0,0 +1,36 @@
252 +/*
253 + * include/asm-arm/arch-ixp4xx/gateway7001.h
254 + *
255 + * Gateway 7001 platform specific definitions
256 + *
257 + * Author: Imre Kaloz <kaloz@openwrt.org>
258 + *
259 + * Copyright 2006 (c) Imre Kaloz <kaloz@openwrt.org>
260 + *
261 + * based on ixdp425.h:
262 + * Copyright 2004 (c) MontaVista, Software, Inc.
263 + *
264 + * This file is licensed under the terms of the GNU General Public
265 + * License version 2. This program is licensed "as is" without any
266 + * warranty of any kind, whether express or implied.
267 + */
268 +
269 +#ifndef __ASM_ARCH_HARDWARE_H__
270 +#error "Do not include this directly, instead #include <asm/hardware.h>"
271 +#endif
272 +
273 +#define GATEWAY7001_SDA_PIN 7
274 +#define GATEWAY7001_SCL_PIN 6
275 +
276 +/*
277 + * GATEWAY7001 PCI IRQs
278 + */
279 +#define GATEWAY7001_PCI_MAX_DEV 4
280 +#define GATEWAY7001_PCI_IRQ_LINES 4
281 +
282 +
283 +/* PCI controller GPIO to IRQ pin mappings */
284 +#define GATEWAY7001_PCI_INTA_PIN 11
285 +#define GATEWAY7001_PCI_INTB_PIN 10
286 +#define GATEWAY7001_PCI_INTC_PIN 9
287 +#define GATEWAY7001_PCI_INTD_PIN 8
288 diff -Nur linux-2.6.16.4/include/asm-arm/arch-ixp4xx/hardware.h linux-2.6.16.4-owrt/include/asm-arm/arch-ixp4xx/hardware.h
289 --- linux-2.6.16.4/include/asm-arm/arch-ixp4xx/hardware.h 2006-04-11 19:19:28.000000000 +0200
290 +++ linux-2.6.16.4-owrt/include/asm-arm/arch-ixp4xx/hardware.h 2006-04-12 22:34:52.000000000 +0200
291 @@ -46,5 +46,6 @@
292 #include "prpmc1100.h"
293 #include "nslu2.h"
294 #include "nas100d.h"
295 +#include "gateway7001.h"
296
297 #endif /* _ASM_ARCH_HARDWARE_H */
298 diff -Nur linux-2.6.16.4/include/asm-arm/arch-ixp4xx/irqs.h linux-2.6.16.4-owrt/include/asm-arm/arch-ixp4xx/irqs.h
299 --- linux-2.6.16.4/include/asm-arm/arch-ixp4xx/irqs.h 2006-04-11 19:19:28.000000000 +0200
300 +++ linux-2.6.16.4-owrt/include/asm-arm/arch-ixp4xx/irqs.h 2006-04-12 22:35:05.000000000 +0200
301 @@ -109,4 +109,12 @@
302 #define IRQ_NAS100D_PCI_INTD IRQ_IXP4XX_GPIO8
303 #define IRQ_NAS100D_PCI_INTE IRQ_IXP4XX_GPIO7
304
305 +/*
306 + * GATEWAY7001 board IRQs
307 + */
308 +#define IRQ_GATEWAY7001_PCI_INTA IRQ_IXP4XX_GPIO11
309 +#define IRQ_GATEWAY7001_PCI_INTB IRQ_IXP4XX_GPIO10
310 +#define IRQ_GATEWAY7001_PCI_INTC IRQ_IXP4XX_GPIO9
311 +#define IRQ_GATEWAY7001_PCI_INTD IRQ_IXP4XX_GPIO8
312 +
313 #endif
This page took 0.057746 seconds and 5 git commands to generate.