sh: Use clk_always_enable() on sh7343 / SE77343
[linux-2.6/kvm.git] / arch / sh / boards / se / 7343 / setup.c
blob8ae718d6c71006587445f69e07f17396cf38eb73
1 #include <linux/init.h>
2 #include <linux/platform_device.h>
3 #include <linux/mtd/physmap.h>
4 #include <asm/machvec.h>
5 #include <asm/mach/se7343.h>
6 #include <asm/heartbeat.h>
7 #include <asm/irq.h>
8 #include <asm/io.h>
10 static struct resource smc91x_resources[] = {
11 [0] = {
12 .start = 0x10000000,
13 .end = 0x1000000F,
14 .flags = IORESOURCE_MEM,
16 [1] = {
18 * shared with other devices via externel
19 * interrupt controller in FPGA...
21 .start = SMC_IRQ,
22 .end = SMC_IRQ,
23 .flags = IORESOURCE_IRQ,
27 static struct platform_device smc91x_device = {
28 .name = "smc91x",
29 .id = 0,
30 .num_resources = ARRAY_SIZE(smc91x_resources),
31 .resource = smc91x_resources,
34 static struct resource heartbeat_resources[] = {
35 [0] = {
36 .start = PA_LED,
37 .end = PA_LED,
38 .flags = IORESOURCE_MEM,
42 static struct heartbeat_data heartbeat_data = {
43 .regsize = 16,
46 static struct platform_device heartbeat_device = {
47 .name = "heartbeat",
48 .id = -1,
49 .dev = {
50 .platform_data = &heartbeat_data,
52 .num_resources = ARRAY_SIZE(heartbeat_resources),
53 .resource = heartbeat_resources,
56 static struct mtd_partition nor_flash_partitions[] = {
58 .name = "loader",
59 .offset = 0x00000000,
60 .size = 128 * 1024,
63 .name = "rootfs",
64 .offset = MTDPART_OFS_APPEND,
65 .size = 31 * 1024 * 1024,
68 .name = "data",
69 .offset = MTDPART_OFS_APPEND,
70 .size = MTDPART_SIZ_FULL,
74 static struct physmap_flash_data nor_flash_data = {
75 .width = 2,
76 .parts = nor_flash_partitions,
77 .nr_parts = ARRAY_SIZE(nor_flash_partitions),
80 static struct resource nor_flash_resources[] = {
81 [0] = {
82 .start = 0x00000000,
83 .end = 0x01ffffff,
84 .flags = IORESOURCE_MEM,
88 static struct platform_device nor_flash_device = {
89 .name = "physmap-flash",
90 .dev = {
91 .platform_data = &nor_flash_data,
93 .num_resources = ARRAY_SIZE(nor_flash_resources),
94 .resource = nor_flash_resources,
97 static struct platform_device *sh7343se_platform_devices[] __initdata = {
98 &smc91x_device,
99 &heartbeat_device,
100 &nor_flash_device,
103 static int __init sh7343se_devices_setup(void)
105 return platform_add_devices(sh7343se_platform_devices,
106 ARRAY_SIZE(sh7343se_platform_devices));
108 device_initcall(sh7343se_devices_setup);
111 * Initialize the board
113 static void __init sh7343se_setup(char **cmdline_p)
115 ctrl_outw(0xf900, FPGA_OUT); /* FPGA */
117 ctrl_outw(0x0002, PORT_PECR); /* PORT E 1 = IRQ5 */
118 ctrl_outw(0x0020, PORT_PSELD);
120 printk(KERN_INFO "MS7343CP01 Setup...done\n");
124 * The Machine Vector
126 static struct sh_machine_vector mv_7343se __initmv = {
127 .mv_name = "SolutionEngine 7343",
128 .mv_setup = sh7343se_setup,
129 .mv_nr_irqs = 108,
130 .mv_inb = sh7343se_inb,
131 .mv_inw = sh7343se_inw,
132 .mv_inl = sh7343se_inl,
133 .mv_outb = sh7343se_outb,
134 .mv_outw = sh7343se_outw,
135 .mv_outl = sh7343se_outl,
137 .mv_inb_p = sh7343se_inb_p,
138 .mv_inw_p = sh7343se_inw,
139 .mv_inl_p = sh7343se_inl,
140 .mv_outb_p = sh7343se_outb_p,
141 .mv_outw_p = sh7343se_outw,
142 .mv_outl_p = sh7343se_outl,
144 .mv_insb = sh7343se_insb,
145 .mv_insw = sh7343se_insw,
146 .mv_insl = sh7343se_insl,
147 .mv_outsb = sh7343se_outsb,
148 .mv_outsw = sh7343se_outsw,
149 .mv_outsl = sh7343se_outsl,
151 .mv_init_irq = init_7343se_IRQ,