1 Index: linux-2.6.24.7/arch/arm/mach-ixp4xx/Kconfig
2 ===================================================================
3 --- linux-2.6.24.7.orig/arch/arm/mach-ixp4xx/Kconfig
4 +++ linux-2.6.24.7/arch/arm/mach-ixp4xx/Kconfig
5 @@ -150,6 +150,14 @@ config ARCH_PRPMC1100
6 PrPCM1100 Processor Mezanine Module. For more information on
7 this platform, see <file:Documentation/arm/IXP4xx>.
10 + bool "Titan Wireless TW-533-4"
13 + Say 'Y' here if you want your kernel to support the Titan
14 + Wireless TW533-4. For more information on this platform,
15 + see http://openwrt.org
20 Index: linux-2.6.24.7/arch/arm/mach-ixp4xx/Makefile
21 ===================================================================
22 --- linux-2.6.24.7.orig/arch/arm/mach-ixp4xx/Makefile
23 +++ linux-2.6.24.7/arch/arm/mach-ixp4xx/Makefile
24 @@ -22,6 +22,7 @@ obj-pci-$(CONFIG_MACH_COMPEX) += ixdp42
25 obj-pci-$(CONFIG_MACH_WRT300NV2) += wrt300nv2-pci.o
26 obj-pci-$(CONFIG_MACH_SIDEWINDER) += sidewinder-pci.o
27 obj-pci-$(CONFIG_MACH_AP1000) += ixdp425-pci.o
28 +obj-pci-$(CONFIG_MACH_TW5334) += tw5334-pci.o
32 @@ -42,5 +43,6 @@ obj-$(CONFIG_MACH_COMPEX) += compex-setu
33 obj-$(CONFIG_MACH_WRT300NV2) += wrt300nv2-setup.o
34 obj-$(CONFIG_MACH_SIDEWINDER) += sidewinder-setup.o
35 obj-$(CONFIG_MACH_AP1000) += ap1000-setup.o
36 +obj-$(CONFIG_MACH_TW5334) += tw5334-setup.o
38 obj-$(CONFIG_PCI) += $(obj-pci-$(CONFIG_PCI)) common-pci.o
39 Index: linux-2.6.24.7/arch/arm/mach-ixp4xx/tw5334-setup.c
40 ===================================================================
42 +++ linux-2.6.24.7/arch/arm/mach-ixp4xx/tw5334-setup.c
45 + * arch/arm/mach-ixp4xx/tw5334-setup.c
47 + * Board setup for the Titan Wireless TW-533-4
49 + * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
51 + * based on coyote-setup.c:
52 + * Copyright (C) 2003-2005 MontaVista Software, Inc.
54 + * Author: Imre Kaloz <Kaloz@openwrt.org>
57 +#include <linux/if_ether.h>
58 +#include <linux/kernel.h>
59 +#include <linux/init.h>
60 +#include <linux/device.h>
61 +#include <linux/serial.h>
62 +#include <linux/tty.h>
63 +#include <linux/serial_8250.h>
64 +#include <linux/slab.h>
66 +#include <asm/types.h>
67 +#include <asm/setup.h>
68 +#include <asm/memory.h>
69 +#include <asm/hardware.h>
71 +#include <asm/mach-types.h>
72 +#include <asm/mach/arch.h>
73 +#include <asm/mach/flash.h>
75 +static struct flash_platform_data tw5334_flash_data = {
76 + .map_name = "cfi_probe",
80 +static struct resource tw5334_flash_resource = {
81 + .flags = IORESOURCE_MEM,
84 +static struct platform_device tw5334_flash = {
85 + .name = "IXP4XX-Flash",
88 + .platform_data = &tw5334_flash_data,
91 + .resource = &tw5334_flash_resource,
94 +static struct resource tw5334_uart_resource = {
95 + .start = IXP4XX_UART2_BASE_PHYS,
96 + .end = IXP4XX_UART2_BASE_PHYS + 0x0fff,
97 + .flags = IORESOURCE_MEM,
100 +static struct plat_serial8250_port tw5334_uart_data[] = {
102 + .mapbase = IXP4XX_UART2_BASE_PHYS,
103 + .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET,
104 + .irq = IRQ_IXP4XX_UART2,
105 + .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
106 + .iotype = UPIO_MEM,
108 + .uartclk = IXP4XX_UART_XTAL,
113 +static struct platform_device tw5334_uart = {
114 + .name = "serial8250",
115 + .id = PLAT8250_DEV_PLATFORM,
117 + .platform_data = tw5334_uart_data,
119 + .num_resources = 1,
120 + .resource = &tw5334_uart_resource,
123 +/* Built-in 10/100 Ethernet MAC interfaces */
124 +static struct eth_plat_info tw5334_plat_eth[] = {
136 +static struct platform_device tw5334_eth[] = {
138 + .name = "ixp4xx_eth",
139 + .id = IXP4XX_ETH_NPEB,
140 + .dev.platform_data = tw5334_plat_eth,
142 + .name = "ixp4xx_eth",
143 + .id = IXP4XX_ETH_NPEC,
144 + .dev.platform_data = tw5334_plat_eth + 1,
148 +static struct platform_device *tw5334_devices[] __initdata = {
155 +static void __init tw5334_init(void)
157 + DECLARE_MAC_BUF(mac_buf);
158 + uint8_t __iomem *f;
163 + tw5334_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
164 + tw5334_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_32M - 1;
166 + *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE;
167 + *IXP4XX_EXP_CS1 = *IXP4XX_EXP_CS0;
169 + platform_add_devices(tw5334_devices, ARRAY_SIZE(tw5334_devices));
172 + * Map in a portion of the flash and read the MAC addresses.
173 + * Since it is stored in BE in the flash itself, we need to
174 + * byteswap it if we're in LE mode.
176 + f = ioremap(IXP4XX_EXP_BUS_BASE(0), 0x1000000);
178 + for (i = 0; i < 6; i++)
180 + tw5334_plat_eth[0].hwaddr[i] = readb(f + 0xFC0422 + i);
181 + tw5334_plat_eth[1].hwaddr[i] = readb(f + 0xFC043B + i);
183 + tw5334_plat_eth[0].hwaddr[i] = readb(f + 0xFC0422 + (i^3));
184 + tw5334_plat_eth[1].hwaddr[i] = readb(f + 0xFC043B + (i^3));
188 + printk(KERN_INFO "TW-533-4: Using MAC address %s for port 0\n",
189 + print_mac(mac_buf, tw5334_plat_eth[0].hwaddr));
190 + printk(KERN_INFO "TW-533-4: Using MAC address %s for port 1\n",
191 + print_mac(mac_buf, tw5334_plat_eth[1].hwaddr));
194 +#ifdef CONFIG_MACH_TW5334
195 +MACHINE_START(TW5334, "Titan Wireless TW-533-4")
196 + /* Maintainer: Imre Kaloz <kaloz@openwrt.org> */
197 + .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
198 + .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
199 + .map_io = ixp4xx_map_io,
200 + .init_irq = ixp4xx_init_irq,
201 + .timer = &ixp4xx_timer,
202 + .boot_params = 0x0100,
203 + .init_machine = tw5334_init,
206 Index: linux-2.6.24.7/arch/arm/mach-ixp4xx/tw5334-pci.c
207 ===================================================================
209 +++ linux-2.6.24.7/arch/arm/mach-ixp4xx/tw5334-pci.c
212 + * arch/arch/mach-ixp4xx/tw5334-pci.c
214 + * PCI setup routines for the Titan Wireless TW-533-4
216 + * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
218 + * based on coyote-pci.c:
219 + * Copyright (C) 2002 Jungo Software Technologies.
220 + * Copyright (C) 2003 MontaVista Softwrae, Inc.
222 + * Maintainer: Imre Kaloz <kaloz@openwrt.org>
224 + * This program is free software; you can redistribute it and/or modify
225 + * it under the terms of the GNU General Public License version 2 as
226 + * published by the Free Software Foundation.
230 +#include <linux/kernel.h>
231 +#include <linux/pci.h>
232 +#include <linux/init.h>
233 +#include <linux/irq.h>
235 +#include <asm/mach-types.h>
236 +#include <asm/hardware.h>
238 +#include <asm/mach/pci.h>
240 +void __init tw5334_pci_preinit(void)
242 + set_irq_type(IRQ_IXP4XX_GPIO6, IRQT_LOW);
243 + set_irq_type(IRQ_IXP4XX_GPIO2, IRQT_LOW);
244 + set_irq_type(IRQ_IXP4XX_GPIO1, IRQT_LOW);
245 + set_irq_type(IRQ_IXP4XX_GPIO0, IRQT_LOW);
247 + ixp4xx_pci_preinit();
250 +static int __init tw5334_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
253 + return IRQ_IXP4XX_GPIO6;
254 + else if (slot == 13)
255 + return IRQ_IXP4XX_GPIO2;
256 + else if (slot == 14)
257 + return IRQ_IXP4XX_GPIO1;
258 + else if (slot == 15)
259 + return IRQ_IXP4XX_GPIO0;
263 +struct hw_pci tw5334_pci __initdata = {
264 + .nr_controllers = 1,
265 + .preinit = tw5334_pci_preinit,
266 + .swizzle = pci_std_swizzle,
267 + .setup = ixp4xx_setup,
268 + .scan = ixp4xx_scan_bus,
269 + .map_irq = tw5334_map_irq,
272 +int __init tw5334_pci_init(void)
274 + if (machine_is_tw5334())
275 + pci_common_init(&tw5334_pci);
279 +subsys_initcall(tw5334_pci_init);
280 Index: linux-2.6.24.7/include/asm-arm/arch-ixp4xx/uncompress.h
281 ===================================================================
282 --- linux-2.6.24.7.orig/include/asm-arm/arch-ixp4xx/uncompress.h
283 +++ linux-2.6.24.7/include/asm-arm/arch-ixp4xx/uncompress.h
284 @@ -42,7 +42,8 @@ static __inline__ void __arch_decomp_set
286 if (machine_is_adi_coyote() || machine_is_gtwx5715() ||
287 machine_is_gateway7001() || machine_is_wg302v2() ||
288 - machine_is_pronghorn_metro() || machine_is_wrt300nv2())
289 + machine_is_pronghorn_metro() || machine_is_wrt300nv2() ||
290 + machine_is_tw5334())
291 uart_base = (volatile u32*) IXP4XX_UART2_BASE_PHYS;
293 uart_base = (volatile u32*) IXP4XX_UART1_BASE_PHYS;