acpiphp: Execute ACPI _REG method for hotadded devices
[linux/fpc-iii.git] / arch / arm / mach-ixp4xx / avila-setup.c
blob6e558a76457d154a5aa38d0c816b720b062cdc82
1 /*
2 * arch/arm/mach-ixp4xx/avila-setup.c
4 * Gateworks Avila board-setup
6 * Author: Michael-Luke Jones <mlj28@cam.ac.uk>
8 * Based on ixdp-setup.c
9 * Copyright (C) 2003-2005 MontaVista Software, Inc.
11 * Author: Deepak Saxena <dsaxena@plexity.net>
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 #include <linux/i2c-gpio.h>
22 #include <asm/types.h>
23 #include <asm/setup.h>
24 #include <asm/memory.h>
25 #include <mach/hardware.h>
26 #include <asm/mach-types.h>
27 #include <asm/irq.h>
28 #include <asm/mach/arch.h>
29 #include <asm/mach/flash.h>
31 #define AVILA_SDA_PIN 7
32 #define AVILA_SCL_PIN 6
34 static struct flash_platform_data avila_flash_data = {
35 .map_name = "cfi_probe",
36 .width = 2,
39 static struct resource avila_flash_resource = {
40 .flags = IORESOURCE_MEM,
43 static struct platform_device avila_flash = {
44 .name = "IXP4XX-Flash",
45 .id = 0,
46 .dev = {
47 .platform_data = &avila_flash_data,
49 .num_resources = 1,
50 .resource = &avila_flash_resource,
53 static struct i2c_gpio_platform_data avila_i2c_gpio_data = {
54 .sda_pin = AVILA_SDA_PIN,
55 .scl_pin = AVILA_SCL_PIN,
58 static struct platform_device avila_i2c_gpio = {
59 .name = "i2c-gpio",
60 .id = 0,
61 .dev = {
62 .platform_data = &avila_i2c_gpio_data,
66 static struct resource avila_uart_resources[] = {
68 .start = IXP4XX_UART1_BASE_PHYS,
69 .end = IXP4XX_UART1_BASE_PHYS + 0x0fff,
70 .flags = IORESOURCE_MEM
73 .start = IXP4XX_UART2_BASE_PHYS,
74 .end = IXP4XX_UART2_BASE_PHYS + 0x0fff,
75 .flags = IORESOURCE_MEM
79 static struct plat_serial8250_port avila_uart_data[] = {
81 .mapbase = IXP4XX_UART1_BASE_PHYS,
82 .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET,
83 .irq = IRQ_IXP4XX_UART1,
84 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
85 .iotype = UPIO_MEM,
86 .regshift = 2,
87 .uartclk = IXP4XX_UART_XTAL,
90 .mapbase = IXP4XX_UART2_BASE_PHYS,
91 .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET,
92 .irq = IRQ_IXP4XX_UART2,
93 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
94 .iotype = UPIO_MEM,
95 .regshift = 2,
96 .uartclk = IXP4XX_UART_XTAL,
98 { },
101 static struct platform_device avila_uart = {
102 .name = "serial8250",
103 .id = PLAT8250_DEV_PLATFORM,
104 .dev.platform_data = avila_uart_data,
105 .num_resources = 2,
106 .resource = avila_uart_resources
109 static struct resource avila_pata_resources[] = {
111 .flags = IORESOURCE_MEM
114 .flags = IORESOURCE_MEM,
117 .name = "intrq",
118 .start = IRQ_IXP4XX_GPIO12,
119 .end = IRQ_IXP4XX_GPIO12,
120 .flags = IORESOURCE_IRQ,
124 static struct ixp4xx_pata_data avila_pata_data = {
125 .cs0_bits = 0xbfff0043,
126 .cs1_bits = 0xbfff0043,
129 static struct platform_device avila_pata = {
130 .name = "pata_ixp4xx_cf",
131 .id = 0,
132 .dev.platform_data = &avila_pata_data,
133 .num_resources = ARRAY_SIZE(avila_pata_resources),
134 .resource = avila_pata_resources,
137 static struct platform_device *avila_devices[] __initdata = {
138 &avila_i2c_gpio,
139 &avila_flash,
140 &avila_uart
143 static void __init avila_init(void)
145 ixp4xx_sys_init();
147 avila_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
148 avila_flash_resource.end =
149 IXP4XX_EXP_BUS_BASE(0) + ixp4xx_exp_bus_size - 1;
151 platform_add_devices(avila_devices, ARRAY_SIZE(avila_devices));
153 avila_pata_resources[0].start = IXP4XX_EXP_BUS_BASE(1);
154 avila_pata_resources[0].end = IXP4XX_EXP_BUS_END(1);
156 avila_pata_resources[1].start = IXP4XX_EXP_BUS_BASE(2);
157 avila_pata_resources[1].end = IXP4XX_EXP_BUS_END(2);
159 avila_pata_data.cs0_cfg = IXP4XX_EXP_CS1;
160 avila_pata_data.cs1_cfg = IXP4XX_EXP_CS2;
162 platform_device_register(&avila_pata);
166 MACHINE_START(AVILA, "Gateworks Avila Network Platform")
167 /* Maintainer: Deepak Saxena <dsaxena@plexity.net> */
168 .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
169 .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
170 .map_io = ixp4xx_map_io,
171 .init_irq = ixp4xx_init_irq,
172 .timer = &ixp4xx_timer,
173 .boot_params = 0x0100,
174 .init_machine = avila_init,
175 MACHINE_END
178 * Loft is functionally equivalent to Avila except that it has a
179 * different number for the maximum PCI devices. The MACHINE
180 * structure below is identical to Avila except for the comment.
182 #ifdef CONFIG_MACH_LOFT
183 MACHINE_START(LOFT, "Giant Shoulder Inc Loft board")
184 /* Maintainer: Tom Billman <kernel@giantshoulderinc.com> */
185 .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
186 .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
187 .map_io = ixp4xx_map_io,
188 .init_irq = ixp4xx_init_irq,
189 .timer = &ixp4xx_timer,
190 .boot_params = 0x0100,
191 .init_machine = avila_init,
192 MACHINE_END
193 #endif