vserver 1.9.5.x5
[linux-2.6.git] / arch / arm / mach-ixp4xx / coyote-setup.c
1 /*
2  * arch/arm/mach-ixp4xx/coyote-setup.c
3  *
4  * Board setup for ADI Engineering and IXDGP425 boards
5  *
6  * Copyright (C) 2003-2004 MontaVista Software, Inc.
7  *
8  * Author: Deepak Saxena <dsaxena@plexity.net>
9  */
10
11 #include <linux/kernel.h>
12 #include <linux/init.h>
13 #include <linux/device.h>
14 #include <linux/serial.h>
15 #include <linux/tty.h>
16 #include <linux/serial_core.h>
17
18 #include <asm/types.h>
19 #include <asm/setup.h>
20 #include <asm/memory.h>
21 #include <asm/hardware.h>
22 #include <asm/irq.h>
23 #include <asm/mach-types.h>
24 #include <asm/mach/arch.h>
25 #include <asm/mach/flash.h>
26
27 #ifdef  __ARMEB__
28 #define REG_OFFSET      3
29 #else
30 #define REG_OFFSET      0
31 #endif
32
33 /*
34  * Only one serial port is connected on the Coyote & IXDPG425
35  */
36 static struct uart_port coyote_serial_port = {
37         .membase        = (char*)(IXP4XX_UART2_BASE_VIRT + REG_OFFSET),
38         .mapbase        = (IXP4XX_UART2_BASE_PHYS),
39         .irq            = IRQ_IXP4XX_UART2,
40         .flags          = UPF_SKIP_TEST,
41         .iotype         = UPIO_MEM,     
42         .regshift       = 2,
43         .uartclk        = IXP4XX_UART_XTAL,
44         .line           = 0,
45         .type           = PORT_XSCALE,
46         .fifosize       = 32
47 };
48
49 void __init coyote_map_io(void)
50 {
51         if (machine_is_ixdpg425()) {
52                 coyote_serial_port.membase =
53                         (char*)(IXP4XX_UART1_BASE_VIRT + REG_OFFSET);
54                 coyote_serial_port.mapbase = IXP4XX_UART1_BASE_PHYS;
55                 coyote_serial_port.irq = IRQ_IXP4XX_UART1;
56         }
57
58         early_serial_setup(&coyote_serial_port);
59
60         ixp4xx_map_io();
61 }
62
63 static struct flash_platform_data coyote_flash_data = {
64         .map_name       = "cfi_probe",
65         .width          = 2,
66 };
67
68 static struct resource coyote_flash_resource = {
69         .start          = COYOTE_FLASH_BASE,
70         .end            = COYOTE_FLASH_BASE + COYOTE_FLASH_SIZE,
71         .flags          = IORESOURCE_MEM,
72 };
73
74 static struct platform_device coyote_flash = {
75         .name           = "IXP4XX-Flash",
76         .id             = 0,
77         .dev            = {
78                 .platform_data = &coyote_flash_data,
79         },
80         .num_resources  = 1,
81         .resource       = &coyote_flash_resource,
82 };
83
84 static struct platform_device *coyote_devices[] __initdata = {
85         &coyote_flash
86 };
87
88 static void __init coyote_init(void)
89 {
90         *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE;
91         *IXP4XX_EXP_CS1 = *IXP4XX_EXP_CS0;
92
93         ixp4xx_sys_init();
94         platform_add_devices(coyote_devices, ARRAY_SIZE(coyote_devices));
95 }
96
97 #ifdef CONFIG_ARCH_ADI_COYOTE
98 MACHINE_START(ADI_COYOTE, "ADI Engineering Coyote")
99         MAINTAINER("MontaVista Software, Inc.")
100         BOOT_MEM(PHYS_OFFSET, IXP4XX_PERIPHERAL_BASE_PHYS,
101                 IXP4XX_PERIPHERAL_BASE_VIRT)
102         MAPIO(coyote_map_io)
103         INITIRQ(ixp4xx_init_irq)
104         .timer          = &ixp4xx_timer,
105         BOOT_PARAMS(0x0100)
106         INIT_MACHINE(coyote_init)
107 MACHINE_END
108 #endif
109
110 /*
111  * IXDPG425 is identical to Coyote except for which serial port
112  * is connected.
113  */
114 #ifdef CONFIG_MACH_IXDPG425
115 MACHINE_START(IXDPG425, "Intel IXDPG425")
116         MAINTAINER("MontaVista Software, Inc.")
117         BOOT_MEM(PHYS_OFFSET, IXP4XX_PERIPHERAL_BASE_PHYS,
118                 IXP4XX_PERIPHERAL_BASE_VIRT)
119         MAPIO(coyote_map_io)
120         INITIRQ(ixp4xx_init_irq)
121         .timer          = &ixp4xx_timer,
122         BOOT_PARAMS(0x0100)
123         INIT_MACHINE(coyote_init)
124 MACHINE_END
125 #endif
126