aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/boards/mach-se/7722/setup.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sh/boards/mach-se/7722/setup.c')
-rw-r--r--arch/sh/boards/mach-se/7722/setup.c72
1 files changed, 34 insertions, 38 deletions
diff --git a/arch/sh/boards/mach-se/7722/setup.c b/arch/sh/boards/mach-se/7722/setup.c
index 36374078e521..80a4e571b310 100644
--- a/arch/sh/boards/mach-se/7722/setup.c
+++ b/arch/sh/boards/mach-se/7722/setup.c
@@ -14,6 +14,7 @@
14#include <linux/platform_device.h> 14#include <linux/platform_device.h>
15#include <linux/ata_platform.h> 15#include <linux/ata_platform.h>
16#include <linux/input.h> 16#include <linux/input.h>
17#include <linux/input/sh_keysc.h>
17#include <linux/smc91x.h> 18#include <linux/smc91x.h>
18#include <mach-se/mach/se7722.h> 19#include <mach-se/mach/se7722.h>
19#include <mach-se/mach/mrshpc.h> 20#include <mach-se/mach/mrshpc.h>
@@ -21,30 +22,20 @@
21#include <asm/clock.h> 22#include <asm/clock.h>
22#include <asm/io.h> 23#include <asm/io.h>
23#include <asm/heartbeat.h> 24#include <asm/heartbeat.h>
24#include <asm/sh_keysc.h>
25#include <cpu/sh7722.h> 25#include <cpu/sh7722.h>
26 26
27/* Heartbeat */ 27/* Heartbeat */
28static struct heartbeat_data heartbeat_data = { 28static struct resource heartbeat_resource = {
29 .regsize = 16, 29 .start = PA_LED,
30}; 30 .end = PA_LED,
31 31 .flags = IORESOURCE_MEM | IORESOURCE_MEM_16BIT,
32static struct resource heartbeat_resources[] = {
33 [0] = {
34 .start = PA_LED,
35 .end = PA_LED,
36 .flags = IORESOURCE_MEM,
37 },
38}; 32};
39 33
40static struct platform_device heartbeat_device = { 34static struct platform_device heartbeat_device = {
41 .name = "heartbeat", 35 .name = "heartbeat",
42 .id = -1, 36 .id = -1,
43 .dev = { 37 .num_resources = 1,
44 .platform_data = &heartbeat_data, 38 .resource = &heartbeat_resource,
45 },
46 .num_resources = ARRAY_SIZE(heartbeat_resources),
47 .resource = heartbeat_resources,
48}; 39};
49 40
50/* SMC91x */ 41/* SMC91x */
@@ -60,8 +51,7 @@ static struct resource smc91x_eth_resources[] = {
60 .flags = IORESOURCE_MEM, 51 .flags = IORESOURCE_MEM,
61 }, 52 },
62 [1] = { 53 [1] = {
63 .start = SMC_IRQ, 54 /* Filled in later */
64 .end = SMC_IRQ,
65 .flags = IORESOURCE_IRQ, 55 .flags = IORESOURCE_IRQ,
66 }, 56 },
67}; 57};
@@ -90,8 +80,7 @@ static struct resource cf_ide_resources[] = {
90 .flags = IORESOURCE_IO, 80 .flags = IORESOURCE_IO,
91 }, 81 },
92 [2] = { 82 [2] = {
93 .start = MRSHPC_IRQ0, 83 /* Filled in later */
94 .end = MRSHPC_IRQ0,
95 .flags = IORESOURCE_IRQ, 84 .flags = IORESOURCE_IRQ,
96 }, 85 },
97}; 86};
@@ -153,38 +142,46 @@ static struct platform_device *se7722_devices[] __initdata = {
153static int __init se7722_devices_setup(void) 142static int __init se7722_devices_setup(void)
154{ 143{
155 mrshpc_setup_windows(); 144 mrshpc_setup_windows();
145
146 /* Wire-up dynamic vectors */
147 cf_ide_resources[2].start = cf_ide_resources[2].end =
148 se7722_fpga_irq[SE7722_FPGA_IRQ_MRSHPC0];
149
150 smc91x_eth_resources[1].start = smc91x_eth_resources[1].end =
151 se7722_fpga_irq[SE7722_FPGA_IRQ_SMC];
152
156 return platform_add_devices(se7722_devices, ARRAY_SIZE(se7722_devices)); 153 return platform_add_devices(se7722_devices, ARRAY_SIZE(se7722_devices));
157} 154}
158device_initcall(se7722_devices_setup); 155device_initcall(se7722_devices_setup);
159 156
160static void __init se7722_setup(char **cmdline_p) 157static void __init se7722_setup(char **cmdline_p)
161{ 158{
162 ctrl_outw(0x010D, FPGA_OUT); /* FPGA */ 159 __raw_writew(0x010D, FPGA_OUT); /* FPGA */
163 160
164 ctrl_outw(0x0000, PORT_PECR); /* PORT E 1 = IRQ5 ,E 0 = BS */ 161 __raw_writew(0x0000, PORT_PECR); /* PORT E 1 = IRQ5 ,E 0 = BS */
165 ctrl_outw(0x1000, PORT_PJCR); /* PORT J 1 = IRQ1,J 0 =IRQ0 */ 162 __raw_writew(0x1000, PORT_PJCR); /* PORT J 1 = IRQ1,J 0 =IRQ0 */
166 163
167 /* LCDC I/O */ 164 /* LCDC I/O */
168 ctrl_outw(0x0020, PORT_PSELD); 165 __raw_writew(0x0020, PORT_PSELD);
169 166
170 /* SIOF1*/ 167 /* SIOF1*/
171 ctrl_outw(0x0003, PORT_PSELB); 168 __raw_writew(0x0003, PORT_PSELB);
172 ctrl_outw(0xe000, PORT_PSELC); 169 __raw_writew(0xe000, PORT_PSELC);
173 ctrl_outw(0x0000, PORT_PKCR); 170 __raw_writew(0x0000, PORT_PKCR);
174 171
175 /* LCDC */ 172 /* LCDC */
176 ctrl_outw(0x4020, PORT_PHCR); 173 __raw_writew(0x4020, PORT_PHCR);
177 ctrl_outw(0x0000, PORT_PLCR); 174 __raw_writew(0x0000, PORT_PLCR);
178 ctrl_outw(0x0000, PORT_PMCR); 175 __raw_writew(0x0000, PORT_PMCR);
179 ctrl_outw(0x0002, PORT_PRCR); 176 __raw_writew(0x0002, PORT_PRCR);
180 ctrl_outw(0x0000, PORT_PXCR); /* LCDC,CS6A */ 177 __raw_writew(0x0000, PORT_PXCR); /* LCDC,CS6A */
181 178
182 /* KEYSC */ 179 /* KEYSC */
183 ctrl_outw(0x0A10, PORT_PSELA); /* BS,SHHID2 */ 180 __raw_writew(0x0A10, PORT_PSELA); /* BS,SHHID2 */
184 ctrl_outw(0x0000, PORT_PYCR); 181 __raw_writew(0x0000, PORT_PYCR);
185 ctrl_outw(0x0000, PORT_PZCR); 182 __raw_writew(0x0000, PORT_PZCR);
186 ctrl_outw(ctrl_inw(PORT_HIZCRA) & ~0x4000, PORT_HIZCRA); 183 __raw_writew(__raw_readw(PORT_HIZCRA) & ~0x4000, PORT_HIZCRA);
187 ctrl_outw(ctrl_inw(PORT_HIZCRC) & ~0xc000, PORT_HIZCRC); 184 __raw_writew(__raw_readw(PORT_HIZCRC) & ~0xc000, PORT_HIZCRC);
188} 185}
189 186
190/* 187/*
@@ -193,6 +190,5 @@ static void __init se7722_setup(char **cmdline_p)
193static struct sh_machine_vector mv_se7722 __initmv = { 190static struct sh_machine_vector mv_se7722 __initmv = {
194 .mv_name = "Solution Engine 7722" , 191 .mv_name = "Solution Engine 7722" ,
195 .mv_setup = se7722_setup , 192 .mv_setup = se7722_setup ,
196 .mv_nr_irqs = SE7722_FPGA_IRQ_BASE + SE7722_FPGA_IRQ_NR,
197 .mv_init_irq = init_se7722_IRQ, 193 .mv_init_irq = init_se7722_IRQ,
198}; 194};