vserver 1.9.5.x5
[linux-2.6.git] / arch / arm / mach-ixp4xx / ixdp425-setup.c
1 /*
2  * arch/arm/mach-ixp4xx/ixdp425-setup.c
3  *
4  * IXDP425/IXCDP1100 board-setup 
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/mach-types.h>
23 #include <asm/irq.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  * IXDP425 uses both chipset serial ports
35  */
36 static struct uart_port ixdp425_serial_ports[] = {
37         {
38                 .membase        = (char*)(IXP4XX_UART1_BASE_VIRT + REG_OFFSET),
39                 .mapbase        = (IXP4XX_UART1_BASE_PHYS),
40                 .irq            = IRQ_IXP4XX_UART1,
41                 .flags          = UPF_SKIP_TEST,
42                 .iotype         = UPIO_MEM,     
43                 .regshift       = 2,
44                 .uartclk        = IXP4XX_UART_XTAL,
45                 .line           = 0,
46                 .type           = PORT_XSCALE,
47                 .fifosize       = 32
48         } , {
49                 .membase        = (char*)(IXP4XX_UART2_BASE_VIRT + REG_OFFSET),
50                 .mapbase        = (IXP4XX_UART2_BASE_PHYS),
51                 .irq            = IRQ_IXP4XX_UART2,
52                 .flags          = UPF_SKIP_TEST,
53                 .iotype         = UPIO_MEM,     
54                 .regshift       = 2,
55                 .uartclk        = IXP4XX_UART_XTAL,
56                 .line           = 1,
57                 .type           = PORT_XSCALE,
58                 .fifosize       = 32
59         }
60 };
61
62 void __init ixdp425_map_io(void) 
63 {
64         early_serial_setup(&ixdp425_serial_ports[0]);
65         early_serial_setup(&ixdp425_serial_ports[1]);
66
67         ixp4xx_map_io();
68 }
69
70 static struct flash_platform_data ixdp425_flash_data = {
71         .map_name       = "cfi_probe",
72         .width          = 2,
73 };
74
75 static struct resource ixdp425_flash_resource = {
76         .start          = IXDP425_FLASH_BASE,
77         .end            = IXDP425_FLASH_BASE + IXDP425_FLASH_SIZE,
78         .flags          = IORESOURCE_MEM,
79 };
80
81 static struct platform_device ixdp425_flash = {
82         .name           = "IXP4XX-Flash",
83         .id             = 0,
84         .dev            = {
85                 .platform_data = &ixdp425_flash_data,
86         },
87         .num_resources  = 1,
88         .resource       = &ixdp425_flash_resource,
89 };
90
91 static struct ixp4xx_i2c_pins ixdp425_i2c_gpio_pins = {
92         .sda_pin        = IXDP425_SDA_PIN,
93         .scl_pin        = IXDP425_SCL_PIN,
94 };
95
96 static struct platform_device ixdp425_i2c_controller = {
97         .name           = "IXP4XX-I2C",
98         .id             = 0,
99         .dev            = {
100                 .platform_data = &ixdp425_i2c_gpio_pins,
101         },
102         .num_resources  = 0
103 };
104
105 static struct platform_device *ixdp425_devices[] __initdata = {
106         &ixdp425_i2c_controller,
107         &ixdp425_flash
108 };
109
110 static void __init ixdp425_init(void)
111 {
112         ixp4xx_sys_init();
113
114         /*
115          * IXP465 has 32MB window
116          */
117         if (machine_is_ixdp465()) {
118                 ixdp425_flash_resource.end += IXDP425_FLASH_SIZE;
119         }
120
121         platform_add_devices(ixdp425_devices, ARRAY_SIZE(ixdp425_devices));
122 }
123
124 MACHINE_START(IXDP425, "Intel IXDP425 Development Platform")
125         MAINTAINER("MontaVista Software, Inc.")
126         BOOT_MEM(PHYS_OFFSET, IXP4XX_PERIPHERAL_BASE_PHYS,
127                 IXP4XX_PERIPHERAL_BASE_VIRT)
128         MAPIO(ixdp425_map_io)
129         INITIRQ(ixp4xx_init_irq)
130         .timer          = &ixp4xx_timer,
131         BOOT_PARAMS(0x0100)
132         INIT_MACHINE(ixdp425_init)
133 MACHINE_END
134
135 MACHINE_START(IXDP465, "Intel IXDP465 Development Platform")
136         MAINTAINER("MontaVista Software, Inc.")
137         BOOT_MEM(PHYS_OFFSET, IXP4XX_PERIPHERAL_BASE_PHYS,
138                 IXP4XX_PERIPHERAL_BASE_VIRT)
139         MAPIO(ixdp425_map_io)
140         INITIRQ(ixp4xx_init_irq)
141         .timer          = &ixp4xx_timer,
142         BOOT_PARAMS(0x0100)
143         INIT_MACHINE(ixdp425_init)
144 MACHINE_END
145
146 MACHINE_START(IXCDP1100, "Intel IXCDP1100 Development Platform")
147         MAINTAINER("MontaVista Software, Inc.")
148         BOOT_MEM(PHYS_OFFSET, IXP4XX_PERIPHERAL_BASE_PHYS,
149                 IXP4XX_PERIPHERAL_BASE_VIRT)
150         MAPIO(ixdp425_map_io)
151         INITIRQ(ixp4xx_init_irq)
152         .timer          = &ixp4xx_timer,
153         BOOT_PARAMS(0x0100)
154         INIT_MACHINE(ixdp425_init)
155 MACHINE_END
156
157 /*
158  * Avila is functionally equivalent to IXDP425 except that it adds
159  * a CF IDE slot hanging off the expansion bus. When we have a 
160  * driver for IXP4xx CF IDE with driver model support we'll move
161  * Avila to it's own setup file.
162  */
163 #ifdef CONFIG_ARCH_AVILA
164 MACHINE_START(AVILA, "Gateworks Avila Network Platform")
165         MAINTAINER("Deepak Saxena <dsaxena@plexity.net>")
166         BOOT_MEM(PHYS_OFFSET, IXP4XX_PERIPHERAL_BASE_PHYS,
167                 IXP4XX_PERIPHERAL_BASE_VIRT)
168         MAPIO(ixdp425_map_io)
169         INITIRQ(ixp4xx_init_irq)
170         .timer          = &ixp4xx_timer,
171         BOOT_PARAMS(0x0100)
172         INIT_MACHINE(ixdp425_init)
173 MACHINE_END
174 #endif
175