1 From 24025a2dcf1248079dd3019fac6ed955252d277f Mon Sep 17 00:00:00 2001
2 From: Imre Kaloz <kaloz@openwrt.org>
3 Date: Mon, 14 Jul 2008 21:56:34 +0200
4 Subject: [PATCH] Add support for the Compex WP18 / NP18A boards
6 Signed-off-by: Imre Kaloz <kaloz@openwrt.org>
8 arch/arm/mach-ixp4xx/Kconfig | 8 ++
9 arch/arm/mach-ixp4xx/Makefile | 2 +
10 arch/arm/mach-ixp4xx/compex-setup.c | 136 +++++++++++++++++++++++++++++++++++
11 arch/arm/mach-ixp4xx/ixdp425-pci.c | 3 +-
12 arch/arm/tools/mach-types | 2 +-
13 5 files changed, 149 insertions(+), 2 deletions(-)
14 create mode 100644 arch/arm/mach-ixp4xx/compex-setup.c
16 --- a/arch/arm/mach-ixp4xx/Kconfig
17 +++ b/arch/arm/mach-ixp4xx/Kconfig
18 @@ -89,6 +89,14 @@ config MACH_SIDEWINDER
19 Engineering Sidewinder board. For more information on this
20 platform, see http://www.adiengineering.com
23 + bool "Compex WP18 / NP18A"
26 + Say 'Y' here if you want your kernel to support Compex'
27 + WP18 or NP18A boards. For more information on this
28 + platform, see http://www.compex.com.sg/home/OEM/product_ap.htm
33 --- a/arch/arm/mach-ixp4xx/Makefile
34 +++ b/arch/arm/mach-ixp4xx/Makefile
35 @@ -19,6 +19,7 @@ obj-pci-$(CONFIG_MACH_WG302V2) += wg302
36 obj-pci-$(CONFIG_MACH_FSG) += fsg-pci.o
37 obj-pci-$(CONFIG_MACH_PRONGHORN) += pronghorn-pci.o
38 obj-pci-$(CONFIG_MACH_SIDEWINDER) += sidewinder-pci.o
39 +obj-pci-$(CONFIG_MACH_COMPEX) += ixdp425-pci.o
43 @@ -36,6 +37,7 @@ obj-$(CONFIG_MACH_WG302V2) += wg302v2-se
44 obj-$(CONFIG_MACH_FSG) += fsg-setup.o
45 obj-$(CONFIG_MACH_PRONGHORN) += pronghorn-setup.o
46 obj-$(CONFIG_MACH_SIDEWINDER) += sidewinder-setup.o
47 +obj-$(CONFIG_MACH_COMPEX) += compex-setup.o
49 obj-$(CONFIG_PCI) += $(obj-pci-$(CONFIG_PCI)) common-pci.o
50 obj-$(CONFIG_IXP4XX_QMGR) += ixp4xx_qmgr.o
52 +++ b/arch/arm/mach-ixp4xx/compex-setup.c
55 + * arch/arm/mach-ixp4xx/compex-setup.c
57 + * Compex WP18 / NP18A board-setup
59 + * Copyright (C) 2008 Imre Kaloz <Kaloz@openwrt.org>
61 + * based on coyote-setup.c:
62 + * Copyright (C) 2003-2005 MontaVista Software, Inc.
64 + * Author: Imre Kaloz <Kaloz@openwrt.org>
67 +#include <linux/kernel.h>
68 +#include <linux/serial.h>
69 +#include <linux/serial_8250.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 compex_flash_data = {
76 + .map_name = "cfi_probe",
80 +static struct resource compex_flash_resource = {
81 + .flags = IORESOURCE_MEM,
84 +static struct platform_device compex_flash = {
85 + .name = "IXP4XX-Flash",
88 + .platform_data = &compex_flash_data,
91 + .resource = &compex_flash_resource,
94 +static struct resource compex_uart_resources[] = {
96 + .start = IXP4XX_UART1_BASE_PHYS,
97 + .end = IXP4XX_UART1_BASE_PHYS + 0x0fff,
98 + .flags = IORESOURCE_MEM
101 + .start = IXP4XX_UART2_BASE_PHYS,
102 + .end = IXP4XX_UART2_BASE_PHYS + 0x0fff,
103 + .flags = IORESOURCE_MEM
107 +static struct plat_serial8250_port compex_uart_data[] = {
109 + .mapbase = IXP4XX_UART1_BASE_PHYS,
110 + .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET,
111 + .irq = IRQ_IXP4XX_UART1,
112 + .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
113 + .iotype = UPIO_MEM,
115 + .uartclk = IXP4XX_UART_XTAL,
118 + .mapbase = IXP4XX_UART2_BASE_PHYS,
119 + .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET,
120 + .irq = IRQ_IXP4XX_UART2,
121 + .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
122 + .iotype = UPIO_MEM,
124 + .uartclk = IXP4XX_UART_XTAL,
129 +static struct platform_device compex_uart = {
130 + .name = "serial8250",
131 + .id = PLAT8250_DEV_PLATFORM,
132 + .dev.platform_data = compex_uart_data,
133 + .num_resources = 2,
134 + .resource = compex_uart_resources,
137 +static struct eth_plat_info compex_plat_eth[] = {
139 + .phy = IXP4XX_ETH_PHY_MAX_ADDR,
140 + .phy_mask = 0xf0000,
150 +static struct platform_device compex_eth[] = {
152 + .name = "ixp4xx_eth",
153 + .id = IXP4XX_ETH_NPEB,
154 + .dev.platform_data = compex_plat_eth,
156 + .name = "ixp4xx_eth",
157 + .id = IXP4XX_ETH_NPEC,
158 + .dev.platform_data = compex_plat_eth + 1,
162 +static struct platform_device *compex_devices[] __initdata = {
169 +static void __init compex_init(void)
173 + compex_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
174 + compex_flash_resource.end =
175 + IXP4XX_EXP_BUS_BASE(0) + SZ_32M - 1;
177 + platform_add_devices(compex_devices, ARRAY_SIZE(compex_devices));
180 +MACHINE_START(COMPEX, "Compex WP18 / NP18A")
181 + /* Maintainer: Imre Kaloz <Kaloz@openwrt.org> */
182 + .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
183 + .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
184 + .map_io = ixp4xx_map_io,
185 + .init_irq = ixp4xx_init_irq,
186 + .timer = &ixp4xx_timer,
187 + .boot_params = 0x0100,
188 + .init_machine = compex_init,
190 --- a/arch/arm/mach-ixp4xx/ixdp425-pci.c
191 +++ b/arch/arm/mach-ixp4xx/ixdp425-pci.c
192 @@ -66,7 +66,8 @@ struct hw_pci ixdp425_pci __initdata = {
193 int __init ixdp425_pci_init(void)
195 if (machine_is_ixdp425() || machine_is_ixcdp1100() ||
196 - machine_is_ixdp465() || machine_is_kixrp435())
197 + machine_is_ixdp465() || machine_is_kixrp435() ||
198 + machine_is_compex())
199 pci_common_init(&ixdp425_pci);
202 --- a/arch/arm/tools/mach-types
203 +++ b/arch/arm/tools/mach-types
204 @@ -1276,7 +1276,7 @@ oiab MACH_OIAB OIAB 1269
205 smdk6400 MACH_SMDK6400 SMDK6400 1270
206 nokia_n800 MACH_NOKIA_N800 NOKIA_N800 1271
207 greenphone MACH_GREENPHONE GREENPHONE 1272
208 -compex42x MACH_COMPEXWP18 COMPEXWP18 1273
209 +compex MACH_COMPEX COMPEX 1273
210 xmate MACH_XMATE XMATE 1274
211 energizer MACH_ENERGIZER ENERGIZER 1275
212 ime1 MACH_IME1 IME1 1276