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>
14 static struct resource heartbeat_resource
= {
17 .flags
= IORESOURCE_MEM
| IORESOURCE_MEM_16BIT
,
20 static struct platform_device heartbeat_device
= {
24 .resource
= &heartbeat_resource
,
27 static struct mtd_partition nor_flash_partitions
[] = {
35 .offset
= MTDPART_OFS_APPEND
,
36 .size
= 31 * 1024 * 1024,
40 .offset
= MTDPART_OFS_APPEND
,
41 .size
= MTDPART_SIZ_FULL
,
45 static struct physmap_flash_data nor_flash_data
= {
47 .parts
= nor_flash_partitions
,
48 .nr_parts
= ARRAY_SIZE(nor_flash_partitions
),
51 static struct resource nor_flash_resources
[] = {
55 .flags
= IORESOURCE_MEM
,
59 static struct platform_device nor_flash_device
= {
60 .name
= "physmap-flash",
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
[] = {
73 .mapbase
= 0x16000000,
75 .flags
= ST16C2550C_FLAGS
,
80 .mapbase
= 0x17000000,
82 .flags
= ST16C2550C_FLAGS
,
88 static struct platform_device uart_device
= {
90 .id
= PLAT8250_DEV_PLATFORM
,
92 .platform_data
= serial_platform_data
,
96 static void isp116x_delay(struct device
*dev
, int delay
)
101 static struct resource usb_resources
[] = {
105 .flags
= IORESOURCE_MEM
,
110 .flags
= IORESOURCE_MEM
,
113 /* Filled in later */
114 .flags
= IORESOURCE_IRQ
,
118 static struct isp116x_platform_data usb_platform_data
= {
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",
130 .num_resources
= ARRAY_SIZE(usb_resources
),
131 .resource
= usb_resources
,
133 .platform_data
= &usb_platform_data
,
138 static struct platform_device
*sh7343se_platform_devices
[] __initdata
= {
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");
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
,