OpenWrt – Blame information for rev 2
?pathlinks?
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 1 | office | 1 | --- a/arch/arm/mach-ixp4xx/Kconfig |
| 2 | +++ b/arch/arm/mach-ixp4xx/Kconfig |
||
| 3 | @@ -101,6 +101,14 @@ config MACH_WRT300NV2 |
||
| 4 | WRT300N v2 router. For more information on this |
||
| 5 | platform, see http://openwrt.org |
||
| 6 | |||
| 7 | +config MACH_AP1000 |
||
| 8 | + bool "Lanready AP-1000" |
||
| 9 | + select PCI |
||
| 10 | + help |
||
| 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 |
||
| 14 | + |
||
| 15 | config ARCH_IXDP425 |
||
| 16 | bool "IXDP425" |
||
| 17 | help |
||
| 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 |
||
| 25 | |||
| 26 | obj-y += common.o |
||
| 27 | |||
| 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 |
||
| 33 | |||
| 34 | obj-$(CONFIG_PCI) += $(obj-pci-$(CONFIG_PCI)) common-pci.o |
||
| 35 | obj-$(CONFIG_IXP4XX_QMGR) += ixp4xx_qmgr.o |
||
| 36 | --- /dev/null |
||
| 37 | +++ b/arch/arm/mach-ixp4xx/ap1000-setup.c |
||
| 38 | @@ -0,0 +1,152 @@ |
||
| 39 | +/* |
||
| 40 | + * arch/arm/mach-ixp4xx/ap1000-setup.c |
||
| 41 | + * |
||
| 42 | + * Lanready AP-1000 |
||
| 43 | + * |
||
| 44 | + * Copyright (C) 2007 Imre Kaloz <Kaloz@openwrt.org> |
||
| 45 | + * |
||
| 46 | + * based on ixdp425-setup.c: |
||
| 47 | + * Copyright (C) 2003-2005 MontaVista Software, Inc. |
||
| 48 | + * |
||
| 49 | + * Author: Imre Kaloz <Kaloz@openwrt.org> |
||
| 50 | + */ |
||
| 51 | + |
||
| 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> |
||
| 60 | + |
||
| 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> |
||
| 66 | +#include <asm/irq.h> |
||
| 67 | +#include <asm/mach/arch.h> |
||
| 68 | +#include <asm/mach/flash.h> |
||
| 69 | + |
||
| 70 | +static struct flash_platform_data ap1000_flash_data = { |
||
| 71 | + .map_name = "cfi_probe", |
||
| 72 | + .width = 2, |
||
| 73 | +}; |
||
| 74 | + |
||
| 75 | +static struct resource ap1000_flash_resource = { |
||
| 76 | + .flags = IORESOURCE_MEM, |
||
| 77 | +}; |
||
| 78 | + |
||
| 79 | +static struct platform_device ap1000_flash = { |
||
| 80 | + .name = "IXP4XX-Flash", |
||
| 81 | + .id = 0, |
||
| 82 | + .dev = { |
||
| 83 | + .platform_data = &ap1000_flash_data, |
||
| 84 | + }, |
||
| 85 | + .num_resources = 1, |
||
| 86 | + .resource = &ap1000_flash_resource, |
||
| 87 | +}; |
||
| 88 | + |
||
| 89 | +static struct resource ap1000_uart_resources[] = { |
||
| 90 | + { |
||
| 91 | + .start = IXP4XX_UART1_BASE_PHYS, |
||
| 92 | + .end = IXP4XX_UART1_BASE_PHYS + 0x0fff, |
||
| 93 | + .flags = IORESOURCE_MEM |
||
| 94 | + }, |
||
| 95 | + { |
||
| 96 | + .start = IXP4XX_UART2_BASE_PHYS, |
||
| 97 | + .end = IXP4XX_UART2_BASE_PHYS + 0x0fff, |
||
| 98 | + .flags = IORESOURCE_MEM |
||
| 99 | + } |
||
| 100 | +}; |
||
| 101 | + |
||
| 102 | +static struct plat_serial8250_port ap1000_uart_data[] = { |
||
| 103 | + { |
||
| 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, |
||
| 109 | + .regshift = 2, |
||
| 110 | + .uartclk = IXP4XX_UART_XTAL, |
||
| 111 | + }, |
||
| 112 | + { |
||
| 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, |
||
| 118 | + .regshift = 2, |
||
| 119 | + .uartclk = IXP4XX_UART_XTAL, |
||
| 120 | + }, |
||
| 121 | + { }, |
||
| 122 | +}; |
||
| 123 | + |
||
| 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 |
||
| 130 | +}; |
||
| 131 | + |
||
| 132 | +static struct platform_device *ap1000_devices[] __initdata = { |
||
| 133 | + &ap1000_flash, |
||
| 134 | + &ap1000_uart |
||
| 135 | +}; |
||
| 136 | + |
||
| 137 | +static char ap1000_mem_fixup[] __initdata = "mem=64M "; |
||
| 138 | + |
||
| 139 | +static void __init ap1000_fixup(struct tag *tags, char **cmdline) |
||
| 140 | +{ |
||
| 141 | + struct tag *t = tags; |
||
| 142 | + char *p = *cmdline; |
||
| 143 | + |
||
| 144 | + /* Find the end of the tags table, taking note of any cmdline tag. */ |
||
| 145 | + for (; t->hdr.size; t = tag_next(t)) { |
||
| 146 | + if (t->hdr.tag == ATAG_CMDLINE) { |
||
| 147 | + p = t->u.cmdline.cmdline; |
||
| 148 | + } |
||
| 149 | + } |
||
| 150 | + |
||
| 151 | + /* Overwrite the end of the table with a new cmdline tag. */ |
||
| 152 | + t->hdr.tag = ATAG_CMDLINE; |
||
| 153 | + t->hdr.size = (sizeof (struct tag_header) + |
||
| 154 | + strlen(ap1000_mem_fixup) + strlen(p) + 1 + 4) >> 2; |
||
| 155 | + strlcpy(t->u.cmdline.cmdline, ap1000_mem_fixup, COMMAND_LINE_SIZE); |
||
| 156 | + strlcpy(t->u.cmdline.cmdline + strlen(ap1000_mem_fixup), p, |
||
| 157 | + COMMAND_LINE_SIZE - strlen(ap1000_mem_fixup)); |
||
| 158 | + |
||
| 159 | + /* Terminate the table. */ |
||
| 160 | + t = tag_next(t); |
||
| 161 | + t->hdr.tag = ATAG_NONE; |
||
| 162 | + t->hdr.size = 0; |
||
| 163 | +} |
||
| 164 | + |
||
| 165 | +static void __init ap1000_init(void) |
||
| 166 | +{ |
||
| 167 | + ixp4xx_sys_init(); |
||
| 168 | + |
||
| 169 | + ap1000_flash_resource.start = IXP4XX_EXP_BUS_BASE(0); |
||
| 170 | + ap1000_flash_resource.end = |
||
| 171 | + IXP4XX_EXP_BUS_BASE(0) + ixp4xx_exp_bus_size - 1; |
||
| 172 | + |
||
| 173 | + platform_add_devices(ap1000_devices, ARRAY_SIZE(ap1000_devices)); |
||
| 174 | +} |
||
| 175 | + |
||
| 176 | +#ifdef CONFIG_MACH_AP1000 |
||
| 177 | +MACHINE_START(AP1000, "Lanready AP-1000") |
||
| 178 | + /* Maintainer: Imre Kaloz <Kaloz@openwrt.org> */ |
||
| 179 | + .fixup = ap1000_fixup, |
||
| 180 | + .map_io = ixp4xx_map_io, |
||
| 181 | + .init_irq = ixp4xx_init_irq, |
||
| 182 | + .init_time = ixp4xx_timer_init, |
||
| 183 | + .atag_offset = 0x0100, |
||
| 184 | + .init_machine = ap1000_init, |
||
| 185 | +#if defined(CONFIG_PCI) |
||
| 186 | + .dma_zone_size = SZ_64M, |
||
| 187 | +#endif |
||
| 188 | + .restart = ixp4xx_restart, |
||
| 189 | +MACHINE_END |
||
| 190 | +#endif |
||
| 191 | --- a/arch/arm/mach-ixp4xx/ixdp425-pci.c |
||
| 192 | +++ b/arch/arm/mach-ixp4xx/ixdp425-pci.c |
||
| 193 | @@ -70,7 +70,7 @@ int __init ixdp425_pci_init(void) |
||
| 194 | { |
||
| 195 | if (machine_is_ixdp425() || machine_is_ixcdp1100() || |
||
| 196 | machine_is_ixdp465() || machine_is_kixrp435() || |
||
| 197 | - machine_is_compex42x()) |
||
| 198 | + machine_is_compex42x() || machine_is_ap1000()) |
||
| 199 | pci_common_init(&ixdp425_pci); |
||
| 200 | return 0; |
||
| 201 | } |