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 @@ -20,6 +20,7 @@ obj-pci-$(CONFIG_MACH_FSG) += fsg-pci.o
36 obj-pci-$(CONFIG_MACH_ARCOM_VULCAN) += vulcan-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 @@ -39,6 +40,7 @@ obj-$(CONFIG_MACH_GORAMO_MLR) += goramo_
44 obj-$(CONFIG_MACH_ARCOM_VULCAN) += vulcan-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 + .map_io = ixp4xx_map_io,
183 + .init_irq = ixp4xx_init_irq,
184 + .timer = &ixp4xx_timer,
185 + .boot_params = 0x0100,
186 + .init_machine = compex_init,
188 --- a/arch/arm/mach-ixp4xx/ixdp425-pci.c
189 +++ b/arch/arm/mach-ixp4xx/ixdp425-pci.c
190 @@ -70,7 +70,8 @@ struct hw_pci ixdp425_pci __initdata = {
191 int __init ixdp425_pci_init(void)
193 if (machine_is_ixdp425() || machine_is_ixcdp1100() ||
194 - machine_is_ixdp465() || machine_is_kixrp435())
195 + machine_is_ixdp465() || machine_is_kixrp435() ||
196 + machine_is_compex())
197 pci_common_init(&ixdp425_pci);
200 --- a/arch/arm/tools/mach-types
201 +++ b/arch/arm/tools/mach-types
202 @@ -1273,7 +1273,7 @@ oiab MACH_OIAB OIAB 1269
203 smdk6400 MACH_SMDK6400 SMDK6400 1270
204 nokia_n800 MACH_NOKIA_N800 NOKIA_N800 1271
205 greenphone MACH_GREENPHONE GREENPHONE 1272
206 -compex42x MACH_COMPEXWP18 COMPEXWP18 1273
207 +compex MACH_COMPEX COMPEX 1273
208 xmate MACH_XMATE XMATE 1274
209 energizer MACH_ENERGIZER ENERGIZER 1275
210 ime1 MACH_IME1 IME1 1276