1 Index: linux-2.6.25.1/arch/arm/mach-ixp4xx/ap1000-setup.c
2 ===================================================================
4 +++ linux-2.6.25.1/arch/arm/mach-ixp4xx/ap1000-setup.c
7 + * arch/arm/mach-ixp4xx/ap1000-setup.c
11 + * Copyright (C) 2007 Imre Kaloz <Kaloz@openwrt.org>
13 + * based on ixdp425-setup.c:
14 + * Copyright (C) 2003-2005 MontaVista Software, Inc.
16 + * Author: Imre Kaloz <Kaloz@openwrt.org>
19 +#include <linux/kernel.h>
20 +#include <linux/init.h>
21 +#include <linux/device.h>
22 +#include <linux/serial.h>
23 +#include <linux/tty.h>
24 +#include <linux/serial_8250.h>
25 +#include <linux/slab.h>
27 +#include <asm/types.h>
28 +#include <asm/setup.h>
29 +#include <asm/memory.h>
30 +#include <asm/hardware.h>
31 +#include <asm/mach-types.h>
33 +#include <asm/mach/arch.h>
34 +#include <asm/mach/flash.h>
36 +static struct flash_platform_data ap1000_flash_data = {
37 + .map_name = "cfi_probe",
41 +static struct resource ap1000_flash_resource = {
42 + .flags = IORESOURCE_MEM,
45 +static struct platform_device ap1000_flash = {
46 + .name = "IXP4XX-Flash",
49 + .platform_data = &ap1000_flash_data,
52 + .resource = &ap1000_flash_resource,
55 +static struct resource ap1000_uart_resources[] = {
57 + .start = IXP4XX_UART1_BASE_PHYS,
58 + .end = IXP4XX_UART1_BASE_PHYS + 0x0fff,
59 + .flags = IORESOURCE_MEM
62 + .start = IXP4XX_UART2_BASE_PHYS,
63 + .end = IXP4XX_UART2_BASE_PHYS + 0x0fff,
64 + .flags = IORESOURCE_MEM
68 +static struct plat_serial8250_port ap1000_uart_data[] = {
70 + .mapbase = IXP4XX_UART1_BASE_PHYS,
71 + .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET,
72 + .irq = IRQ_IXP4XX_UART1,
73 + .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
76 + .uartclk = IXP4XX_UART_XTAL,
79 + .mapbase = IXP4XX_UART2_BASE_PHYS,
80 + .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET,
81 + .irq = IRQ_IXP4XX_UART2,
82 + .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
85 + .uartclk = IXP4XX_UART_XTAL,
90 +static struct platform_device ap1000_uart = {
91 + .name = "serial8250",
92 + .id = PLAT8250_DEV_PLATFORM,
93 + .dev.platform_data = ap1000_uart_data,
95 + .resource = ap1000_uart_resources
98 +static struct platform_device *ap1000_devices[] __initdata = {
103 +static char ap1000_mem_fixup[] __initdata = "mem=64M ";
105 +static void __init ap1000_fixup(struct machine_desc *desc,
106 + struct tag *tags, char **cmdline, struct meminfo *mi)
109 + struct tag *t = tags;
110 + char *p = *cmdline;
112 + /* Find the end of the tags table, taking note of any cmdline tag. */
113 + for (; t->hdr.size; t = tag_next(t)) {
114 + if (t->hdr.tag == ATAG_CMDLINE) {
115 + p = t->u.cmdline.cmdline;
119 + /* Overwrite the end of the table with a new cmdline tag. */
120 + t->hdr.tag = ATAG_CMDLINE;
121 + t->hdr.size = (sizeof (struct tag_header) +
122 + strlen(ap1000_mem_fixup) + strlen(p) + 1 + 4) >> 2;
123 + strlcpy(t->u.cmdline.cmdline, ap1000_mem_fixup, COMMAND_LINE_SIZE);
124 + strlcpy(t->u.cmdline.cmdline + strlen(ap1000_mem_fixup), p,
125 + COMMAND_LINE_SIZE - strlen(ap1000_mem_fixup));
127 + /* Terminate the table. */
129 + t->hdr.tag = ATAG_NONE;
133 +static void __init ap1000_init(void)
137 + ap1000_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
138 + ap1000_flash_resource.end =
139 + IXP4XX_EXP_BUS_BASE(0) + ixp4xx_exp_bus_size - 1;
141 + platform_add_devices(ap1000_devices, ARRAY_SIZE(ap1000_devices));
144 +#ifdef CONFIG_MACH_AP1000
145 +MACHINE_START(AP1000, "Lanready AP-1000")
146 + /* Maintainer: Imre Kaloz <Kaloz@openwrt.org> */
147 + .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
148 + .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
149 + .fixup = ap1000_fixup,
150 + .map_io = ixp4xx_map_io,
151 + .init_irq = ixp4xx_init_irq,
152 + .timer = &ixp4xx_timer,
153 + .boot_params = 0x0100,
154 + .init_machine = ap1000_init,
157 Index: linux-2.6.25.1/arch/arm/mach-ixp4xx/ixdp425-pci.c
158 ===================================================================
159 --- linux-2.6.25.1.orig/arch/arm/mach-ixp4xx/ixdp425-pci.c
160 +++ linux-2.6.25.1/arch/arm/mach-ixp4xx/ixdp425-pci.c
161 @@ -66,7 +66,8 @@ struct hw_pci ixdp425_pci __initdata = {
162 int __init ixdp425_pci_init(void)
164 if (machine_is_ixdp425() || machine_is_ixcdp1100() ||
165 - machine_is_ixdp465() || machine_is_kixrp435() || machine_is_compex())
166 + machine_is_ixdp465() || machine_is_kixrp435() ||
167 + machine_is_compex() || machine_is_ap1000())
168 pci_common_init(&ixdp425_pci);
171 Index: linux-2.6.25.1/arch/arm/mach-ixp4xx/Kconfig
172 ===================================================================
173 --- linux-2.6.25.1.orig/arch/arm/mach-ixp4xx/Kconfig
174 +++ linux-2.6.25.1/arch/arm/mach-ixp4xx/Kconfig
175 @@ -89,6 +89,14 @@ config MACH_WRT300NV2
176 WRT300N v2 router. For more information on this
177 platform, see http://openwrt.org
180 + bool "Lanready AP-1000"
183 + Say 'Y' here if you want your kernel to support Lanready's
184 + AP1000 board. For more information on this
185 + platform, see http://openwrt.org
190 Index: linux-2.6.25.1/arch/arm/mach-ixp4xx/Makefile
191 ===================================================================
192 --- linux-2.6.25.1.orig/arch/arm/mach-ixp4xx/Makefile
193 +++ linux-2.6.25.1/arch/arm/mach-ixp4xx/Makefile
194 @@ -20,6 +20,7 @@ obj-pci-$(CONFIG_MACH_PRONGHORNMETRO) +=
195 obj-pci-$(CONFIG_MACH_COMPEX) += ixdp425-pci.o
196 obj-pci-$(CONFIG_MACH_WRT300NV2) += wrt300nv2-pci.o
197 obj-pci-$(CONFIG_MACH_SIDEWINDER) += sidewinder-pci.o
198 +obj-pci-$(CONFIG_MACH_AP1000) += ixdp425-pci.o
202 @@ -38,6 +39,7 @@ obj-$(CONFIG_MACH_PRONGHORNMETRO) += pro
203 obj-$(CONFIG_MACH_COMPEX) += compex-setup.o
204 obj-$(CONFIG_MACH_WRT300NV2) += wrt300nv2-setup.o
205 obj-$(CONFIG_MACH_SIDEWINDER) += sidewinder-setup.o
206 +obj-$(CONFIG_MACH_AP1000) += ap1000-setup.o
208 obj-$(CONFIG_PCI) += $(obj-pci-$(CONFIG_PCI)) common-pci.o
209 obj-$(CONFIG_IXP4XX_QMGR) += ixp4xx_qmgr.o