acpiphp: Execute ACPI _REG method for hotadded devices
[linux/fpc-iii.git] / arch / sh / boards / mach-se / 7343 / setup.c
blob4de56f35f41905ed07a48191b1e7d6267bd018fb
1 #include <linux/init.h>
2 #include <linux/platform_device.h>
3 #include <linux/mtd/physmap.h>
4 #include <linux/serial_8250.h>
5 #include <linux/serial_reg.h>
6 #include <linux/usb/isp116x.h>
7 #include <linux/delay.h>
8 #include <asm/machvec.h>
9 #include <mach-se/mach/se7343.h>
10 #include <asm/heartbeat.h>
11 #include <asm/irq.h>
12 #include <asm/io.h>
14 static struct resource heartbeat_resources[] = {
15 [0] = {
16 .start = PA_LED,
17 .end = PA_LED,
18 .flags = IORESOURCE_MEM,
22 static struct heartbeat_data heartbeat_data = {
23 .regsize = 16,
26 static struct platform_device heartbeat_device = {
27 .name = "heartbeat",
28 .id = -1,
29 .dev = {
30 .platform_data = &heartbeat_data,
32 .num_resources = ARRAY_SIZE(heartbeat_resources),
33 .resource = heartbeat_resources,
36 static struct mtd_partition nor_flash_partitions[] = {
38 .name = "loader",
39 .offset = 0x00000000,
40 .size = 128 * 1024,
43 .name = "rootfs",
44 .offset = MTDPART_OFS_APPEND,
45 .size = 31 * 1024 * 1024,
48 .name = "data",
49 .offset = MTDPART_OFS_APPEND,
50 .size = MTDPART_SIZ_FULL,
54 static struct physmap_flash_data nor_flash_data = {
55 .width = 2,
56 .parts = nor_flash_partitions,
57 .nr_parts = ARRAY_SIZE(nor_flash_partitions),
60 static struct resource nor_flash_resources[] = {
61 [0] = {
62 .start = 0x00000000,
63 .end = 0x01ffffff,
64 .flags = IORESOURCE_MEM,
68 static struct platform_device nor_flash_device = {
69 .name = "physmap-flash",
70 .dev = {
71 .platform_data = &nor_flash_data,
73 .num_resources = ARRAY_SIZE(nor_flash_resources),
74 .resource = nor_flash_resources,
77 #define ST16C2550C_FLAGS (UPF_BOOT_AUTOCONF | UPF_IOREMAP)
79 static struct plat_serial8250_port serial_platform_data[] = {
80 [0] = {
81 .iotype = UPIO_MEM,
82 .mapbase = 0x16000000,
83 .regshift = 1,
84 .flags = ST16C2550C_FLAGS,
85 .irq = UARTA_IRQ,
86 .uartclk = 7372800,
88 [1] = {
89 .iotype = UPIO_MEM,
90 .mapbase = 0x17000000,
91 .regshift = 1,
92 .flags = ST16C2550C_FLAGS,
93 .irq = UARTB_IRQ,
94 .uartclk = 7372800,
96 { },
99 static struct platform_device uart_device = {
100 .name = "serial8250",
101 .id = PLAT8250_DEV_PLATFORM,
102 .dev = {
103 .platform_data = serial_platform_data,
107 static void isp116x_delay(struct device *dev, int delay)
109 ndelay(delay);
112 static struct resource usb_resources[] = {
113 [0] = {
114 .start = 0x11800000,
115 .end = 0x11800001,
116 .flags = IORESOURCE_MEM,
118 [1] = {
119 .start = 0x11800002,
120 .end = 0x11800003,
121 .flags = IORESOURCE_MEM,
123 [2] = {
124 .start = USB_IRQ,
125 .flags = IORESOURCE_IRQ,
129 static struct isp116x_platform_data usb_platform_data = {
130 .sel15Kres = 1,
131 .oc_enable = 1,
132 .int_act_high = 0,
133 .int_edge_triggered = 0,
134 .remote_wakeup_enable = 0,
135 .delay = isp116x_delay,
138 static struct platform_device usb_device = {
139 .name = "isp116x-hcd",
140 .id = -1,
141 .num_resources = ARRAY_SIZE(usb_resources),
142 .resource = usb_resources,
143 .dev = {
144 .platform_data = &usb_platform_data,
149 static struct platform_device *sh7343se_platform_devices[] __initdata = {
150 &heartbeat_device,
151 &nor_flash_device,
152 &uart_device,
153 &usb_device,
156 static int __init sh7343se_devices_setup(void)
158 return platform_add_devices(sh7343se_platform_devices,
159 ARRAY_SIZE(sh7343se_platform_devices));
161 device_initcall(sh7343se_devices_setup);
164 * Initialize the board
166 static void __init sh7343se_setup(char **cmdline_p)
168 ctrl_outw(0xf900, FPGA_OUT); /* FPGA */
170 ctrl_outw(0x0002, PORT_PECR); /* PORT E 1 = IRQ5 */
171 ctrl_outw(0x0020, PORT_PSELD);
173 printk(KERN_INFO "MS7343CP01 Setup...done\n");
177 * The Machine Vector
179 static struct sh_machine_vector mv_7343se __initmv = {
180 .mv_name = "SolutionEngine 7343",
181 .mv_setup = sh7343se_setup,
182 .mv_nr_irqs = SE7343_FPGA_IRQ_BASE + SE7343_FPGA_IRQ_NR,
183 .mv_init_irq = init_7343se_IRQ,