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 <linux/irqdomain.h>
9 #include <asm/machvec.h>
10 #include <mach-se/mach/se7343.h>
11 #include <asm/heartbeat.h>
15 static struct resource heartbeat_resource
= {
18 .flags
= IORESOURCE_MEM
| IORESOURCE_MEM_16BIT
,
21 static struct platform_device heartbeat_device
= {
25 .resource
= &heartbeat_resource
,
28 static struct mtd_partition nor_flash_partitions
[] = {
36 .offset
= MTDPART_OFS_APPEND
,
37 .size
= 31 * 1024 * 1024,
41 .offset
= MTDPART_OFS_APPEND
,
42 .size
= MTDPART_SIZ_FULL
,
46 static struct physmap_flash_data nor_flash_data
= {
48 .parts
= nor_flash_partitions
,
49 .nr_parts
= ARRAY_SIZE(nor_flash_partitions
),
52 static struct resource nor_flash_resources
[] = {
56 .flags
= IORESOURCE_MEM
,
60 static struct platform_device nor_flash_device
= {
61 .name
= "physmap-flash",
63 .platform_data
= &nor_flash_data
,
65 .num_resources
= ARRAY_SIZE(nor_flash_resources
),
66 .resource
= nor_flash_resources
,
69 #define ST16C2550C_FLAGS (UPF_BOOT_AUTOCONF | UPF_IOREMAP)
71 static struct plat_serial8250_port serial_platform_data
[] = {
74 .mapbase
= 0x16000000,
76 .flags
= ST16C2550C_FLAGS
,
81 .mapbase
= 0x17000000,
83 .flags
= ST16C2550C_FLAGS
,
89 static struct platform_device uart_device
= {
91 .id
= PLAT8250_DEV_PLATFORM
,
93 .platform_data
= serial_platform_data
,
97 static void isp116x_delay(struct device
*dev
, int delay
)
102 static struct resource usb_resources
[] = {
106 .flags
= IORESOURCE_MEM
,
111 .flags
= IORESOURCE_MEM
,
114 /* Filled in later */
115 .flags
= IORESOURCE_IRQ
,
119 static struct isp116x_platform_data usb_platform_data
= {
123 .int_edge_triggered
= 0,
124 .remote_wakeup_enable
= 0,
125 .delay
= isp116x_delay
,
128 static struct platform_device usb_device
= {
129 .name
= "isp116x-hcd",
131 .num_resources
= ARRAY_SIZE(usb_resources
),
132 .resource
= usb_resources
,
134 .platform_data
= &usb_platform_data
,
139 static struct platform_device
*sh7343se_platform_devices
[] __initdata
= {
146 static int __init
sh7343se_devices_setup(void)
148 /* Wire-up dynamic vectors */
149 serial_platform_data
[0].irq
= irq_find_mapping(se7343_irq_domain
,
150 SE7343_FPGA_IRQ_UARTA
);
151 serial_platform_data
[1].irq
= irq_find_mapping(se7343_irq_domain
,
152 SE7343_FPGA_IRQ_UARTB
);
153 usb_resources
[2].start
= usb_resources
[2].end
=
154 irq_find_mapping(se7343_irq_domain
, SE7343_FPGA_IRQ_USB
);
156 return platform_add_devices(sh7343se_platform_devices
,
157 ARRAY_SIZE(sh7343se_platform_devices
));
159 device_initcall(sh7343se_devices_setup
);
162 * Initialize the board
164 static void __init
sh7343se_setup(char **cmdline_p
)
166 __raw_writew(0xf900, FPGA_OUT
); /* FPGA */
168 __raw_writew(0x0002, PORT_PECR
); /* PORT E 1 = IRQ5 */
169 __raw_writew(0x0020, PORT_PSELD
);
171 printk(KERN_INFO
"MS7343CP01 Setup...done\n");
177 static struct sh_machine_vector mv_7343se __initmv
= {
178 .mv_name
= "SolutionEngine 7343",
179 .mv_setup
= sh7343se_setup
,
180 .mv_init_irq
= init_7343se_IRQ
,