49aefdab15663e9d62445d90d36827564a69e7ed
[openwrt.git] / target / linux / ixp4xx-2.6 / patches / 200-gateway_7001.patch
1 diff -Nur linux-2.6.17/arch/arm/boot/compressed/head-xscale.S linux-2.6.17-owrt/arch/arm/boot/compressed/head-xscale.S
2 --- linux-2.6.17/arch/arm/boot/compressed/head-xscale.S 2006-09-11 12:29:51.000000000 +0200
3 +++ linux-2.6.17-owrt/arch/arm/boot/compressed/head-xscale.S 2006-09-11 12:30:03.000000000 +0200
4 @@ -47,6 +47,11 @@
5 orr r7, r7, #(MACH_TYPE_GTWX5715 & 0xff00)
6 #endif
7
8 +#ifdef CONFIG_MACH_GATEWAY7001
9 + mov r7, #(MACH_TYPE_GATEWAY7001 & 0xff)
10 + orr r7, r7, #(MACH_TYPE_GATEWAY7001 & 0xff00)
11 +#endif
12 +
13 #ifdef CONFIG_ARCH_IXP2000
14 mov r1, #-1
15 mov r0, #0xd6000000
16 diff -Nur linux-2.6.17/arch/arm/mach-ixp4xx/gateway7001-pci.c linux-2.6.17-owrt/arch/arm/mach-ixp4xx/gateway7001-pci.c
17 --- linux-2.6.17/arch/arm/mach-ixp4xx/gateway7001-pci.c 1970-01-01 01:00:00.000000000 +0100
18 +++ linux-2.6.17-owrt/arch/arm/mach-ixp4xx/gateway7001-pci.c 2006-09-11 12:30:03.000000000 +0200
19 @@ -0,0 +1,67 @@
20 +/*
21 + * arch/arch/mach-ixp4xx/gateway7001-pci.c
22 + *
23 + * PCI setup routines for Gateway 7001
24 + *
25 + * Copyright (C) 2006 Imre Kaloz <kaloz@openwrt.org>
26 + *
27 + * based on coyote-pci.c:
28 + * Copyright (C) 2002 Jungo Software Technologies.
29 + * Copyright (C) 2003 MontaVista Softwrae, Inc.
30 + *
31 + * Maintainer: Imre Kaloz <kaloz@openwrt.org>
32 + *
33 + * This program is free software; you can redistribute it and/or modify
34 + * it under the terms of the GNU General Public License version 2 as
35 + * published by the Free Software Foundation.
36 + *
37 + */
38 +
39 +#include <linux/kernel.h>
40 +#include <linux/pci.h>
41 +#include <linux/init.h>
42 +
43 +#include <asm/mach-types.h>
44 +#include <asm/hardware.h>
45 +#include <asm/irq.h>
46 +
47 +#include <asm/mach/pci.h>
48 +
49 +extern void ixp4xx_pci_preinit(void);
50 +extern int ixp4xx_setup(int nr, struct pci_sys_data *sys);
51 +extern struct pci_bus *ixp4xx_scan_bus(int nr, struct pci_sys_data *sys);
52 +
53 +void __init gateway7001_pci_preinit(void)
54 +{
55 + set_irq_type(IRQ_IXP4XX_GPIO10, IRQT_LOW);
56 + set_irq_type(IRQ_IXP4XX_GPIO11, IRQT_LOW);
57 +
58 + ixp4xx_pci_preinit();
59 +}
60 +
61 +static int __init gateway7001_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
62 +{
63 + if (slot == 0)
64 + return IRQ_IXP4XX_GPIO10;
65 + else if (slot == 1)
66 + return IRQ_IXP4XX_GPIO11;
67 + else return -1;
68 +}
69 +
70 +struct hw_pci gateway7001_pci __initdata = {
71 + .nr_controllers = 1,
72 + .preinit = gateway7001_pci_preinit,
73 + .swizzle = pci_std_swizzle,
74 + .setup = ixp4xx_setup,
75 + .scan = ixp4xx_scan_bus,
76 + .map_irq = gateway7001_map_irq,
77 +};
78 +
79 +int __init gateway7001_pci_init(void)
80 +{
81 + if (machine_is_gateway7001())
82 + pci_common_init(&gateway7001_pci);
83 + return 0;
84 +}
85 +
86 +subsys_initcall(gateway7001_pci_init);
87 diff -Nur linux-2.6.17/arch/arm/mach-ixp4xx/Kconfig linux-2.6.17-owrt/arch/arm/mach-ixp4xx/Kconfig
88 --- linux-2.6.17/arch/arm/mach-ixp4xx/Kconfig 2006-09-11 12:29:51.000000000 +0200
89 +++ linux-2.6.17-owrt/arch/arm/mach-ixp4xx/Kconfig 2006-09-11 12:30:03.000000000 +0200
90 @@ -33,6 +33,14 @@
91 Engineering Coyote Gateway Reference Platform. For more
92 information on this platform, see <file:Documentation/arm/IXP4xx>.
93
94 +config MACH_GATEWAY7001
95 + bool "Gateway 7001"
96 + select PCI
97 + help
98 + Say 'Y' here if you want your kernel to support Gateway's
99 + 7001 Access Point. For more information on this platform,
100 + see http://openwrt.org
101 +
102 config ARCH_IXDP425
103 bool "IXDP425"
104 select PCI
105 diff -Nur linux-2.6.17/arch/arm/mach-ixp4xx/Makefile linux-2.6.17-owrt/arch/arm/mach-ixp4xx/Makefile
106 --- linux-2.6.17/arch/arm/mach-ixp4xx/Makefile 2006-09-11 12:29:51.000000000 +0200
107 +++ linux-2.6.17-owrt/arch/arm/mach-ixp4xx/Makefile 2006-09-11 12:30:03.000000000 +0200
108 @@ -11,4 +11,5 @@
109 obj-$(CONFIG_MACH_GTWX5715) += gtwx5715-pci.o gtwx5715-setup.o
110 obj-$(CONFIG_MACH_NSLU2) += nslu2-pci.o nslu2-setup.o nslu2-power.o
111 obj-$(CONFIG_MACH_NAS100D) += nas100d-pci.o nas100d-setup.o nas100d-power.o
112 +obj-$(CONFIG_MACH_GATEWAY7001) += gateway7001-pci.o coyote-setup.o
113
114 diff -Nur linux-2.6.17/include/asm-arm/arch-ixp4xx/uncompress.h linux-2.6.17-owrt/include/asm-arm/arch-ixp4xx/uncompress.h
115 --- linux-2.6.17/include/asm-arm/arch-ixp4xx/uncompress.h 2006-09-11 12:29:51.000000000 +0200
116 +++ linux-2.6.17-owrt/include/asm-arm/arch-ixp4xx/uncompress.h 2006-09-11 12:31:21.000000000 +0200
117 @@ -38,9 +38,9 @@
118 static __inline__ void __arch_decomp_setup(unsigned long arch_id)
119 {
120 /*
121 - * Coyote and gtwx5715 only have UART2 connected
122 + * Some boards only have UART2 connected
123 */
124 - if (machine_is_adi_coyote() || machine_is_gtwx5715())
125 + if (machine_is_adi_coyote() || machine_is_gtwx5715() || machine_is_gateway7001())
126 uart_base = (volatile u32*) IXP4XX_UART2_BASE_PHYS;
127 else
128 uart_base = (volatile u32*) IXP4XX_UART1_BASE_PHYS;
129 diff -Nur linux-2.6.17/arch/arm/mach-ixp4xx/coyote-setup.c linux-2.6.17-owrt/arch/arm/mach-ixp4xx/coyote-setup.c
130 --- linux-2.6.17/arch/arm/mach-ixp4xx/coyote-setup.c 2006-09-11 12:29:51.000000000 +0200
131 +++ linux-2.6.17-owrt/arch/arm/mach-ixp4xx/coyote-setup.c 2006-09-11 12:37:51.000000000 +0200
132 @@ -1,9 +1,10 @@
133 /*
134 * arch/arm/mach-ixp4xx/coyote-setup.c
135 *
136 - * Board setup for ADI Engineering and IXDGP425 boards
137 + * Board setup for ADI Engineering, IXDGP425 and Gateway 7001 boards
138 *
139 * Copyright (C) 2003-2005 MontaVista Software, Inc.
140 + * Copyright (C) 2006 Imre Kaloz <Kaloz@openwrt.org>
141 *
142 * Author: Deepak Saxena <dsaxena@plexity.net>
143 */
144 @@ -73,9 +74,57 @@
145 .resource = &coyote_uart_resource,
146 };
147
148 +/* MACs */
149 +static struct resource res_mac0 = {
150 + .start = IXP4XX_EthB_BASE_PHYS,
151 + .end = IXP4XX_EthB_BASE_PHYS + 0x1ff,
152 + .flags = IORESOURCE_MEM,
153 +};
154 +
155 +static struct resource res_mac1 = {
156 + .start = IXP4XX_EthC_BASE_PHYS,
157 + .end = IXP4XX_EthC_BASE_PHYS + 0x1ff,
158 + .flags = IORESOURCE_MEM,
159 +};
160 +
161 +static struct mac_plat_info plat_mac0 = {
162 + .npe_id = 1,
163 + .phy_id = 0,
164 + .eth_id = 0,
165 + .rxq_id = 27,
166 + .txq_id = 24,
167 +};
168 +
169 +static struct mac_plat_info plat_mac1 = {
170 + .npe_id = 2,
171 + .phy_id = 1,
172 + .eth_id = 1,
173 + .rxq_id = 28,
174 + .txq_id = 25,
175 +};
176 +
177 +static struct platform_device mac0 = {
178 + .name = "ixp4xx_mac",
179 + .id = 0,
180 + .dev.platform_data = &plat_mac0,
181 + .num_resources = 1,
182 + .resource = &res_mac0,
183 +};
184 +
185 +static struct platform_device mac1 = {
186 + .name = "ixp4xx_mac",
187 + .id = 1,
188 + .dev.platform_data = &plat_mac1,
189 + .num_resources = 1,
190 + .resource = &res_mac1,
191 +};
192 +
193 +
194 static struct platform_device *coyote_devices[] __initdata = {
195 &coyote_flash,
196 - &coyote_uart
197 + &coyote_uart,
198 + &mac0,
199 + &mac1
200 };
201
202 static void __init coyote_init(void)
203 @@ -111,6 +160,19 @@
204 MACHINE_END
205 #endif
206
207 +#ifdef CONFIG_MACH_GATEWAY7001
208 +MACHINE_START(GATEWAY7001, "Gateway 7001")
209 + /* Maintainer: Imre Kaloz <kaloz@openwrt.org> */
210 + .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
211 + .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
212 + .map_io = ixp4xx_map_io,
213 + .init_irq = ixp4xx_init_irq,
214 + .timer = &ixp4xx_timer,
215 + .boot_params = 0x0100,
216 + .init_machine = coyote_init,
217 +MACHINE_END
218 +#endif
219 +
220 /*
221 * IXDPG425 is identical to Coyote except for which serial port
222 * is connected.
This page took 0.052128 seconds and 3 git commands to generate.