2 +++ b/arch/arm/mach-ixp4xx/ap1000-setup.c
5 + * arch/arm/mach-ixp4xx/ap1000-setup.c
9 + * Copyright (C) 2007 Imre Kaloz <Kaloz@openwrt.org>
11 + * based on ixdp425-setup.c:
12 + * Copyright (C) 2003-2005 MontaVista Software, Inc.
14 + * Author: Imre Kaloz <Kaloz@openwrt.org>
17 +#include <linux/kernel.h>
18 +#include <linux/init.h>
19 +#include <linux/device.h>
20 +#include <linux/serial.h>
21 +#include <linux/tty.h>
22 +#include <linux/serial_8250.h>
23 +#include <linux/slab.h>
25 +#include <asm/types.h>
26 +#include <asm/setup.h>
27 +#include <asm/memory.h>
28 +#include <asm/hardware.h>
29 +#include <asm/mach-types.h>
31 +#include <asm/mach/arch.h>
32 +#include <asm/mach/flash.h>
34 +static struct flash_platform_data ap1000_flash_data = {
35 + .map_name = "cfi_probe",
39 +static struct resource ap1000_flash_resource = {
40 + .flags = IORESOURCE_MEM,
43 +static struct platform_device ap1000_flash = {
44 + .name = "IXP4XX-Flash",
47 + .platform_data = &ap1000_flash_data,
50 + .resource = &ap1000_flash_resource,
53 +static struct resource ap1000_uart_resources[] = {
55 + .start = IXP4XX_UART1_BASE_PHYS,
56 + .end = IXP4XX_UART1_BASE_PHYS + 0x0fff,
57 + .flags = IORESOURCE_MEM
60 + .start = IXP4XX_UART2_BASE_PHYS,
61 + .end = IXP4XX_UART2_BASE_PHYS + 0x0fff,
62 + .flags = IORESOURCE_MEM
66 +static struct plat_serial8250_port ap1000_uart_data[] = {
68 + .mapbase = IXP4XX_UART1_BASE_PHYS,
69 + .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET,
70 + .irq = IRQ_IXP4XX_UART1,
71 + .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
74 + .uartclk = IXP4XX_UART_XTAL,
77 + .mapbase = IXP4XX_UART2_BASE_PHYS,
78 + .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET,
79 + .irq = IRQ_IXP4XX_UART2,
80 + .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
83 + .uartclk = IXP4XX_UART_XTAL,
88 +static struct platform_device ap1000_uart = {
89 + .name = "serial8250",
90 + .id = PLAT8250_DEV_PLATFORM,
91 + .dev.platform_data = ap1000_uart_data,
93 + .resource = ap1000_uart_resources
96 +static struct platform_device *ap1000_devices[] __initdata = {
101 +static char ap1000_mem_fixup[] __initdata = "mem=64M ";
103 +static void __init ap1000_fixup(struct machine_desc *desc,
104 + struct tag *tags, char **cmdline, struct meminfo *mi)
107 + struct tag *t = tags;
108 + char *p = *cmdline;
110 + /* Find the end of the tags table, taking note of any cmdline tag. */
111 + for (; t->hdr.size; t = tag_next(t)) {
112 + if (t->hdr.tag == ATAG_CMDLINE) {
113 + p = t->u.cmdline.cmdline;
117 + /* Overwrite the end of the table with a new cmdline tag. */
118 + t->hdr.tag = ATAG_CMDLINE;
119 + t->hdr.size = (sizeof (struct tag_header) +
120 + strlen(ap1000_mem_fixup) + strlen(p) + 1 + 4) >> 2;
121 + strlcpy(t->u.cmdline.cmdline, ap1000_mem_fixup, COMMAND_LINE_SIZE);
122 + strlcpy(t->u.cmdline.cmdline + strlen(ap1000_mem_fixup), p,
123 + COMMAND_LINE_SIZE - strlen(ap1000_mem_fixup));
125 + /* Terminate the table. */
127 + t->hdr.tag = ATAG_NONE;
131 +static void __init ap1000_init(void)
135 + ap1000_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
136 + ap1000_flash_resource.end =
137 + IXP4XX_EXP_BUS_BASE(0) + ixp4xx_exp_bus_size - 1;
139 + platform_add_devices(ap1000_devices, ARRAY_SIZE(ap1000_devices));
142 +#ifdef CONFIG_MACH_AP1000
143 +MACHINE_START(AP1000, "Lanready AP-1000")
144 + /* Maintainer: Imre Kaloz <Kaloz@openwrt.org> */
145 + .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
146 + .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
147 + .fixup = ap1000_fixup,
148 + .map_io = ixp4xx_map_io,
149 + .init_irq = ixp4xx_init_irq,
150 + .timer = &ixp4xx_timer,
151 + .boot_params = 0x0100,
152 + .init_machine = ap1000_init,
155 --- a/arch/arm/mach-ixp4xx/ixdp425-pci.c
156 +++ b/arch/arm/mach-ixp4xx/ixdp425-pci.c
158 int __init ixdp425_pci_init(void)
160 if (machine_is_ixdp425() || machine_is_ixcdp1100() ||
161 - machine_is_ixdp465() || machine_is_kixrp435() || machine_is_compex())
162 + machine_is_ixdp465() || machine_is_kixrp435() ||
163 + machine_is_compex() || machine_is_ap1000())
164 pci_common_init(&ixdp425_pci);
167 --- a/arch/arm/mach-ixp4xx/Kconfig
168 +++ b/arch/arm/mach-ixp4xx/Kconfig
170 WRT300N v2 router. For more information on this
171 platform, see http://openwrt.org
174 + bool "Lanready AP-1000"
177 + Say 'Y' here if you want your kernel to support Lanready's
178 + AP1000 board. For more information on this
179 + platform, see http://openwrt.org
184 --- a/arch/arm/mach-ixp4xx/Makefile
185 +++ b/arch/arm/mach-ixp4xx/Makefile
187 obj-pci-$(CONFIG_MACH_SIDEWINDER) += sidewinder-pci.o
188 obj-pci-$(CONFIG_MACH_COMPEX) += ixdp425-pci.o
189 obj-pci-$(CONFIG_MACH_WRT300NV2) += wrt300nv2-pci.o
190 +obj-pci-$(CONFIG_MACH_AP1000) += ixdp425-pci.o
195 obj-$(CONFIG_MACH_SIDEWINDER) += sidewinder-setup.o
196 obj-$(CONFIG_MACH_COMPEX) += compex-setup.o
197 obj-$(CONFIG_MACH_WRT300NV2) += wrt300nv2-setup.o
198 +obj-$(CONFIG_MACH_AP1000) += ap1000-setup.o
200 obj-$(CONFIG_PCI) += $(obj-pci-$(CONFIG_PCI)) common-pci.o
201 obj-$(CONFIG_IXP4XX_QMGR) += ixp4xx_qmgr.o