1 --- a/arch/arm/mach-ixp4xx/Kconfig
2 +++ b/arch/arm/mach-ixp4xx/Kconfig
3 @@ -160,6 +160,14 @@ config ARCH_PRPMC1100
4 PrPCM1100 Processor Mezanine Module. For more information on
5 this platform, see <file:Documentation/arm/IXP4xx>.
8 + bool "Titan Wireless TW-533-4"
11 + Say 'Y' here if you want your kernel to support the Titan
12 + Wireless TW533-4. For more information on this platform,
13 + see http://openwrt.org
18 --- a/arch/arm/mach-ixp4xx/Makefile
19 +++ b/arch/arm/mach-ixp4xx/Makefile
20 @@ -24,6 +24,7 @@ obj-pci-$(CONFIG_MACH_SIDEWINDER) += sid
21 obj-pci-$(CONFIG_MACH_COMPEXWP18) += ixdp425-pci.o
22 obj-pci-$(CONFIG_MACH_WRT300NV2) += wrt300nv2-pci.o
23 obj-pci-$(CONFIG_MACH_AP1000) += ixdp425-pci.o
24 +obj-pci-$(CONFIG_MACH_TW5334) += tw5334-pci.o
28 @@ -49,6 +50,7 @@ obj-$(CONFIG_MACH_SIDEWINDER) += sidewin
29 obj-$(CONFIG_MACH_COMPEXWP18) += compex42x-setup.o
30 obj-$(CONFIG_MACH_WRT300NV2) += wrt300nv2-setup.o
31 obj-$(CONFIG_MACH_AP1000) += ap1000-setup.o
32 +obj-$(CONFIG_MACH_TW5334) += tw5334-setup.o
34 obj-$(CONFIG_PCI) += $(obj-pci-$(CONFIG_PCI)) common-pci.o
35 obj-$(CONFIG_IXP4XX_QMGR) += ixp4xx_qmgr.o
36 --- a/arch/arm/mach-ixp4xx/include/mach/uncompress.h
37 +++ b/arch/arm/mach-ixp4xx/include/mach/uncompress.h
38 @@ -44,7 +44,7 @@ static __inline__ void __arch_decomp_set
39 machine_is_gateway7001() || machine_is_wg302v2() ||
40 machine_is_devixp() || machine_is_miccpt() || machine_is_mic256() ||
41 machine_is_pronghorn() || machine_is_pronghorn_metro() ||
42 - machine_is_wrt300nv2())
43 + machine_is_wrt300nv2() || machine_is_tw5334())
44 uart_base = (volatile u32*) IXP4XX_UART2_BASE_PHYS;
46 uart_base = (volatile u32*) IXP4XX_UART1_BASE_PHYS;
48 +++ b/arch/arm/mach-ixp4xx/tw5334-pci.c
51 + * arch/arch/mach-ixp4xx/tw5334-pci.c
53 + * PCI setup routines for the Titan Wireless TW-533-4
55 + * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
57 + * based on coyote-pci.c:
58 + * Copyright (C) 2002 Jungo Software Technologies.
59 + * Copyright (C) 2003 MontaVista Softwrae, Inc.
61 + * Maintainer: Imre Kaloz <kaloz@openwrt.org>
63 + * This program is free software; you can redistribute it and/or modify
64 + * it under the terms of the GNU General Public License version 2 as
65 + * published by the Free Software Foundation.
69 +#include <linux/kernel.h>
70 +#include <linux/pci.h>
71 +#include <linux/init.h>
72 +#include <linux/irq.h>
74 +#include <asm/mach-types.h>
75 +#include <mach/hardware.h>
77 +#include <asm/mach/pci.h>
79 +void __init tw5334_pci_preinit(void)
81 + irq_set_irq_type(IRQ_IXP4XX_GPIO6, IRQ_TYPE_LEVEL_LOW);
82 + irq_set_irq_type(IRQ_IXP4XX_GPIO2, IRQ_TYPE_LEVEL_LOW);
83 + irq_set_irq_type(IRQ_IXP4XX_GPIO1, IRQ_TYPE_LEVEL_LOW);
84 + irq_set_irq_type(IRQ_IXP4XX_GPIO0, IRQ_TYPE_LEVEL_LOW);
86 + ixp4xx_pci_preinit();
89 +static int __init tw5334_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
92 + return IRQ_IXP4XX_GPIO6;
93 + else if (slot == 13)
94 + return IRQ_IXP4XX_GPIO2;
95 + else if (slot == 14)
96 + return IRQ_IXP4XX_GPIO1;
97 + else if (slot == 15)
98 + return IRQ_IXP4XX_GPIO0;
102 +struct hw_pci tw5334_pci __initdata = {
103 + .nr_controllers = 1,
104 + .preinit = tw5334_pci_preinit,
105 + .ops = &ixp4xx_ops,
106 + .setup = ixp4xx_setup,
107 + .map_irq = tw5334_map_irq,
110 +int __init tw5334_pci_init(void)
112 + if (machine_is_tw5334())
113 + pci_common_init(&tw5334_pci);
117 +subsys_initcall(tw5334_pci_init);
119 +++ b/arch/arm/mach-ixp4xx/tw5334-setup.c
122 + * arch/arm/mach-ixp4xx/tw5334-setup.c
124 + * Board setup for the Titan Wireless TW-533-4
126 + * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
128 + * based on coyote-setup.c:
129 + * Copyright (C) 2003-2005 MontaVista Software, Inc.
131 + * Author: Imre Kaloz <Kaloz@openwrt.org>
134 +#include <linux/if_ether.h>
135 +#include <linux/kernel.h>
136 +#include <linux/init.h>
137 +#include <linux/device.h>
138 +#include <linux/serial.h>
139 +#include <linux/tty.h>
140 +#include <linux/serial_8250.h>
141 +#include <linux/slab.h>
143 +#include <asm/types.h>
144 +#include <asm/setup.h>
145 +#include <asm/memory.h>
146 +#include <mach/hardware.h>
147 +#include <asm/irq.h>
148 +#include <asm/mach-types.h>
149 +#include <asm/mach/arch.h>
150 +#include <asm/mach/flash.h>
152 +static struct flash_platform_data tw5334_flash_data = {
153 + .map_name = "cfi_probe",
157 +static struct resource tw5334_flash_resource = {
158 + .flags = IORESOURCE_MEM,
161 +static struct platform_device tw5334_flash = {
162 + .name = "IXP4XX-Flash",
165 + .platform_data = &tw5334_flash_data,
167 + .num_resources = 1,
168 + .resource = &tw5334_flash_resource,
171 +static struct resource tw5334_uart_resource = {
172 + .start = IXP4XX_UART2_BASE_PHYS,
173 + .end = IXP4XX_UART2_BASE_PHYS + 0x0fff,
174 + .flags = IORESOURCE_MEM,
177 +static struct plat_serial8250_port tw5334_uart_data[] = {
179 + .mapbase = IXP4XX_UART2_BASE_PHYS,
180 + .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET,
181 + .irq = IRQ_IXP4XX_UART2,
182 + .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
183 + .iotype = UPIO_MEM,
185 + .uartclk = IXP4XX_UART_XTAL,
190 +static struct platform_device tw5334_uart = {
191 + .name = "serial8250",
192 + .id = PLAT8250_DEV_PLATFORM,
194 + .platform_data = tw5334_uart_data,
196 + .num_resources = 1,
197 + .resource = &tw5334_uart_resource,
200 +/* Built-in 10/100 Ethernet MAC interfaces */
201 +static struct eth_plat_info tw5334_plat_eth[] = {
213 +static struct platform_device tw5334_eth[] = {
215 + .name = "ixp4xx_eth",
216 + .id = IXP4XX_ETH_NPEB,
217 + .dev.platform_data = tw5334_plat_eth,
218 + .dev.coherent_dma_mask = DMA_BIT_MASK(32),
220 + .name = "ixp4xx_eth",
221 + .id = IXP4XX_ETH_NPEC,
222 + .dev.platform_data = tw5334_plat_eth + 1,
223 + .dev.coherent_dma_mask = DMA_BIT_MASK(32),
227 +static struct platform_device *tw5334_devices[] __initdata = {
234 +static void __init tw5334_init(void)
236 + uint8_t __iomem *f;
241 + tw5334_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
242 + tw5334_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_32M - 1;
244 + *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE;
245 + *IXP4XX_EXP_CS1 = *IXP4XX_EXP_CS0;
247 + platform_add_devices(tw5334_devices, ARRAY_SIZE(tw5334_devices));
250 + * Map in a portion of the flash and read the MAC addresses.
251 + * Since it is stored in BE in the flash itself, we need to
252 + * byteswap it if we're in LE mode.
254 + f = ioremap(IXP4XX_EXP_BUS_BASE(0), 0x1000000);
256 + for (i = 0; i < 6; i++) {
258 + tw5334_plat_eth[0].hwaddr[i] = readb(f + 0xFC0422 + i);
259 + tw5334_plat_eth[1].hwaddr[i] = readb(f + 0xFC043B + i);
261 + tw5334_plat_eth[0].hwaddr[i] = readb(f + 0xFC0422 + (i^3));
262 + tw5334_plat_eth[1].hwaddr[i] = readb(f + 0xFC043B + (i^3));
268 + printk(KERN_INFO "TW-533-4: Using MAC address %pM for port 0\n",
269 + tw5334_plat_eth[0].hwaddr);
270 + printk(KERN_INFO "TW-533-4: Using MAC address %pM for port 1\n",
271 + tw5334_plat_eth[1].hwaddr);
274 +#ifdef CONFIG_MACH_TW5334
275 +MACHINE_START(TW5334, "Titan Wireless TW-533-4")
276 + /* Maintainer: Imre Kaloz <kaloz@openwrt.org> */
277 + .map_io = ixp4xx_map_io,
278 + .init_irq = ixp4xx_init_irq,
279 + .init_time = ixp4xx_timer_init,
280 + .atag_offset = 0x0100,
281 + .init_machine = tw5334_init,
282 +#if defined(CONFIG_PCI)
283 + .dma_zone_size = SZ_64M,
285 + .restart = ixp4xx_restart,