1 --- a/arch/arm/mach-ixp4xx/Kconfig
2 +++ b/arch/arm/mach-ixp4xx/Kconfig
3 @@ -105,6 +105,14 @@ config MACH_WRT300NV2
4 WRT300N v2 router. For more information on this
5 platform, see http://openwrt.org
8 + bool "Lanready AP-1000"
11 + Say 'Y' here if you want your kernel to support Lanready's
12 + AP1000 board. For more information on this
13 + platform, see http://openwrt.org
18 --- a/arch/arm/mach-ixp4xx/Makefile
19 +++ b/arch/arm/mach-ixp4xx/Makefile
20 @@ -23,6 +23,7 @@ obj-pci-$(CONFIG_MACH_PRONGHORN) += pron
21 obj-pci-$(CONFIG_MACH_SIDEWINDER) += sidewinder-pci.o
22 obj-pci-$(CONFIG_MACH_COMPEXWP18) += ixdp425-pci.o
23 obj-pci-$(CONFIG_MACH_WRT300NV2) += wrt300nv2-pci.o
24 +obj-pci-$(CONFIG_MACH_AP1000) += ixdp425-pci.o
28 @@ -47,6 +48,7 @@ obj-$(CONFIG_MACH_PRONGHORN) += pronghor
29 obj-$(CONFIG_MACH_SIDEWINDER) += sidewinder-setup.o
30 obj-$(CONFIG_MACH_COMPEXWP18) += compex42x-setup.o
31 obj-$(CONFIG_MACH_WRT300NV2) += wrt300nv2-setup.o
32 +obj-$(CONFIG_MACH_AP1000) += ap1000-setup.o
34 obj-$(CONFIG_PCI) += $(obj-pci-$(CONFIG_PCI)) common-pci.o
35 obj-$(CONFIG_IXP4XX_QMGR) += ixp4xx_qmgr.o
37 +++ b/arch/arm/mach-ixp4xx/ap1000-setup.c
40 + * arch/arm/mach-ixp4xx/ap1000-setup.c
44 + * Copyright (C) 2007 Imre Kaloz <Kaloz@openwrt.org>
46 + * based on ixdp425-setup.c:
47 + * Copyright (C) 2003-2005 MontaVista Software, Inc.
49 + * Author: Imre Kaloz <Kaloz@openwrt.org>
52 +#include <linux/kernel.h>
53 +#include <linux/init.h>
54 +#include <linux/device.h>
55 +#include <linux/serial.h>
56 +#include <linux/tty.h>
57 +#include <linux/serial_8250.h>
58 +#include <linux/slab.h>
59 +#include <linux/dma-mapping.h>
61 +#include <asm/types.h>
62 +#include <asm/setup.h>
63 +#include <asm/memory.h>
64 +#include <mach/hardware.h>
65 +#include <asm/mach-types.h>
67 +#include <asm/mach/arch.h>
68 +#include <asm/mach/flash.h>
70 +static struct flash_platform_data ap1000_flash_data = {
71 + .map_name = "cfi_probe",
75 +static struct resource ap1000_flash_resource = {
76 + .flags = IORESOURCE_MEM,
79 +static struct platform_device ap1000_flash = {
80 + .name = "IXP4XX-Flash",
83 + .platform_data = &ap1000_flash_data,
86 + .resource = &ap1000_flash_resource,
89 +static struct resource ap1000_uart_resources[] = {
91 + .start = IXP4XX_UART1_BASE_PHYS,
92 + .end = IXP4XX_UART1_BASE_PHYS + 0x0fff,
93 + .flags = IORESOURCE_MEM
96 + .start = IXP4XX_UART2_BASE_PHYS,
97 + .end = IXP4XX_UART2_BASE_PHYS + 0x0fff,
98 + .flags = IORESOURCE_MEM
102 +static struct plat_serial8250_port ap1000_uart_data[] = {
104 + .mapbase = IXP4XX_UART1_BASE_PHYS,
105 + .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET,
106 + .irq = IRQ_IXP4XX_UART1,
107 + .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
108 + .iotype = UPIO_MEM,
110 + .uartclk = IXP4XX_UART_XTAL,
113 + .mapbase = IXP4XX_UART2_BASE_PHYS,
114 + .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET,
115 + .irq = IRQ_IXP4XX_UART2,
116 + .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
117 + .iotype = UPIO_MEM,
119 + .uartclk = IXP4XX_UART_XTAL,
124 +static struct platform_device ap1000_uart = {
125 + .name = "serial8250",
126 + .id = PLAT8250_DEV_PLATFORM,
127 + .dev.platform_data = ap1000_uart_data,
128 + .num_resources = 2,
129 + .resource = ap1000_uart_resources
132 +static struct platform_device *ap1000_devices[] __initdata = {
137 +static char ap1000_mem_fixup[] __initdata = "mem=64M ";
139 +static void __init ap1000_fixup(struct machine_desc *desc,
140 + struct tag *tags, char **cmdline, struct meminfo *mi)
143 + struct tag *t = tags;
144 + char *p = *cmdline;
146 + /* Find the end of the tags table, taking note of any cmdline tag. */
147 + for (; t->hdr.size; t = tag_next(t)) {
148 + if (t->hdr.tag == ATAG_CMDLINE) {
149 + p = t->u.cmdline.cmdline;
153 + /* Overwrite the end of the table with a new cmdline tag. */
154 + t->hdr.tag = ATAG_CMDLINE;
155 + t->hdr.size = (sizeof (struct tag_header) +
156 + strlen(ap1000_mem_fixup) + strlen(p) + 1 + 4) >> 2;
157 + strlcpy(t->u.cmdline.cmdline, ap1000_mem_fixup, COMMAND_LINE_SIZE);
158 + strlcpy(t->u.cmdline.cmdline + strlen(ap1000_mem_fixup), p,
159 + COMMAND_LINE_SIZE - strlen(ap1000_mem_fixup));
161 + /* Terminate the table. */
163 + t->hdr.tag = ATAG_NONE;
167 +static void __init ap1000_init(void)
171 + ap1000_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
172 + ap1000_flash_resource.end =
173 + IXP4XX_EXP_BUS_BASE(0) + ixp4xx_exp_bus_size - 1;
175 + platform_add_devices(ap1000_devices, ARRAY_SIZE(ap1000_devices));
178 +#ifdef CONFIG_MACH_AP1000
179 +MACHINE_START(AP1000, "Lanready AP-1000")
180 + /* Maintainer: Imre Kaloz <Kaloz@openwrt.org> */
181 + .fixup = ap1000_fixup,
182 + .map_io = ixp4xx_map_io,
183 + .init_irq = ixp4xx_init_irq,
184 + .init_time = ixp4xx_timer_init,
185 + .atag_offset = 0x0100,
186 + .init_machine = ap1000_init,
187 +#if defined(CONFIG_PCI)
188 + .dma_zone_size = SZ_64M,
190 + .restart = ixp4xx_restart,
193 --- a/arch/arm/mach-ixp4xx/ixdp425-pci.c
194 +++ b/arch/arm/mach-ixp4xx/ixdp425-pci.c
195 @@ -70,7 +70,7 @@ int __init ixdp425_pci_init(void)
197 if (machine_is_ixdp425() || machine_is_ixcdp1100() ||
198 machine_is_ixdp465() || machine_is_kixrp435() ||
199 - machine_is_compex42x())
200 + machine_is_compex42x() || machine_is_ap1000())
201 pci_common_init(&ixdp425_pci);