kvm tools, setup: Create private directory
[linux-2.6/next.git] / arch / sh / boards / mach-se / 7343 / setup.c
blobd2370af56d772a83630d6dacdc5a02f846b799ea
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_resource = {
15 .start = PA_LED,
16 .end = PA_LED,
17 .flags = IORESOURCE_MEM | IORESOURCE_MEM_16BIT,
20 static struct platform_device heartbeat_device = {
21 .name = "heartbeat",
22 .id = -1,
23 .num_resources = 1,
24 .resource = &heartbeat_resource,
27 static struct mtd_partition nor_flash_partitions[] = {
29 .name = "loader",
30 .offset = 0x00000000,
31 .size = 128 * 1024,
34 .name = "rootfs",
35 .offset = MTDPART_OFS_APPEND,
36 .size = 31 * 1024 * 1024,
39 .name = "data",
40 .offset = MTDPART_OFS_APPEND,
41 .size = MTDPART_SIZ_FULL,
45 static struct physmap_flash_data nor_flash_data = {
46 .width = 2,
47 .parts = nor_flash_partitions,
48 .nr_parts = ARRAY_SIZE(nor_flash_partitions),
51 static struct resource nor_flash_resources[] = {
52 [0] = {
53 .start = 0x00000000,
54 .end = 0x01ffffff,
55 .flags = IORESOURCE_MEM,
59 static struct platform_device nor_flash_device = {
60 .name = "physmap-flash",
61 .dev = {
62 .platform_data = &nor_flash_data,
64 .num_resources = ARRAY_SIZE(nor_flash_resources),
65 .resource = nor_flash_resources,
68 #define ST16C2550C_FLAGS (UPF_BOOT_AUTOCONF | UPF_IOREMAP)
70 static struct plat_serial8250_port serial_platform_data[] = {
71 [0] = {
72 .iotype = UPIO_MEM,
73 .mapbase = 0x16000000,
74 .regshift = 1,
75 .flags = ST16C2550C_FLAGS,
76 .uartclk = 7372800,
78 [1] = {
79 .iotype = UPIO_MEM,
80 .mapbase = 0x17000000,
81 .regshift = 1,
82 .flags = ST16C2550C_FLAGS,
83 .uartclk = 7372800,
85 { },
88 static struct platform_device uart_device = {
89 .name = "serial8250",
90 .id = PLAT8250_DEV_PLATFORM,
91 .dev = {
92 .platform_data = serial_platform_data,
96 static void isp116x_delay(struct device *dev, int delay)
98 ndelay(delay);
101 static struct resource usb_resources[] = {
102 [0] = {
103 .start = 0x11800000,
104 .end = 0x11800001,
105 .flags = IORESOURCE_MEM,
107 [1] = {
108 .start = 0x11800002,
109 .end = 0x11800003,
110 .flags = IORESOURCE_MEM,
112 [2] = {
113 /* Filled in later */
114 .flags = IORESOURCE_IRQ,
118 static struct isp116x_platform_data usb_platform_data = {
119 .sel15Kres = 1,
120 .oc_enable = 1,
121 .int_act_high = 0,
122 .int_edge_triggered = 0,
123 .remote_wakeup_enable = 0,
124 .delay = isp116x_delay,
127 static struct platform_device usb_device = {
128 .name = "isp116x-hcd",
129 .id = -1,
130 .num_resources = ARRAY_SIZE(usb_resources),
131 .resource = usb_resources,
132 .dev = {
133 .platform_data = &usb_platform_data,
138 static struct platform_device *sh7343se_platform_devices[] __initdata = {
139 &heartbeat_device,
140 &nor_flash_device,
141 &uart_device,
142 &usb_device,
145 static int __init sh7343se_devices_setup(void)
147 /* Wire-up dynamic vectors */
148 serial_platform_data[0].irq = se7343_fpga_irq[SE7343_FPGA_IRQ_UARTA];
149 serial_platform_data[1].irq = se7343_fpga_irq[SE7343_FPGA_IRQ_UARTB];
151 usb_resources[2].start = usb_resources[2].end =
152 se7343_fpga_irq[SE7343_FPGA_IRQ_USB];
154 return platform_add_devices(sh7343se_platform_devices,
155 ARRAY_SIZE(sh7343se_platform_devices));
157 device_initcall(sh7343se_devices_setup);
160 * Initialize the board
162 static void __init sh7343se_setup(char **cmdline_p)
164 __raw_writew(0xf900, FPGA_OUT); /* FPGA */
166 __raw_writew(0x0002, PORT_PECR); /* PORT E 1 = IRQ5 */
167 __raw_writew(0x0020, PORT_PSELD);
169 printk(KERN_INFO "MS7343CP01 Setup...done\n");
173 * The Machine Vector
175 static struct sh_machine_vector mv_7343se __initmv = {
176 .mv_name = "SolutionEngine 7343",
177 .mv_setup = sh7343se_setup,
178 .mv_init_irq = init_7343se_IRQ,