aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-ixp4xx/wg302v2-setup.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-12 17:17:12 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-12 17:17:12 -0400
commit4aabab2181f20560948c2045ce1faaa9ac1507a8 (patch)
tree6556e126687c9cbb4b4a35a8ad8c327df30ac256 /arch/arm/mach-ixp4xx/wg302v2-setup.c
parentbb50cbbd4beacd5ceda76c32fcb116c67fe8c66c (diff)
parentca9ced7f6798868f9d2c81a59b49f8c2136685d8 (diff)
Merge branch 'devel' of master.kernel.org:/home/rmk/linux-2.6-arm
* 'devel' of master.kernel.org:/home/rmk/linux-2.6-arm: (50 commits) [ARM] sa1100: remove boot time RTC initialisation [ARM] sa1100: stop doing our own rtc management over suspend [ARM] 4474/1: Do not check the PSR_F_BIT in valid_user_regs [ARM] 4473/2: Take the HWCAP definitions out of the elf.h file [ARM] pxa: move platform devices to separate header file [ARM] pxa: move device registration into CPU-specific file [ARM] pxa: remove boot time RTC initialisation [ARM] pxa: stop doing our own rtc management over suspend [ARM] 4451/1: pxa: make dma.c generic and remove cpu specific dma code [ARM] 4450/1: pxa: add pxa25x_init_irq() and pxa27x_init_irq() [ARM] 4440/1: PXA: enable the checking of ICIP2 for IRQs [ARM] 4438/1: PXA: remove #ifdef .. #endif from pxa_gpio_demux_handler() [ARM] 4437/1: PXA: move the GPIO IRQ initialization code to pxa_init_irq_gpio() [ARM] 4436/1: PXA: move low IRQ initialization code to pxa_init_irq_low() [ARM] 4435/1: PXA: remove PXA_INTERNAL_IRQS [ARM] 4434/1: PXA: remove PXA_IRQ_SKIP [ARM] pxa: Fix PXA27x suspend type validation, remove pxa_pm_prepare() [ARM] pxa: move pm_ops structure into CPU specific files [ARM] pxa: introduce cpu_is_pxaXXX macros [ARM] pxa: remove MMC register defines from pxa-regs.h ...
Diffstat (limited to 'arch/arm/mach-ixp4xx/wg302v2-setup.c')
-rw-r--r--arch/arm/mach-ixp4xx/wg302v2-setup.c109
1 files changed, 109 insertions, 0 deletions
diff --git a/arch/arm/mach-ixp4xx/wg302v2-setup.c b/arch/arm/mach-ixp4xx/wg302v2-setup.c
new file mode 100644
index 000000000000..f7e09ad804e8
--- /dev/null
+++ b/arch/arm/mach-ixp4xx/wg302v2-setup.c
@@ -0,0 +1,109 @@
1/*
2 * arch/arm/mach-ixp4xx/wg302-setup.c
3 *
4 * Board setup for the Netgear WG302 v2 and WAG302 v2
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
15#include <linux/kernel.h>
16#include <linux/init.h>
17#include <linux/device.h>
18#include <linux/serial.h>
19#include <linux/tty.h>
20#include <linux/serial_8250.h>
21#include <linux/slab.h>
22
23#include <asm/types.h>
24#include <asm/setup.h>
25#include <asm/memory.h>
26#include <asm/hardware.h>
27#include <asm/irq.h>
28#include <asm/mach-types.h>
29#include <asm/mach/arch.h>
30#include <asm/mach/flash.h>
31
32static struct flash_platform_data wg302v2_flash_data = {
33 .map_name = "cfi_probe",
34 .width = 2,
35};
36
37static struct resource wg302v2_flash_resource = {
38 .flags = IORESOURCE_MEM,
39};
40
41static struct platform_device wg302v2_flash = {
42 .name = "IXP4XX-Flash",
43 .id = 0,
44 .dev = {
45 .platform_data = &wg302v2_flash_data,
46 },
47 .num_resources = 1,
48 .resource = &wg302v2_flash_resource,
49};
50
51static struct resource wg302v2_uart_resource = {
52 .start = IXP4XX_UART2_BASE_PHYS,
53 .end = IXP4XX_UART2_BASE_PHYS + 0x0fff,
54 .flags = IORESOURCE_MEM,
55};
56
57static struct plat_serial8250_port wg302v2_uart_data[] = {
58 {
59 .mapbase = IXP4XX_UART2_BASE_PHYS,
60 .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET,
61 .irq = IRQ_IXP4XX_UART2,
62 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
63 .iotype = UPIO_MEM,
64 .regshift = 2,
65 .uartclk = IXP4XX_UART_XTAL,
66 },
67 { },
68};
69
70static struct platform_device wg302v2_uart = {
71 .name = "serial8250",
72 .id = PLAT8250_DEV_PLATFORM,
73 .dev = {
74 .platform_data = wg302v2_uart_data,
75 },
76 .num_resources = 1,
77 .resource = &wg302v2_uart_resource,
78};
79
80static struct platform_device *wg302v2_devices[] __initdata = {
81 &wg302v2_flash,
82 &wg302v2_uart,
83};
84
85static void __init wg302v2_init(void)
86{
87 ixp4xx_sys_init();
88
89 wg302v2_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
90 wg302v2_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_32M - 1;
91
92 *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE;
93 *IXP4XX_EXP_CS1 = *IXP4XX_EXP_CS0;
94
95 platform_add_devices(wg302v2_devices, ARRAY_SIZE(wg302v2_devices));
96}
97
98#ifdef CONFIG_MACH_WG302V2
99MACHINE_START(WG302V2, "Netgear WG302 v2 / WAG302 v2")
100 /* Maintainer: Imre Kaloz <kaloz@openwrt.org> */
101 .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
102 .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
103 .map_io = ixp4xx_map_io,
104 .init_irq = ixp4xx_init_irq,
105 .timer = &ixp4xx_timer,
106 .boot_params = 0x0100,
107 .init_machine = wg302v2_init,
108MACHINE_END
109#endif