This commit was manufactured by cvs2svn to create branch 'fedora'.
[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/init.h>
12 #include <linux/device.h>
13 #include <linux/serial.h>
14 #include <linux/tty.h>
15 #include <linux/serial_core.h>
16
17 #include <asm/types.h>
18 #include <asm/setup.h>
19 #include <asm/memory.h>
20 #include <asm/hardware.h>
21 #include <asm/mach-types.h>
22 #include <asm/irq.h>
23 #include <asm/mach/arch.h>
24 #include <asm/mach/flash.h>
25
26 #ifdef  __ARMEB__
27 #define REG_OFFSET      3
28 #else
29 #define REG_OFFSET      0
30 #endif
31
32 /*
33  * IXDP425 uses both chipset serial ports
34  */
35 static struct uart_port ixdp425_serial_ports[] = {
36         {
37                 .membase        = (char*)(IXP4XX_UART1_BASE_VIRT + REG_OFFSET),
38                 .mapbase        = (IXP4XX_UART1_BASE_PHYS),
39                 .irq            = IRQ_IXP4XX_UART1,
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                 .membase        = (char*)(IXP4XX_UART2_BASE_VIRT + REG_OFFSET),
49                 .mapbase        = (IXP4XX_UART2_BASE_PHYS),
50                 .irq            = IRQ_IXP4XX_UART2,
51                 .flags          = UPF_SKIP_TEST,
52                 .iotype         = UPIO_MEM,     
53                 .regshift       = 2,
54                 .uartclk        = IXP4XX_UART_XTAL,
55                 .line           = 1,
56                 .type           = PORT_XSCALE,
57                 .fifosize       = 32
58         }
59 };
60
61 void __init ixdp425_map_io(void) 
62 {
63         early_serial_setup(&ixdp425_serial_ports[0]);
64         early_serial_setup(&ixdp425_serial_ports[1]);
65
66         ixp4xx_map_io();
67 }
68
69 static struct flash_platform_data ixdp425_flash_data = {
70         .map_name       = "cfi_probe",
71         .width          = 2,
72 };
73
74 static struct resource ixdp425_flash_resource = {
75         .start          = IXDP425_FLASH_BASE,
76         .end            = IXDP425_FLASH_BASE + IXDP425_FLASH_SIZE,
77         .flags          = IORESOURCE_MEM,
78 };
79
80 static struct platform_device ixdp425_flash_device = {
81         .name           = "IXP4XX-Flash",
82         .id             = 0,
83         .dev            = {
84                 .platform_data = &ixdp425_flash_data,
85         },
86         .num_resources  = 1,
87         .resource       = &ixdp425_flash_resource,
88 };
89
90 static struct ixp4xx_i2c_pins ixdp425_i2c_gpio_pins = {
91         .sda_pin        = IXDP425_SDA_PIN,
92         .scl_pin        = IXDP425_SCL_PIN,
93 };
94
95 static struct platform_device ixdp425_i2c_controller = {
96         .name           = "IXP4XX-I2C",
97         .id             = 0,
98         .dev            = {
99                 .platform_data = &ixdp425_i2c_gpio_pins,
100         },
101         .num_resources  = 0
102 };
103
104 static void __init ixdp425_init(void)
105 {
106         platform_add_device(&ixdp425_flash_device);
107         platform_add_device(&ixdp425_i2c_controller);
108 }
109
110 MACHINE_START(IXDP425, "Intel IXDP425 Development Platform")
111         MAINTAINER("MontaVista Software, Inc.")
112         BOOT_MEM(PHYS_OFFSET, IXP4XX_PERIPHERAL_BASE_PHYS,
113                 IXP4XX_PERIPHERAL_BASE_VIRT)
114         MAPIO(ixdp425_map_io)
115         INITIRQ(ixp4xx_init_irq)
116         BOOT_PARAMS(0x0100)
117         INIT_MACHINE(ixdp425_init)
118 MACHINE_END
119
120 MACHINE_START(IXCDP1100, "Intel IXCDP1100 Development Platform")
121         MAINTAINER("MontaVista Software, Inc.")
122         BOOT_MEM(PHYS_OFFSET, IXP4XX_PERIPHERAL_BASE_PHYS,
123                 IXP4XX_PERIPHERAL_BASE_VIRT)
124         MAPIO(ixdp425_map_io)
125         INITIRQ(ixp4xx_init_irq)
126         BOOT_PARAMS(0x0100)
127         INIT_MACHINE(ixdp425_init)
128 MACHINE_END
129
130 /*
131  * Avila is functionally equivalent to IXDP425 except that it adds
132  * a CF IDE slot hanging off the expansion bus. When we have a 
133  * driver for IXP4xx CF IDE with driver model support we'll move
134  * Avila to it's own setup file.
135  */
136 #ifdef CONFIG_ARCH_AVILA
137 MACHINE_START(AVILA, "Gateworks Avila Network Platform")
138         MAINTAINER("Deepak Saxena <dsaxena@plexity.net>")
139         BOOT_MEM(PHYS_OFFSET, IXP4XX_PERIPHERAL_BASE_PHYS,
140                 IXP4XX_PERIPHERAL_BASE_VIRT)
141         MAPIO(ixdp425_map_io)
142         INITIRQ(ixp4xx_init_irq)
143         BOOT_PARAMS(0x0100)
144         INIT_MACHINE(ixdp425_init)
145 MACHINE_END
146 #endif
147