diff options
author | Imre Kaloz <kaloz@openwrt.org> | 2007-06-02 10:44:08 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2007-07-12 06:12:15 -0400 |
commit | 46918bd13b887e8f0ae2987e690bc2af9c6c08a4 (patch) | |
tree | 14d0969bbd89c94848fb0f59249310746d06acda /arch | |
parent | 4ad48b4bfa121a67ec04162d584afcfa75ed151a (diff) |
[ARM] 4425/2: Gateway 7001 series support
This patch provides support for the Gateway 7001 AccessPoint series.
Updated to stay below the 80 char limit in uncompress.h
Signed-off-by: Imre Kaloz <kaloz@openwrt.org>
Signed-off-by: Deepak Saxena <dsaxena@mvista.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-ixp4xx/Kconfig | 8 | ||||
-rw-r--r-- | arch/arm/mach-ixp4xx/Makefile | 2 | ||||
-rw-r--r-- | arch/arm/mach-ixp4xx/gateway7001-pci.c | 64 | ||||
-rw-r--r-- | arch/arm/mach-ixp4xx/gateway7001-setup.c | 108 |
4 files changed, 182 insertions, 0 deletions
diff --git a/arch/arm/mach-ixp4xx/Kconfig b/arch/arm/mach-ixp4xx/Kconfig index 060909870b50..daaa190c1253 100644 --- a/arch/arm/mach-ixp4xx/Kconfig +++ b/arch/arm/mach-ixp4xx/Kconfig | |||
@@ -41,6 +41,14 @@ config ARCH_ADI_COYOTE | |||
41 | Engineering Coyote Gateway Reference Platform. For more | 41 | Engineering Coyote Gateway Reference Platform. For more |
42 | information on this platform, see <file:Documentation/arm/IXP4xx>. | 42 | information on this platform, see <file:Documentation/arm/IXP4xx>. |
43 | 43 | ||
44 | config MACH_GATEWAY7001 | ||
45 | bool "Gateway 7001" | ||
46 | select PCI | ||
47 | help | ||
48 | Say 'Y' here if you want your kernel to support Gateway's | ||
49 | 7001 Access Point. For more information on this platform, | ||
50 | see http://openwrt.org | ||
51 | |||
44 | config ARCH_IXDP425 | 52 | config ARCH_IXDP425 |
45 | bool "IXDP425" | 53 | bool "IXDP425" |
46 | help | 54 | help |
diff --git a/arch/arm/mach-ixp4xx/Makefile b/arch/arm/mach-ixp4xx/Makefile index 3b87c47e06cf..b79ce249866a 100644 --- a/arch/arm/mach-ixp4xx/Makefile +++ b/arch/arm/mach-ixp4xx/Makefile | |||
@@ -13,6 +13,7 @@ obj-pci-$(CONFIG_MACH_GTWX5715) += gtwx5715-pci.o | |||
13 | obj-pci-$(CONFIG_MACH_NSLU2) += nslu2-pci.o | 13 | obj-pci-$(CONFIG_MACH_NSLU2) += nslu2-pci.o |
14 | obj-pci-$(CONFIG_MACH_NAS100D) += nas100d-pci.o | 14 | obj-pci-$(CONFIG_MACH_NAS100D) += nas100d-pci.o |
15 | obj-pci-$(CONFIG_MACH_DSMG600) += dsmg600-pci.o | 15 | obj-pci-$(CONFIG_MACH_DSMG600) += dsmg600-pci.o |
16 | obj-pci-$(CONFIG_MACH_GATEWAY7001) += gateway7001-pci.o | ||
16 | 17 | ||
17 | obj-y += common.o | 18 | obj-y += common.o |
18 | 19 | ||
@@ -24,5 +25,6 @@ obj-$(CONFIG_MACH_GTWX5715) += gtwx5715-setup.o | |||
24 | obj-$(CONFIG_MACH_NSLU2) += nslu2-setup.o nslu2-power.o | 25 | obj-$(CONFIG_MACH_NSLU2) += nslu2-setup.o nslu2-power.o |
25 | obj-$(CONFIG_MACH_NAS100D) += nas100d-setup.o nas100d-power.o | 26 | obj-$(CONFIG_MACH_NAS100D) += nas100d-setup.o nas100d-power.o |
26 | obj-$(CONFIG_MACH_DSMG600) += dsmg600-setup.o dsmg600-power.o | 27 | obj-$(CONFIG_MACH_DSMG600) += dsmg600-setup.o dsmg600-power.o |
28 | obj-$(CONFIG_MACH_GATEWAY7001) += gateway7001-setup.o | ||
27 | 29 | ||
28 | obj-$(CONFIG_PCI) += $(obj-pci-$(CONFIG_PCI)) common-pci.o | 30 | obj-$(CONFIG_PCI) += $(obj-pci-$(CONFIG_PCI)) common-pci.o |
diff --git a/arch/arm/mach-ixp4xx/gateway7001-pci.c b/arch/arm/mach-ixp4xx/gateway7001-pci.c new file mode 100644 index 000000000000..4f2eeb050314 --- /dev/null +++ b/arch/arm/mach-ixp4xx/gateway7001-pci.c | |||
@@ -0,0 +1,64 @@ | |||
1 | /* | ||
2 | * arch/arch/mach-ixp4xx/gateway7001-pci.c | ||
3 | * | ||
4 | * PCI setup routines for Gateway 7001 | ||
5 | * | ||
6 | * Copyright (C) 2007 Imre Kaloz <kaloz@openwrt.org> | ||
7 | * | ||
8 | * based on coyote-pci.c: | ||
9 | * Copyright (C) 2002 Jungo Software Technologies. | ||
10 | * Copyright (C) 2003 MontaVista Softwrae, Inc. | ||
11 | * | ||
12 | * Maintainer: Imre Kaloz <kaloz@openwrt.org> | ||
13 | * | ||
14 | * This program is free software; you can redistribute it and/or modify | ||
15 | * it under the terms of the GNU General Public License version 2 as | ||
16 | * published by the Free Software Foundation. | ||
17 | * | ||
18 | */ | ||
19 | |||
20 | #include <linux/kernel.h> | ||
21 | #include <linux/pci.h> | ||
22 | #include <linux/init.h> | ||
23 | #include <linux/irq.h> | ||
24 | |||
25 | #include <asm/mach-types.h> | ||
26 | #include <asm/hardware.h> | ||
27 | #include <asm/irq.h> | ||
28 | |||
29 | #include <asm/mach/pci.h> | ||
30 | |||
31 | void __init gateway7001_pci_preinit(void) | ||
32 | { | ||
33 | set_irq_type(IRQ_IXP4XX_GPIO10, IRQT_LOW); | ||
34 | set_irq_type(IRQ_IXP4XX_GPIO11, IRQT_LOW); | ||
35 | |||
36 | ixp4xx_pci_preinit(); | ||
37 | } | ||
38 | |||
39 | static int __init gateway7001_map_irq(struct pci_dev *dev, u8 slot, u8 pin) | ||
40 | { | ||
41 | if (slot == 1) | ||
42 | return IRQ_IXP4XX_GPIO11; | ||
43 | else if (slot == 2) | ||
44 | return IRQ_IXP4XX_GPIO10; | ||
45 | else return -1; | ||
46 | } | ||
47 | |||
48 | struct hw_pci gateway7001_pci __initdata = { | ||
49 | .nr_controllers = 1, | ||
50 | .preinit = gateway7001_pci_preinit, | ||
51 | .swizzle = pci_std_swizzle, | ||
52 | .setup = ixp4xx_setup, | ||
53 | .scan = ixp4xx_scan_bus, | ||
54 | .map_irq = gateway7001_map_irq, | ||
55 | }; | ||
56 | |||
57 | int __init gateway7001_pci_init(void) | ||
58 | { | ||
59 | if (machine_is_gateway7001()) | ||
60 | pci_common_init(&gateway7001_pci); | ||
61 | return 0; | ||
62 | } | ||
63 | |||
64 | subsys_initcall(gateway7001_pci_init); | ||
diff --git a/arch/arm/mach-ixp4xx/gateway7001-setup.c b/arch/arm/mach-ixp4xx/gateway7001-setup.c new file mode 100644 index 000000000000..37876832e141 --- /dev/null +++ b/arch/arm/mach-ixp4xx/gateway7001-setup.c | |||
@@ -0,0 +1,108 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-ixp4xx/gateway7001-setup.c | ||
3 | * | ||
4 | * Board setup for the Gateway 7001 board | ||
5 | * | ||
6 | * Copyright (C) 2007 Imre Kaloz <kaloz@openwrt.org> | ||
7 | * | ||
8 | * based on coyote-setup.c: | ||
9 | * Copyright (C) 2003-2005 MontaVista Software, Inc. | ||
10 | * | ||
11 | * Author: Imre Kaloz <Kaloz@openwrt.org> | ||
12 | */ | ||
13 | |||
14 | #include <linux/kernel.h> | ||
15 | #include <linux/init.h> | ||
16 | #include <linux/device.h> | ||
17 | #include <linux/serial.h> | ||
18 | #include <linux/tty.h> | ||
19 | #include <linux/serial_8250.h> | ||
20 | #include <linux/slab.h> | ||
21 | |||
22 | #include <asm/types.h> | ||
23 | #include <asm/setup.h> | ||
24 | #include <asm/memory.h> | ||
25 | #include <asm/hardware.h> | ||
26 | #include <asm/irq.h> | ||
27 | #include <asm/mach-types.h> | ||
28 | #include <asm/mach/arch.h> | ||
29 | #include <asm/mach/flash.h> | ||
30 | |||
31 | static struct flash_platform_data gateway7001_flash_data = { | ||
32 | .map_name = "cfi_probe", | ||
33 | .width = 2, | ||
34 | }; | ||
35 | |||
36 | static struct resource gateway7001_flash_resource = { | ||
37 | .flags = IORESOURCE_MEM, | ||
38 | }; | ||
39 | |||
40 | static struct platform_device gateway7001_flash = { | ||
41 | .name = "IXP4XX-Flash", | ||
42 | .id = 0, | ||
43 | .dev = { | ||
44 | .platform_data = &gateway7001_flash_data, | ||
45 | }, | ||
46 | .num_resources = 1, | ||
47 | .resource = &gateway7001_flash_resource, | ||
48 | }; | ||
49 | |||
50 | static struct resource gateway7001_uart_resource = { | ||
51 | .start = IXP4XX_UART2_BASE_PHYS, | ||
52 | .end = IXP4XX_UART2_BASE_PHYS + 0x0fff, | ||
53 | .flags = IORESOURCE_MEM, | ||
54 | }; | ||
55 | |||
56 | static struct plat_serial8250_port gateway7001_uart_data[] = { | ||
57 | { | ||
58 | .mapbase = IXP4XX_UART2_BASE_PHYS, | ||
59 | .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET, | ||
60 | .irq = IRQ_IXP4XX_UART2, | ||
61 | .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, | ||
62 | .iotype = UPIO_MEM, | ||
63 | .regshift = 2, | ||
64 | .uartclk = IXP4XX_UART_XTAL, | ||
65 | }, | ||
66 | { }, | ||
67 | }; | ||
68 | |||
69 | static struct platform_device gateway7001_uart = { | ||
70 | .name = "serial8250", | ||
71 | .id = PLAT8250_DEV_PLATFORM, | ||
72 | .dev = { | ||
73 | .platform_data = gateway7001_uart_data, | ||
74 | }, | ||
75 | .num_resources = 1, | ||
76 | .resource = &gateway7001_uart_resource, | ||
77 | }; | ||
78 | |||
79 | static struct platform_device *gateway7001_devices[] __initdata = { | ||
80 | &gateway7001_flash, | ||
81 | &gateway7001_uart | ||
82 | }; | ||
83 | |||
84 | static void __init gateway7001_init(void) | ||
85 | { | ||
86 | ixp4xx_sys_init(); | ||
87 | |||
88 | gateway7001_flash_resource.start = IXP4XX_EXP_BUS_BASE(0); | ||
89 | gateway7001_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_32M - 1; | ||
90 | |||
91 | *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE; | ||
92 | *IXP4XX_EXP_CS1 = *IXP4XX_EXP_CS0; | ||
93 | |||
94 | platform_add_devices(gateway7001_devices, ARRAY_SIZE(gateway7001_devices)); | ||
95 | } | ||
96 | |||
97 | #ifdef CONFIG_MACH_GATEWAY7001 | ||
98 | MACHINE_START(GATEWAY7001, "Gateway 7001 AP") | ||
99 | /* Maintainer: Imre Kaloz <kaloz@openwrt.org> */ | ||
100 | .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS, | ||
101 | .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc, | ||
102 | .map_io = ixp4xx_map_io, | ||
103 | .init_irq = ixp4xx_init_irq, | ||
104 | .timer = &ixp4xx_timer, | ||
105 | .boot_params = 0x0100, | ||
106 | .init_machine = gateway7001_init, | ||
107 | MACHINE_END | ||
108 | #endif | ||