aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sh')
-rw-r--r--arch/sh/Kconfig6
-rw-r--r--arch/sh/boards/superh/microdev/io.c192
-rw-r--r--arch/sh/boards/superh/microdev/irq.c2
-rw-r--r--arch/sh/boards/superh/microdev/setup.c166
-rw-r--r--arch/sh/boards/unknown/Makefile2
-rw-r--r--arch/sh/boards/unknown/io.c46
-rw-r--r--arch/sh/boards/unknown/mach.c67
-rw-r--r--arch/sh/boards/unknown/setup.c12
-rw-r--r--arch/sh/cchips/voyagergx/consistent.c15
-rw-r--r--arch/sh/cchips/voyagergx/irq.c7
-rw-r--r--arch/sh/configs/microdev_defconfig410
-rw-r--r--arch/sh/kernel/Makefile2
-rw-r--r--arch/sh/kernel/cpu/Makefile2
-rw-r--r--arch/sh/kernel/cpu/bus.c197
-rw-r--r--arch/sh/kernel/cpu/clock.c13
-rw-r--r--arch/sh/kernel/cpu/irq/ipr.c59
-rw-r--r--arch/sh/kernel/entry.S18
-rw-r--r--arch/sh/kernel/process.c54
-rw-r--r--arch/sh/kernel/setup.c51
19 files changed, 603 insertions, 718 deletions
diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig
index 01bc7d589afe..504d56f8ca7f 100644
--- a/arch/sh/Kconfig
+++ b/arch/sh/Kconfig
@@ -396,14 +396,8 @@ source "arch/sh/boards/renesas/hs7751rvoip/Kconfig"
396 396
397source "arch/sh/boards/renesas/rts7751r2d/Kconfig" 397source "arch/sh/boards/renesas/rts7751r2d/Kconfig"
398 398
399config SH_PCLK_FREQ_BOOL
400 bool "Set default pclk frequency"
401 default y if !SH_RTC
402 default n
403
404config SH_PCLK_FREQ 399config SH_PCLK_FREQ
405 int "Peripheral clock frequency (in Hz)" 400 int "Peripheral clock frequency (in Hz)"
406 depends on SH_PCLK_FREQ_BOOL
407 default "50000000" if CPU_SUBTYPE_SH7750 || CPU_SUBTYPE_SH7780 401 default "50000000" if CPU_SUBTYPE_SH7750 || CPU_SUBTYPE_SH7780
408 default "60000000" if CPU_SUBTYPE_SH7751 402 default "60000000" if CPU_SUBTYPE_SH7751
409 default "33333333" if CPU_SUBTYPE_SH7300 || CPU_SUBTYPE_SH7770 || CPU_SUBTYPE_SH7760 403 default "33333333" if CPU_SUBTYPE_SH7300 || CPU_SUBTYPE_SH7770 || CPU_SUBTYPE_SH7760
diff --git a/arch/sh/boards/superh/microdev/io.c b/arch/sh/boards/superh/microdev/io.c
index fe83b2c03076..1ed7f880b8c7 100644
--- a/arch/sh/boards/superh/microdev/io.c
+++ b/arch/sh/boards/superh/microdev/io.c
@@ -16,7 +16,7 @@
16#include <linux/pci.h> 16#include <linux/pci.h>
17#include <linux/wait.h> 17#include <linux/wait.h>
18#include <asm/io.h> 18#include <asm/io.h>
19#include <asm/mach/io.h> 19#include <asm/microdev.h>
20 20
21 /* 21 /*
22 * we need to have a 'safe' address to re-direct all I/O requests 22 * we need to have a 'safe' address to re-direct all I/O requests
@@ -52,8 +52,90 @@
52#define IO_ISP1161_PHYS 0xa7700000ul /* Physical address of Philips ISP1161x USB chip */ 52#define IO_ISP1161_PHYS 0xa7700000ul /* Physical address of Philips ISP1161x USB chip */
53#define IO_SUPERIO_PHYS 0xa7800000ul /* Physical address of SMSC FDC37C93xAPM SuperIO chip */ 53#define IO_SUPERIO_PHYS 0xa7800000ul /* Physical address of SMSC FDC37C93xAPM SuperIO chip */
54 54
55#define PORT2ADDR(x) (microdev_isa_port2addr(x)) 55/*
56 * map I/O ports to memory-mapped addresses
57 */
58static unsigned long microdev_isa_port2addr(unsigned long offset)
59{
60 unsigned long result;
61
62 if ((offset >= IO_LAN91C111_BASE) &&
63 (offset < IO_LAN91C111_BASE + IO_LAN91C111_EXTENT)) {
64 /*
65 * SMSC LAN91C111 Ethernet chip
66 */
67 result = IO_LAN91C111_PHYS + offset - IO_LAN91C111_BASE;
68 } else if ((offset >= IO_SUPERIO_BASE) &&
69 (offset < IO_SUPERIO_BASE + IO_SUPERIO_EXTENT)) {
70 /*
71 * SMSC FDC37C93xAPM SuperIO chip
72 *
73 * Configuration Registers
74 */
75 result = IO_SUPERIO_PHYS + (offset << 1);
76#if 0
77 } else if (offset == KBD_DATA_REG || offset == KBD_CNTL_REG ||
78 offset == KBD_STATUS_REG) {
79 /*
80 * SMSC FDC37C93xAPM SuperIO chip
81 *
82 * PS/2 Keyboard + Mouse (ports 0x60 and 0x64).
83 */
84 result = IO_SUPERIO_PHYS + (offset << 1);
85#endif
86 } else if (((offset >= IO_IDE1_BASE) &&
87 (offset < IO_IDE1_BASE + IO_IDE_EXTENT)) ||
88 (offset == IO_IDE1_MISC)) {
89 /*
90 * SMSC FDC37C93xAPM SuperIO chip
91 *
92 * IDE #1
93 */
94 result = IO_SUPERIO_PHYS + (offset << 1);
95 } else if (((offset >= IO_IDE2_BASE) &&
96 (offset < IO_IDE2_BASE + IO_IDE_EXTENT)) ||
97 (offset == IO_IDE2_MISC)) {
98 /*
99 * SMSC FDC37C93xAPM SuperIO chip
100 *
101 * IDE #2
102 */
103 result = IO_SUPERIO_PHYS + (offset << 1);
104 } else if ((offset >= IO_SERIAL1_BASE) &&
105 (offset < IO_SERIAL1_BASE + IO_SERIAL_EXTENT)) {
106 /*
107 * SMSC FDC37C93xAPM SuperIO chip
108 *
109 * Serial #1
110 */
111 result = IO_SUPERIO_PHYS + (offset << 1);
112 } else if ((offset >= IO_SERIAL2_BASE) &&
113 (offset < IO_SERIAL2_BASE + IO_SERIAL_EXTENT)) {
114 /*
115 * SMSC FDC37C93xAPM SuperIO chip
116 *
117 * Serial #2
118 */
119 result = IO_SUPERIO_PHYS + (offset << 1);
120 } else if ((offset >= IO_ISP1161_BASE) &&
121 (offset < IO_ISP1161_BASE + IO_ISP1161_EXTENT)) {
122 /*
123 * Philips USB ISP1161x chip
124 */
125 result = IO_ISP1161_PHYS + offset - IO_ISP1161_BASE;
126 } else {
127 /*
128 * safe default.
129 */
130 printk("Warning: unexpected port in %s( offset = 0x%lx )\n",
131 __FUNCTION__, offset);
132 result = PVR;
133 }
134
135 return result;
136}
56 137
138#define PORT2ADDR(x) (microdev_isa_port2addr(x))
57 139
58static inline void delay(void) 140static inline void delay(void)
59{ 141{
@@ -94,6 +176,17 @@ unsigned int microdev_inl(unsigned long port)
94 return *(volatile unsigned int*)PORT2ADDR(port); 176 return *(volatile unsigned int*)PORT2ADDR(port);
95} 177}
96 178
179void microdev_outw(unsigned short b, unsigned long port)
180{
181#ifdef CONFIG_PCI
182 if (port >= PCIBIOS_MIN_IO) {
183 microdev_pci_outw(b, port);
184 return;
185 }
186#endif
187 *(volatile unsigned short*)PORT2ADDR(port) = b;
188}
189
97void microdev_outb(unsigned char b, unsigned long port) 190void microdev_outb(unsigned char b, unsigned long port)
98{ 191{
99#ifdef CONFIG_PCI 192#ifdef CONFIG_PCI
@@ -158,17 +251,6 @@ void microdev_outb(unsigned char b, unsigned long port)
158 } 251 }
159} 252}
160 253
161void microdev_outw(unsigned short b, unsigned long port)
162{
163#ifdef CONFIG_PCI
164 if (port >= PCIBIOS_MIN_IO) {
165 microdev_pci_outw(b, port);
166 return;
167 }
168#endif
169 *(volatile unsigned short*)PORT2ADDR(port) = b;
170}
171
172void microdev_outl(unsigned int b, unsigned long port) 254void microdev_outl(unsigned int b, unsigned long port)
173{ 255{
174#ifdef CONFIG_PCI 256#ifdef CONFIG_PCI
@@ -284,87 +366,3 @@ void microdev_outsl(unsigned long port, const void *buffer, unsigned long count)
284 while (count--) 366 while (count--)
285 *port_addr = *buf++; 367 *port_addr = *buf++;
286} 368}
287
288/*
289 * map I/O ports to memory-mapped addresses
290 */
291unsigned long microdev_isa_port2addr(unsigned long offset)
292{
293 unsigned long result;
294
295 if ((offset >= IO_LAN91C111_BASE) &&
296 (offset < IO_LAN91C111_BASE + IO_LAN91C111_EXTENT)) {
297 /*
298 * SMSC LAN91C111 Ethernet chip
299 */
300 result = IO_LAN91C111_PHYS + offset - IO_LAN91C111_BASE;
301 } else if ((offset >= IO_SUPERIO_BASE) &&
302 (offset < IO_SUPERIO_BASE + IO_SUPERIO_EXTENT)) {
303 /*
304 * SMSC FDC37C93xAPM SuperIO chip
305 *
306 * Configuration Registers
307 */
308 result = IO_SUPERIO_PHYS + (offset << 1);
309#if 0
310 } else if (offset == KBD_DATA_REG || offset == KBD_CNTL_REG ||
311 offset == KBD_STATUS_REG) {
312 /*
313 * SMSC FDC37C93xAPM SuperIO chip
314 *
315 * PS/2 Keyboard + Mouse (ports 0x60 and 0x64).
316 */
317 result = IO_SUPERIO_PHYS + (offset << 1);
318#endif
319 } else if (((offset >= IO_IDE1_BASE) &&
320 (offset < IO_IDE1_BASE + IO_IDE_EXTENT)) ||
321 (offset == IO_IDE1_MISC)) {
322 /*
323 * SMSC FDC37C93xAPM SuperIO chip
324 *
325 * IDE #1
326 */
327 result = IO_SUPERIO_PHYS + (offset << 1);
328 } else if (((offset >= IO_IDE2_BASE) &&
329 (offset < IO_IDE2_BASE + IO_IDE_EXTENT)) ||
330 (offset == IO_IDE2_MISC)) {
331 /*
332 * SMSC FDC37C93xAPM SuperIO chip
333 *
334 * IDE #2
335 */
336 result = IO_SUPERIO_PHYS + (offset << 1);
337 } else if ((offset >= IO_SERIAL1_BASE) &&
338 (offset < IO_SERIAL1_BASE + IO_SERIAL_EXTENT)) {
339 /*
340 * SMSC FDC37C93xAPM SuperIO chip
341 *
342 * Serial #1
343 */
344 result = IO_SUPERIO_PHYS + (offset << 1);
345 } else if ((offset >= IO_SERIAL2_BASE) &&
346 (offset < IO_SERIAL2_BASE + IO_SERIAL_EXTENT)) {
347 /*
348 * SMSC FDC37C93xAPM SuperIO chip
349 *
350 * Serial #2
351 */
352 result = IO_SUPERIO_PHYS + (offset << 1);
353 } else if ((offset >= IO_ISP1161_BASE) &&
354 (offset < IO_ISP1161_BASE + IO_ISP1161_EXTENT)) {
355 /*
356 * Philips USB ISP1161x chip
357 */
358 result = IO_ISP1161_PHYS + offset - IO_ISP1161_BASE;
359 } else {
360 /*
361 * safe default.
362 */
363 printk("Warning: unexpected port in %s( offset = 0x%lx )\n",
364 __FUNCTION__, offset);
365 result = PVR;
366 }
367
368 return result;
369}
370
diff --git a/arch/sh/boards/superh/microdev/irq.c b/arch/sh/boards/superh/microdev/irq.c
index 1395c1e65da4..efcbd86b7cd2 100644
--- a/arch/sh/boards/superh/microdev/irq.c
+++ b/arch/sh/boards/superh/microdev/irq.c
@@ -15,7 +15,7 @@
15 15
16#include <asm/system.h> 16#include <asm/system.h>
17#include <asm/io.h> 17#include <asm/io.h>
18#include <asm/mach/irq.h> 18#include <asm/microdev.h>
19 19
20#define NUM_EXTERNAL_IRQS 16 /* IRL0 .. IRL15 */ 20#define NUM_EXTERNAL_IRQS 16 /* IRL0 .. IRL15 */
21 21
diff --git a/arch/sh/boards/superh/microdev/setup.c b/arch/sh/boards/superh/microdev/setup.c
index 1c1d65fb12df..892b14d31405 100644
--- a/arch/sh/boards/superh/microdev/setup.c
+++ b/arch/sh/boards/superh/microdev/setup.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Copyright (C) 2003 Sean McGoogan (Sean.McGoogan@superh.com) 4 * Copyright (C) 2003 Sean McGoogan (Sean.McGoogan@superh.com)
5 * Copyright (C) 2003, 2004 SuperH, Inc. 5 * Copyright (C) 2003, 2004 SuperH, Inc.
6 * Copyright (C) 2004 Paul Mundt 6 * Copyright (C) 2004, 2005 Paul Mundt
7 * 7 *
8 * SuperH SH4-202 MicroDev board support. 8 * SuperH SH4-202 MicroDev board support.
9 * 9 *
@@ -15,11 +15,10 @@
15#include <linux/init.h> 15#include <linux/init.h>
16#include <linux/platform_device.h> 16#include <linux/platform_device.h>
17#include <linux/ioport.h> 17#include <linux/ioport.h>
18#include <video/s1d13xxxfb.h>
19#include <asm/microdev.h>
18#include <asm/io.h> 20#include <asm/io.h>
19#include <asm/mach/irq.h>
20#include <asm/mach/io.h>
21#include <asm/machvec.h> 21#include <asm/machvec.h>
22#include <asm/machvec_init.h>
23 22
24extern void microdev_heartbeat(void); 23extern void microdev_heartbeat(void);
25 24
@@ -51,8 +50,6 @@ struct sh_machine_vector mv_sh4202_microdev __initmv = {
51 .mv_outsw = microdev_outsw, 50 .mv_outsw = microdev_outsw,
52 .mv_outsl = microdev_outsl, 51 .mv_outsl = microdev_outsl,
53 52
54 .mv_isa_port2addr = microdev_isa_port2addr,
55
56 .mv_init_irq = init_microdev_irq, 53 .mv_init_irq = init_microdev_irq,
57 54
58#ifdef CONFIG_HEARTBEAT 55#ifdef CONFIG_HEARTBEAT
@@ -142,16 +139,161 @@ static struct platform_device smc91x_device = {
142 .resource = smc91x_resources, 139 .resource = smc91x_resources,
143}; 140};
144 141
145static int __init smc91x_setup(void) 142#ifdef CONFIG_FB_S1D13XXX
143static struct s1d13xxxfb_regval s1d13806_initregs[] = {
144 { S1DREG_MISC, 0x00 },
145 { S1DREG_COM_DISP_MODE, 0x00 },
146 { S1DREG_GPIO_CNF0, 0x00 },
147 { S1DREG_GPIO_CNF1, 0x00 },
148 { S1DREG_GPIO_CTL0, 0x00 },
149 { S1DREG_GPIO_CTL1, 0x00 },
150 { S1DREG_CLK_CNF, 0x02 },
151 { S1DREG_LCD_CLK_CNF, 0x01 },
152 { S1DREG_CRT_CLK_CNF, 0x03 },
153 { S1DREG_MPLUG_CLK_CNF, 0x03 },
154 { S1DREG_CPU2MEM_WST_SEL, 0x02 },
155 { S1DREG_SDRAM_REF_RATE, 0x03 },
156 { S1DREG_SDRAM_TC0, 0x00 },
157 { S1DREG_SDRAM_TC1, 0x01 },
158 { S1DREG_MEM_CNF, 0x80 },
159 { S1DREG_PANEL_TYPE, 0x25 },
160 { S1DREG_MOD_RATE, 0x00 },
161 { S1DREG_LCD_DISP_HWIDTH, 0x63 },
162 { S1DREG_LCD_NDISP_HPER, 0x1e },
163 { S1DREG_TFT_FPLINE_START, 0x06 },
164 { S1DREG_TFT_FPLINE_PWIDTH, 0x03 },
165 { S1DREG_LCD_DISP_VHEIGHT0, 0x57 },
166 { S1DREG_LCD_DISP_VHEIGHT1, 0x02 },
167 { S1DREG_LCD_NDISP_VPER, 0x00 },
168 { S1DREG_TFT_FPFRAME_START, 0x0a },
169 { S1DREG_TFT_FPFRAME_PWIDTH, 0x81 },
170 { S1DREG_LCD_DISP_MODE, 0x03 },
171 { S1DREG_LCD_MISC, 0x00 },
172 { S1DREG_LCD_DISP_START0, 0x00 },
173 { S1DREG_LCD_DISP_START1, 0x00 },
174 { S1DREG_LCD_DISP_START2, 0x00 },
175 { S1DREG_LCD_MEM_OFF0, 0x90 },
176 { S1DREG_LCD_MEM_OFF1, 0x01 },
177 { S1DREG_LCD_PIX_PAN, 0x00 },
178 { S1DREG_LCD_DISP_FIFO_HTC, 0x00 },
179 { S1DREG_LCD_DISP_FIFO_LTC, 0x00 },
180 { S1DREG_CRT_DISP_HWIDTH, 0x63 },
181 { S1DREG_CRT_NDISP_HPER, 0x1f },
182 { S1DREG_CRT_HRTC_START, 0x04 },
183 { S1DREG_CRT_HRTC_PWIDTH, 0x8f },
184 { S1DREG_CRT_DISP_VHEIGHT0, 0x57 },
185 { S1DREG_CRT_DISP_VHEIGHT1, 0x02 },
186 { S1DREG_CRT_NDISP_VPER, 0x1b },
187 { S1DREG_CRT_VRTC_START, 0x00 },
188 { S1DREG_CRT_VRTC_PWIDTH, 0x83 },
189 { S1DREG_TV_OUT_CTL, 0x10 },
190 { S1DREG_CRT_DISP_MODE, 0x05 },
191 { S1DREG_CRT_DISP_START0, 0x00 },
192 { S1DREG_CRT_DISP_START1, 0x00 },
193 { S1DREG_CRT_DISP_START2, 0x00 },
194 { S1DREG_CRT_MEM_OFF0, 0x20 },
195 { S1DREG_CRT_MEM_OFF1, 0x03 },
196 { S1DREG_CRT_PIX_PAN, 0x00 },
197 { S1DREG_CRT_DISP_FIFO_HTC, 0x00 },
198 { S1DREG_CRT_DISP_FIFO_LTC, 0x00 },
199 { S1DREG_LCD_CUR_CTL, 0x00 },
200 { S1DREG_LCD_CUR_START, 0x01 },
201 { S1DREG_LCD_CUR_XPOS0, 0x00 },
202 { S1DREG_LCD_CUR_XPOS1, 0x00 },
203 { S1DREG_LCD_CUR_YPOS0, 0x00 },
204 { S1DREG_LCD_CUR_YPOS1, 0x00 },
205 { S1DREG_LCD_CUR_BCTL0, 0x00 },
206 { S1DREG_LCD_CUR_GCTL0, 0x00 },
207 { S1DREG_LCD_CUR_RCTL0, 0x00 },
208 { S1DREG_LCD_CUR_BCTL1, 0x1f },
209 { S1DREG_LCD_CUR_GCTL1, 0x3f },
210 { S1DREG_LCD_CUR_RCTL1, 0x1f },
211 { S1DREG_LCD_CUR_FIFO_HTC, 0x00 },
212 { S1DREG_CRT_CUR_CTL, 0x00 },
213 { S1DREG_CRT_CUR_START, 0x01 },
214 { S1DREG_CRT_CUR_XPOS0, 0x00 },
215 { S1DREG_CRT_CUR_XPOS1, 0x00 },
216 { S1DREG_CRT_CUR_YPOS0, 0x00 },
217 { S1DREG_CRT_CUR_YPOS1, 0x00 },
218 { S1DREG_CRT_CUR_BCTL0, 0x00 },
219 { S1DREG_CRT_CUR_GCTL0, 0x00 },
220 { S1DREG_CRT_CUR_RCTL0, 0x00 },
221 { S1DREG_CRT_CUR_BCTL1, 0x1f },
222 { S1DREG_CRT_CUR_GCTL1, 0x3f },
223 { S1DREG_CRT_CUR_RCTL1, 0x1f },
224 { S1DREG_CRT_CUR_FIFO_HTC, 0x00 },
225 { S1DREG_BBLT_CTL0, 0x00 },
226 { S1DREG_BBLT_CTL1, 0x00 },
227 { S1DREG_BBLT_CC_EXP, 0x00 },
228 { S1DREG_BBLT_OP, 0x00 },
229 { S1DREG_BBLT_SRC_START0, 0x00 },
230 { S1DREG_BBLT_SRC_START1, 0x00 },
231 { S1DREG_BBLT_SRC_START2, 0x00 },
232 { S1DREG_BBLT_DST_START0, 0x00 },
233 { S1DREG_BBLT_DST_START1, 0x00 },
234 { S1DREG_BBLT_DST_START2, 0x00 },
235 { S1DREG_BBLT_MEM_OFF0, 0x00 },
236 { S1DREG_BBLT_MEM_OFF1, 0x00 },
237 { S1DREG_BBLT_WIDTH0, 0x00 },
238 { S1DREG_BBLT_WIDTH1, 0x00 },
239 { S1DREG_BBLT_HEIGHT0, 0x00 },
240 { S1DREG_BBLT_HEIGHT1, 0x00 },
241 { S1DREG_BBLT_BGC0, 0x00 },
242 { S1DREG_BBLT_BGC1, 0x00 },
243 { S1DREG_BBLT_FGC0, 0x00 },
244 { S1DREG_BBLT_FGC1, 0x00 },
245 { S1DREG_LKUP_MODE, 0x00 },
246 { S1DREG_LKUP_ADDR, 0x00 },
247 { S1DREG_PS_CNF, 0x10 },
248 { S1DREG_PS_STATUS, 0x00 },
249 { S1DREG_CPU2MEM_WDOGT, 0x00 },
250 { S1DREG_COM_DISP_MODE, 0x02 },
251};
252
253static struct s1d13xxxfb_pdata s1d13806_platform_data = {
254 .initregs = s1d13806_initregs,
255 .initregssize = ARRAY_SIZE(s1d13806_initregs),
256};
257
258static struct resource s1d13806_resources[] = {
259 [0] = {
260 .start = 0x07200000,
261 .end = 0x07200000 + 0x00200000 - 1,
262 .flags = IORESOURCE_MEM,
263 },
264 [1] = {
265 .start = 0x07000000,
266 .end = 0x07000000 + 0x00200000 - 1,
267 .flags = IORESOURCE_MEM,
268 },
269};
270
271static struct platform_device s1d13806_device = {
272 .name = "s1d13806fb",
273 .id = -1,
274 .num_resources = ARRAY_SIZE(s1d13806_resources),
275 .resource = s1d13806_resources,
276
277 .dev = {
278 .platform_data = &s1d13806_platform_data,
279 },
280};
281#endif
282
283static struct platform_device *microdev_devices[] __initdata = {
284 &smc91x_device,
285#ifdef CONFIG_FB_S1D13XXX
286 &s1d13806_device,
287#endif
288};
289
290static int __init microdev_devices_setup(void)
146{ 291{
147 return platform_device_register(&smc91x_device); 292 return platform_add_devices(microdev_devices, ARRAY_SIZE(microdev_devices));
148} 293}
149 294
150__initcall(smc91x_setup); 295__initcall(microdev_devices_setup);
151 296
152 /*
153 * Initialize the board
154 */
155void __init platform_setup(void) 297void __init platform_setup(void)
156{ 298{
157 int * const fpgaRevisionRegister = (int*)(MICRODEV_FPGA_GP_BASE + 0x8ul); 299 int * const fpgaRevisionRegister = (int*)(MICRODEV_FPGA_GP_BASE + 0x8ul);
diff --git a/arch/sh/boards/unknown/Makefile b/arch/sh/boards/unknown/Makefile
index cffc21031e71..7d18f408b0c5 100644
--- a/arch/sh/boards/unknown/Makefile
+++ b/arch/sh/boards/unknown/Makefile
@@ -2,5 +2,5 @@
2# Makefile for unknown SH boards 2# Makefile for unknown SH boards
3# 3#
4 4
5obj-y := mach.o io.o setup.o 5obj-y := setup.o
6 6
diff --git a/arch/sh/boards/unknown/io.c b/arch/sh/boards/unknown/io.c
deleted file mode 100644
index 8f3f17267bd9..000000000000
--- a/arch/sh/boards/unknown/io.c
+++ /dev/null
@@ -1,46 +0,0 @@
1/*
2 * linux/arch/sh/kernel/io_unknown.c
3 *
4 * Copyright (C) 2000 Stuart Menefy (stuart.menefy@st.com)
5 *
6 * May be copied or modified under the terms of the GNU General Public
7 * License. See linux/COPYING for more information.
8 *
9 * I/O routine for unknown hardware.
10 */
11
12static unsigned int unknown_handler(void)
13{
14 return 0;
15}
16
17#define UNKNOWN_ALIAS(fn) \
18 void unknown_##fn(void) __attribute__ ((alias ("unknown_handler")));
19
20UNKNOWN_ALIAS(inb)
21UNKNOWN_ALIAS(inw)
22UNKNOWN_ALIAS(inl)
23UNKNOWN_ALIAS(outb)
24UNKNOWN_ALIAS(outw)
25UNKNOWN_ALIAS(outl)
26UNKNOWN_ALIAS(inb_p)
27UNKNOWN_ALIAS(inw_p)
28UNKNOWN_ALIAS(inl_p)
29UNKNOWN_ALIAS(outb_p)
30UNKNOWN_ALIAS(outw_p)
31UNKNOWN_ALIAS(outl_p)
32UNKNOWN_ALIAS(insb)
33UNKNOWN_ALIAS(insw)
34UNKNOWN_ALIAS(insl)
35UNKNOWN_ALIAS(outsb)
36UNKNOWN_ALIAS(outsw)
37UNKNOWN_ALIAS(outsl)
38UNKNOWN_ALIAS(readb)
39UNKNOWN_ALIAS(readw)
40UNKNOWN_ALIAS(readl)
41UNKNOWN_ALIAS(writeb)
42UNKNOWN_ALIAS(writew)
43UNKNOWN_ALIAS(writel)
44UNKNOWN_ALIAS(isa_port2addr)
45UNKNOWN_ALIAS(ioremap)
46UNKNOWN_ALIAS(iounmap)
diff --git a/arch/sh/boards/unknown/mach.c b/arch/sh/boards/unknown/mach.c
deleted file mode 100644
index ad0bcc60a640..000000000000
--- a/arch/sh/boards/unknown/mach.c
+++ /dev/null
@@ -1,67 +0,0 @@
1/*
2 * linux/arch/sh/kernel/mach_unknown.c
3 *
4 * Copyright (C) 2000 Stuart Menefy (stuart.menefy@st.com)
5 *
6 * May be copied or modified under the terms of the GNU General Public
7 * License. See linux/COPYING for more information.
8 *
9 * Machine specific code for an unknown machine (internal peripherials only)
10 */
11
12#include <linux/config.h>
13#include <linux/init.h>
14
15#include <asm/machvec.h>
16#include <asm/machvec_init.h>
17
18#include <asm/io_unknown.h>
19
20#include <asm/rtc.h>
21/*
22 * The Machine Vector
23 */
24
25struct sh_machine_vector mv_unknown __initmv = {
26#if defined(CONFIG_CPU_SH4)
27 .mv_nr_irqs = 48,
28#elif defined(CONFIG_CPU_SUBTYPE_SH7708)
29 .mv_nr_irqs = 32,
30#elif defined(CONFIG_CPU_SUBTYPE_SH7709)
31 .mv_nr_irqs = 61,
32#endif
33
34 .mv_inb = unknown_inb,
35 .mv_inw = unknown_inw,
36 .mv_inl = unknown_inl,
37 .mv_outb = unknown_outb,
38 .mv_outw = unknown_outw,
39 .mv_outl = unknown_outl,
40
41 .mv_inb_p = unknown_inb_p,
42 .mv_inw_p = unknown_inw_p,
43 .mv_inl_p = unknown_inl_p,
44 .mv_outb_p = unknown_outb_p,
45 .mv_outw_p = unknown_outw_p,
46 .mv_outl_p = unknown_outl_p,
47
48 .mv_insb = unknown_insb,
49 .mv_insw = unknown_insw,
50 .mv_insl = unknown_insl,
51 .mv_outsb = unknown_outsb,
52 .mv_outsw = unknown_outsw,
53 .mv_outsl = unknown_outsl,
54
55 .mv_readb = unknown_readb,
56 .mv_readw = unknown_readw,
57 .mv_readl = unknown_readl,
58 .mv_writeb = unknown_writeb,
59 .mv_writew = unknown_writew,
60 .mv_writel = unknown_writel,
61
62 .mv_ioremap = unknown_ioremap,
63 .mv_iounmap = unknown_iounmap,
64
65 .mv_isa_port2addr = unknown_isa_port2addr,
66};
67ALIAS_MV(unknown)
diff --git a/arch/sh/boards/unknown/setup.c b/arch/sh/boards/unknown/setup.c
index 7d772a6f8865..02e84f03f45c 100644
--- a/arch/sh/boards/unknown/setup.c
+++ b/arch/sh/boards/unknown/setup.c
@@ -7,10 +7,20 @@
7 * License. See linux/COPYING for more information. 7 * License. See linux/COPYING for more information.
8 * 8 *
9 * Setup code for an unknown machine (internal peripherials only) 9 * Setup code for an unknown machine (internal peripherials only)
10 *
11 * This is the simplest of all boards, and serves only as a quick and dirty
12 * method to start debugging a new board during bring-up until proper board
13 * setup code is written.
10 */ 14 */
11
12#include <linux/config.h> 15#include <linux/config.h>
13#include <linux/init.h> 16#include <linux/init.h>
17#include <asm/machvec.h>
18#include <asm/irq.h>
19
20struct sh_machine_vector mv_unknown __initmv = {
21 .mv_nr_irqs = NR_IRQS,
22};
23ALIAS_MV(unknown)
14 24
15const char *get_system_type(void) 25const char *get_system_type(void)
16{ 26{
diff --git a/arch/sh/cchips/voyagergx/consistent.c b/arch/sh/cchips/voyagergx/consistent.c
index 3d9a02c093a3..07e8b9c5a531 100644
--- a/arch/sh/cchips/voyagergx/consistent.c
+++ b/arch/sh/cchips/voyagergx/consistent.c
@@ -15,7 +15,7 @@
15#include <linux/module.h> 15#include <linux/module.h>
16#include <linux/device.h> 16#include <linux/device.h>
17#include <asm/io.h> 17#include <asm/io.h>
18#include <asm/bus-sh.h> 18
19 19
20struct voya_alloc_entry { 20struct voya_alloc_entry {
21 struct list_head list; 21 struct list_head list;
@@ -30,12 +30,13 @@ static LIST_HEAD(voya_alloc_list);
30#define OHCI_HCCA_SIZE 0x100 30#define OHCI_HCCA_SIZE 0x100
31#define OHCI_SRAM_SIZE 0x10000 31#define OHCI_SRAM_SIZE 0x10000
32 32
33#define VOYAGER_OHCI_NAME "voyager-ohci"
34
33void *voyagergx_consistent_alloc(struct device *dev, size_t size, 35void *voyagergx_consistent_alloc(struct device *dev, size_t size,
34 dma_addr_t *handle, gfp_t flag) 36 dma_addr_t *handle, gfp_t flag)
35{ 37{
36 struct list_head *list = &voya_alloc_list; 38 struct list_head *list = &voya_alloc_list;
37 struct voya_alloc_entry *entry; 39 struct voya_alloc_entry *entry;
38 struct sh_dev *shdev = to_sh_dev(dev);
39 unsigned long start, end; 40 unsigned long start, end;
40 unsigned long flags; 41 unsigned long flags;
41 42
@@ -46,9 +47,7 @@ void *voyagergx_consistent_alloc(struct device *dev, size_t size,
46 * 47 *
47 * Everything else goes through consistent_alloc(). 48 * Everything else goes through consistent_alloc().
48 */ 49 */
49 if (!dev || dev->bus != &sh_bus_types[SH_BUS_VIRT] || 50 if (!dev || strcmp(dev->driver->name, VOYAGER_OHCI_NAME))
50 (dev->bus == &sh_bus_types[SH_BUS_VIRT] &&
51 shdev->dev_id != SH_DEV_ID_USB_OHCI))
52 return NULL; 51 return NULL;
53 52
54 start = OHCI_SRAM_START + OHCI_HCCA_SIZE; 53 start = OHCI_SRAM_START + OHCI_HCCA_SIZE;
@@ -98,12 +97,9 @@ int voyagergx_consistent_free(struct device *dev, size_t size,
98 void *vaddr, dma_addr_t handle) 97 void *vaddr, dma_addr_t handle)
99{ 98{
100 struct voya_alloc_entry *entry; 99 struct voya_alloc_entry *entry;
101 struct sh_dev *shdev = to_sh_dev(dev);
102 unsigned long flags; 100 unsigned long flags;
103 101
104 if (!dev || dev->bus != &sh_bus_types[SH_BUS_VIRT] || 102 if (!dev || strcmp(dev->driver->name, VOYAGER_OHCI_NAME))
105 (dev->bus == &sh_bus_types[SH_BUS_VIRT] &&
106 shdev->dev_id != SH_DEV_ID_USB_OHCI))
107 return -EINVAL; 103 return -EINVAL;
108 104
109 spin_lock_irqsave(&voya_list_lock, flags); 105 spin_lock_irqsave(&voya_list_lock, flags);
@@ -123,4 +119,3 @@ int voyagergx_consistent_free(struct device *dev, size_t size,
123 119
124EXPORT_SYMBOL(voyagergx_consistent_alloc); 120EXPORT_SYMBOL(voyagergx_consistent_alloc);
125EXPORT_SYMBOL(voyagergx_consistent_free); 121EXPORT_SYMBOL(voyagergx_consistent_free);
126
diff --git a/arch/sh/cchips/voyagergx/irq.c b/arch/sh/cchips/voyagergx/irq.c
index 1b6ac523b458..2ee330b3c38f 100644
--- a/arch/sh/cchips/voyagergx/irq.c
+++ b/arch/sh/cchips/voyagergx/irq.c
@@ -163,7 +163,12 @@ int voyagergx_irq_demux(int irq)
163 return irq; 163 return irq;
164} 164}
165 165
166static struct irqaction irq0 = { voyagergx_interrupt, SA_INTERRUPT, 0, "VOYAGERGX", NULL, NULL}; 166static struct irqaction irq0 = {
167 .name = "voyagergx",
168 .handler = voyagergx_interrupt,
169 .flags = SA_INTERRUPT,
170 .mask = CPU_MASK_NONE,
171};
167 172
168void __init setup_voyagergx_irq(void) 173void __init setup_voyagergx_irq(void)
169{ 174{
diff --git a/arch/sh/configs/microdev_defconfig b/arch/sh/configs/microdev_defconfig
index a3bd280b53d6..ab3db76d1e51 100644
--- a/arch/sh/configs/microdev_defconfig
+++ b/arch/sh/configs/microdev_defconfig
@@ -1,10 +1,9 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.11-sh 3# Linux kernel version: 2.6.16-rc1
4# Wed Mar 2 15:09:41 2005 4# Fri Jan 27 19:43:20 2006
5# 5#
6CONFIG_SUPERH=y 6CONFIG_SUPERH=y
7CONFIG_UID16=y
8CONFIG_RWSEM_GENERIC_SPINLOCK=y 7CONFIG_RWSEM_GENERIC_SPINLOCK=y
9CONFIG_GENERIC_HARDIRQS=y 8CONFIG_GENERIC_HARDIRQS=y
10CONFIG_GENERIC_IRQ_PROBE=y 9CONFIG_GENERIC_IRQ_PROBE=y
@@ -17,11 +16,13 @@ CONFIG_EXPERIMENTAL=y
17CONFIG_CLEAN_COMPILE=y 16CONFIG_CLEAN_COMPILE=y
18CONFIG_BROKEN_ON_SMP=y 17CONFIG_BROKEN_ON_SMP=y
19CONFIG_LOCK_KERNEL=y 18CONFIG_LOCK_KERNEL=y
19CONFIG_INIT_ENV_ARG_LIMIT=32
20 20
21# 21#
22# General setup 22# General setup
23# 23#
24CONFIG_LOCALVERSION="" 24CONFIG_LOCALVERSION=""
25CONFIG_LOCALVERSION_AUTO=y
25CONFIG_SWAP=y 26CONFIG_SWAP=y
26# CONFIG_SYSVIPC is not set 27# CONFIG_SYSVIPC is not set
27# CONFIG_POSIX_MQUEUE is not set 28# CONFIG_POSIX_MQUEUE is not set
@@ -29,22 +30,29 @@ CONFIG_BSD_PROCESS_ACCT=y
29# CONFIG_BSD_PROCESS_ACCT_V3 is not set 30# CONFIG_BSD_PROCESS_ACCT_V3 is not set
30CONFIG_SYSCTL=y 31CONFIG_SYSCTL=y
31# CONFIG_AUDIT is not set 32# CONFIG_AUDIT is not set
32CONFIG_LOG_BUF_SHIFT=14
33CONFIG_HOTPLUG=y
34CONFIG_KOBJECT_UEVENT=y
35# CONFIG_IKCONFIG is not set 33# CONFIG_IKCONFIG is not set
34CONFIG_INITRAMFS_SOURCE=""
35CONFIG_UID16=y
36# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
36CONFIG_EMBEDDED=y 37CONFIG_EMBEDDED=y
37CONFIG_KALLSYMS=y 38CONFIG_KALLSYMS=y
38# CONFIG_KALLSYMS_EXTRA_PASS is not set 39# CONFIG_KALLSYMS_EXTRA_PASS is not set
40CONFIG_HOTPLUG=y
41CONFIG_PRINTK=y
42CONFIG_BUG=y
43CONFIG_ELF_CORE=y
44CONFIG_BASE_FULL=y
39CONFIG_FUTEX=y 45CONFIG_FUTEX=y
40CONFIG_EPOLL=y 46CONFIG_EPOLL=y
41# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
42CONFIG_SHMEM=y 47CONFIG_SHMEM=y
43CONFIG_CC_ALIGN_FUNCTIONS=0 48CONFIG_CC_ALIGN_FUNCTIONS=0
44CONFIG_CC_ALIGN_LABELS=0 49CONFIG_CC_ALIGN_LABELS=0
45CONFIG_CC_ALIGN_LOOPS=0 50CONFIG_CC_ALIGN_LOOPS=0
46CONFIG_CC_ALIGN_JUMPS=0 51CONFIG_CC_ALIGN_JUMPS=0
52CONFIG_SLAB=y
47# CONFIG_TINY_SHMEM is not set 53# CONFIG_TINY_SHMEM is not set
54CONFIG_BASE_SMALL=0
55# CONFIG_SLOB is not set
48 56
49# 57#
50# Loadable module support 58# Loadable module support
@@ -52,6 +60,24 @@ CONFIG_CC_ALIGN_JUMPS=0
52# CONFIG_MODULES is not set 60# CONFIG_MODULES is not set
53 61
54# 62#
63# Block layer
64#
65# CONFIG_LBD is not set
66
67#
68# IO Schedulers
69#
70CONFIG_IOSCHED_NOOP=y
71CONFIG_IOSCHED_AS=y
72CONFIG_IOSCHED_DEADLINE=y
73CONFIG_IOSCHED_CFQ=y
74CONFIG_DEFAULT_AS=y
75# CONFIG_DEFAULT_DEADLINE is not set
76# CONFIG_DEFAULT_CFQ is not set
77# CONFIG_DEFAULT_NOOP is not set
78CONFIG_DEFAULT_IOSCHED="anticipatory"
79
80#
55# System type 81# System type
56# 82#
57# CONFIG_SH_SOLUTION_ENGINE is not set 83# CONFIG_SH_SOLUTION_ENGINE is not set
@@ -61,9 +87,7 @@ CONFIG_CC_ALIGN_JUMPS=0
61# CONFIG_SH_7751_SYSTEMH is not set 87# CONFIG_SH_7751_SYSTEMH is not set
62# CONFIG_SH_STB1_HARP is not set 88# CONFIG_SH_STB1_HARP is not set
63# CONFIG_SH_STB1_OVERDRIVE is not set 89# CONFIG_SH_STB1_OVERDRIVE is not set
64# CONFIG_SH_HP620 is not set 90# CONFIG_SH_HP6XX is not set
65# CONFIG_SH_HP680 is not set
66# CONFIG_SH_HP690 is not set
67# CONFIG_SH_CQREEK is not set 91# CONFIG_SH_CQREEK is not set
68# CONFIG_SH_DMIDA is not set 92# CONFIG_SH_DMIDA is not set
69# CONFIG_SH_EC3104 is not set 93# CONFIG_SH_EC3104 is not set
@@ -78,45 +102,94 @@ CONFIG_CC_ALIGN_JUMPS=0
78# CONFIG_SH_SECUREEDGE5410 is not set 102# CONFIG_SH_SECUREEDGE5410 is not set
79# CONFIG_SH_HS7751RVOIP is not set 103# CONFIG_SH_HS7751RVOIP is not set
80# CONFIG_SH_RTS7751R2D is not set 104# CONFIG_SH_RTS7751R2D is not set
105# CONFIG_SH_R7780RP is not set
81# CONFIG_SH_EDOSK7705 is not set 106# CONFIG_SH_EDOSK7705 is not set
82CONFIG_SH_SH4202_MICRODEV=y 107CONFIG_SH_SH4202_MICRODEV=y
108# CONFIG_SH_LANDISK is not set
109# CONFIG_SH_TITAN is not set
83# CONFIG_SH_UNKNOWN is not set 110# CONFIG_SH_UNKNOWN is not set
84# CONFIG_CPU_SH2 is not set 111
85# CONFIG_CPU_SH3 is not set 112#
113# Processor selection
114#
86CONFIG_CPU_SH4=y 115CONFIG_CPU_SH4=y
116
117#
118# SH-2 Processor Support
119#
87# CONFIG_CPU_SUBTYPE_SH7604 is not set 120# CONFIG_CPU_SUBTYPE_SH7604 is not set
121
122#
123# SH-3 Processor Support
124#
88# CONFIG_CPU_SUBTYPE_SH7300 is not set 125# CONFIG_CPU_SUBTYPE_SH7300 is not set
89# CONFIG_CPU_SUBTYPE_SH7705 is not set 126# CONFIG_CPU_SUBTYPE_SH7705 is not set
90# CONFIG_CPU_SUBTYPE_SH7707 is not set 127# CONFIG_CPU_SUBTYPE_SH7707 is not set
91# CONFIG_CPU_SUBTYPE_SH7708 is not set 128# CONFIG_CPU_SUBTYPE_SH7708 is not set
92# CONFIG_CPU_SUBTYPE_SH7709 is not set 129# CONFIG_CPU_SUBTYPE_SH7709 is not set
130
131#
132# SH-4 Processor Support
133#
93# CONFIG_CPU_SUBTYPE_SH7750 is not set 134# CONFIG_CPU_SUBTYPE_SH7750 is not set
135# CONFIG_CPU_SUBTYPE_SH7091 is not set
136# CONFIG_CPU_SUBTYPE_SH7750R is not set
137# CONFIG_CPU_SUBTYPE_SH7750S is not set
94# CONFIG_CPU_SUBTYPE_SH7751 is not set 138# CONFIG_CPU_SUBTYPE_SH7751 is not set
139# CONFIG_CPU_SUBTYPE_SH7751R is not set
95# CONFIG_CPU_SUBTYPE_SH7760 is not set 140# CONFIG_CPU_SUBTYPE_SH7760 is not set
96# CONFIG_CPU_SUBTYPE_SH73180 is not set 141CONFIG_CPU_SUBTYPE_SH4_202=y
142
143#
144# ST40 Processor Support
145#
97# CONFIG_CPU_SUBTYPE_ST40STB1 is not set 146# CONFIG_CPU_SUBTYPE_ST40STB1 is not set
98# CONFIG_CPU_SUBTYPE_ST40GX1 is not set 147# CONFIG_CPU_SUBTYPE_ST40GX1 is not set
99CONFIG_CPU_SUBTYPE_SH4_202=y 148
149#
150# SH-4A Processor Support
151#
152# CONFIG_CPU_SUBTYPE_SH73180 is not set
153# CONFIG_CPU_SUBTYPE_SH7770 is not set
154# CONFIG_CPU_SUBTYPE_SH7780 is not set
155
156#
157# Memory management options
158#
100CONFIG_MMU=y 159CONFIG_MMU=y
101CONFIG_CMDLINE_BOOL=y 160CONFIG_SELECT_MEMORY_MODEL=y
102CONFIG_CMDLINE="console=ttySC0,115200" 161CONFIG_FLATMEM_MANUAL=y
162# CONFIG_DISCONTIGMEM_MANUAL is not set
163# CONFIG_SPARSEMEM_MANUAL is not set
164CONFIG_FLATMEM=y
165CONFIG_FLAT_NODE_MEM_MAP=y
166# CONFIG_SPARSEMEM_STATIC is not set
167CONFIG_SPLIT_PTLOCK_CPUS=4
168
169#
170# Cache configuration
171#
172# CONFIG_SH_DIRECT_MAPPED is not set
173# CONFIG_SH_WRITETHROUGH is not set
174# CONFIG_SH_OCRAM is not set
103CONFIG_MEMORY_START=0x08000000 175CONFIG_MEMORY_START=0x08000000
104CONFIG_MEMORY_SIZE=0x04000000 176CONFIG_MEMORY_SIZE=0x04000000
105CONFIG_MEMORY_SET=y 177
106# CONFIG_MEMORY_OVERRIDE is not set 178#
179# Processor features
180#
181CONFIG_CPU_LITTLE_ENDIAN=y
107CONFIG_SH_RTC=y 182CONFIG_SH_RTC=y
108CONFIG_SH_FPU=y 183CONFIG_SH_FPU=y
109CONFIG_ZERO_PAGE_OFFSET=0x00001000
110CONFIG_BOOT_LINK_OFFSET=0x00800000
111CONFIG_CPU_LITTLE_ENDIAN=y
112CONFIG_PREEMPT=y
113# CONFIG_UBC_WAKEUP is not set
114# CONFIG_SH_WRITETHROUGH is not set
115# CONFIG_SH_OCRAM is not set
116# CONFIG_SH_STORE_QUEUES is not set 184# CONFIG_SH_STORE_QUEUES is not set
117# CONFIG_SMP is not set 185CONFIG_CPU_HAS_INTEVT=y
118CONFIG_SH_PCLK_CALC=y 186CONFIG_CPU_HAS_SR_RB=y
119CONFIG_SH_PCLK_FREQ=65986048 187
188#
189# Timer support
190#
191CONFIG_SH_TMU=y
192CONFIG_SH_PCLK_FREQ=66000000
120 193
121# 194#
122# CPU Frequency scaling 195# CPU Frequency scaling
@@ -137,20 +210,31 @@ CONFIG_NR_ONCHIP_DMA_CHANNELS=4
137CONFIG_HEARTBEAT=y 210CONFIG_HEARTBEAT=y
138 211
139# 212#
140# Bus options (PCI, PCMCIA, EISA, MCA, ISA) 213# Kernel features
141# 214#
142CONFIG_ISA=y 215# CONFIG_KEXEC is not set
143# CONFIG_PCI is not set 216CONFIG_PREEMPT=y
217# CONFIG_SMP is not set
144 218
145# 219#
146# PCCARD (PCMCIA/CardBus) support 220# Boot options
147# 221#
148# CONFIG_PCCARD is not set 222CONFIG_ZERO_PAGE_OFFSET=0x00001000
223CONFIG_BOOT_LINK_OFFSET=0x00800000
224# CONFIG_UBC_WAKEUP is not set
225CONFIG_CMDLINE_BOOL=y
226CONFIG_CMDLINE="console=ttySC0,115200"
149 227
150# 228#
151# PC-card bridges 229# Bus options
152# 230#
153CONFIG_PCMCIA_PROBE=y 231# CONFIG_SUPERHYWAY is not set
232# CONFIG_PCI is not set
233
234#
235# PCCARD (PCMCIA/CardBus) support
236#
237# CONFIG_PCCARD is not set
154 238
155# 239#
156# PCI Hotplug Support 240# PCI Hotplug Support
@@ -164,9 +248,79 @@ CONFIG_BINFMT_ELF=y
164# CONFIG_BINFMT_MISC is not set 248# CONFIG_BINFMT_MISC is not set
165 249
166# 250#
167# SH initrd options 251# Networking
252#
253CONFIG_NET=y
254
255#
256# Networking options
257#
258# CONFIG_PACKET is not set
259# CONFIG_UNIX is not set
260# CONFIG_NET_KEY is not set
261CONFIG_INET=y
262# CONFIG_IP_MULTICAST is not set
263# CONFIG_IP_ADVANCED_ROUTER is not set
264CONFIG_IP_FIB_HASH=y
265CONFIG_IP_PNP=y
266CONFIG_IP_PNP_DHCP=y
267# CONFIG_IP_PNP_BOOTP is not set
268# CONFIG_IP_PNP_RARP is not set
269# CONFIG_NET_IPIP is not set
270# CONFIG_NET_IPGRE is not set
271# CONFIG_ARPD is not set
272# CONFIG_SYN_COOKIES is not set
273# CONFIG_INET_AH is not set
274# CONFIG_INET_ESP is not set
275# CONFIG_INET_IPCOMP is not set
276# CONFIG_INET_TUNNEL is not set
277CONFIG_INET_DIAG=y
278CONFIG_INET_TCP_DIAG=y
279# CONFIG_TCP_CONG_ADVANCED is not set
280CONFIG_TCP_CONG_BIC=y
281# CONFIG_IPV6 is not set
282# CONFIG_NETFILTER is not set
283
284#
285# DCCP Configuration (EXPERIMENTAL)
286#
287# CONFIG_IP_DCCP is not set
288
289#
290# SCTP Configuration (EXPERIMENTAL)
168# 291#
169# CONFIG_EMBEDDED_RAMDISK is not set 292# CONFIG_IP_SCTP is not set
293
294#
295# TIPC Configuration (EXPERIMENTAL)
296#
297# CONFIG_TIPC is not set
298# CONFIG_ATM is not set
299# CONFIG_BRIDGE is not set
300# CONFIG_VLAN_8021Q is not set
301# CONFIG_DECNET is not set
302# CONFIG_LLC2 is not set
303# CONFIG_IPX is not set
304# CONFIG_ATALK is not set
305# CONFIG_X25 is not set
306# CONFIG_LAPB is not set
307# CONFIG_NET_DIVERT is not set
308# CONFIG_ECONET is not set
309# CONFIG_WAN_ROUTER is not set
310
311#
312# QoS and/or fair queueing
313#
314# CONFIG_NET_SCHED is not set
315
316#
317# Network testing
318#
319# CONFIG_NET_PKTGEN is not set
320# CONFIG_HAMRADIO is not set
321# CONFIG_IRDA is not set
322# CONFIG_BT is not set
323# CONFIG_IEEE80211 is not set
170 324
171# 325#
172# Device Drivers 326# Device Drivers
@@ -180,6 +334,11 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
180# CONFIG_FW_LOADER is not set 334# CONFIG_FW_LOADER is not set
181 335
182# 336#
337# Connector - unified userspace <-> kernelspace linker
338#
339# CONFIG_CONNECTOR is not set
340
341#
183# Memory Technology Devices (MTD) 342# Memory Technology Devices (MTD)
184# 343#
185# CONFIG_MTD is not set 344# CONFIG_MTD is not set
@@ -192,13 +351,10 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
192# 351#
193# Plug and Play support 352# Plug and Play support
194# 353#
195# CONFIG_PNP is not set
196 354
197# 355#
198# Block devices 356# Block devices
199# 357#
200# CONFIG_BLK_DEV_FD is not set
201# CONFIG_BLK_DEV_XD is not set
202# CONFIG_BLK_DEV_COW_COMMON is not set 358# CONFIG_BLK_DEV_COW_COMMON is not set
203# CONFIG_BLK_DEV_LOOP is not set 359# CONFIG_BLK_DEV_LOOP is not set
204# CONFIG_BLK_DEV_NBD is not set 360# CONFIG_BLK_DEV_NBD is not set
@@ -206,17 +362,7 @@ CONFIG_BLK_DEV_RAM=y
206CONFIG_BLK_DEV_RAM_COUNT=16 362CONFIG_BLK_DEV_RAM_COUNT=16
207CONFIG_BLK_DEV_RAM_SIZE=4096 363CONFIG_BLK_DEV_RAM_SIZE=4096
208CONFIG_BLK_DEV_INITRD=y 364CONFIG_BLK_DEV_INITRD=y
209CONFIG_INITRAMFS_SOURCE=""
210# CONFIG_LBD is not set
211# CONFIG_CDROM_PKTCDVD is not set 365# CONFIG_CDROM_PKTCDVD is not set
212
213#
214# IO Schedulers
215#
216CONFIG_IOSCHED_NOOP=y
217CONFIG_IOSCHED_AS=y
218CONFIG_IOSCHED_DEADLINE=y
219CONFIG_IOSCHED_CFQ=y
220# CONFIG_ATA_OVER_ETH is not set 366# CONFIG_ATA_OVER_ETH is not set
221 367
222# 368#
@@ -241,9 +387,7 @@ CONFIG_BLK_DEV_IDECD=y
241# IDE chipset support/bugfixes 387# IDE chipset support/bugfixes
242# 388#
243CONFIG_IDE_GENERIC=y 389CONFIG_IDE_GENERIC=y
244CONFIG_IDE_SH=y
245# CONFIG_IDE_ARM is not set 390# CONFIG_IDE_ARM is not set
246# CONFIG_IDE_CHIPSETS is not set
247# CONFIG_BLK_DEV_IDEDMA is not set 391# CONFIG_BLK_DEV_IDEDMA is not set
248# CONFIG_IDEDMA_AUTO is not set 392# CONFIG_IDEDMA_AUTO is not set
249# CONFIG_BLK_DEV_HD is not set 393# CONFIG_BLK_DEV_HD is not set
@@ -251,14 +395,10 @@ CONFIG_IDE_SH=y
251# 395#
252# SCSI device support 396# SCSI device support
253# 397#
398# CONFIG_RAID_ATTRS is not set
254# CONFIG_SCSI is not set 399# CONFIG_SCSI is not set
255 400
256# 401#
257# Old CD-ROM drivers (not SCSI, not IDE)
258#
259# CONFIG_CD_NO_IDESCSI is not set
260
261#
262# Multi-device support (RAID and LVM) 402# Multi-device support (RAID and LVM)
263# 403#
264# CONFIG_MD is not set 404# CONFIG_MD is not set
@@ -266,6 +406,7 @@ CONFIG_IDE_SH=y
266# 406#
267# Fusion MPT device support 407# Fusion MPT device support
268# 408#
409# CONFIG_FUSION is not set
269 410
270# 411#
271# IEEE 1394 (FireWire) support 412# IEEE 1394 (FireWire) support
@@ -276,69 +417,8 @@ CONFIG_IDE_SH=y
276# 417#
277 418
278# 419#
279# Networking support 420# Network device support
280#
281CONFIG_NET=y
282
283#
284# Networking options
285#
286# CONFIG_PACKET is not set
287# CONFIG_NETLINK_DEV is not set
288# CONFIG_UNIX is not set
289# CONFIG_NET_KEY is not set
290CONFIG_INET=y
291# CONFIG_IP_MULTICAST is not set
292# CONFIG_IP_ADVANCED_ROUTER is not set
293CONFIG_IP_PNP=y
294CONFIG_IP_PNP_DHCP=y
295# CONFIG_IP_PNP_BOOTP is not set
296# CONFIG_IP_PNP_RARP is not set
297# CONFIG_NET_IPIP is not set
298# CONFIG_NET_IPGRE is not set
299# CONFIG_ARPD is not set
300# CONFIG_SYN_COOKIES is not set
301# CONFIG_INET_AH is not set
302# CONFIG_INET_ESP is not set
303# CONFIG_INET_IPCOMP is not set
304# CONFIG_INET_TUNNEL is not set
305CONFIG_IP_TCPDIAG=y
306# CONFIG_IP_TCPDIAG_IPV6 is not set
307# CONFIG_IPV6 is not set
308# CONFIG_NETFILTER is not set
309
310#
311# SCTP Configuration (EXPERIMENTAL)
312#
313# CONFIG_IP_SCTP is not set
314# CONFIG_ATM is not set
315# CONFIG_BRIDGE is not set
316# CONFIG_VLAN_8021Q is not set
317# CONFIG_DECNET is not set
318# CONFIG_LLC2 is not set
319# CONFIG_IPX is not set
320# CONFIG_ATALK is not set
321# CONFIG_X25 is not set
322# CONFIG_LAPB is not set
323# CONFIG_NET_DIVERT is not set
324# CONFIG_ECONET is not set
325# CONFIG_WAN_ROUTER is not set
326
327#
328# QoS and/or fair queueing
329#
330# CONFIG_NET_SCHED is not set
331# CONFIG_NET_CLS_ROUTE is not set
332
333#
334# Network testing
335# 421#
336# CONFIG_NET_PKTGEN is not set
337# CONFIG_NETPOLL is not set
338# CONFIG_NET_POLL_CONTROLLER is not set
339# CONFIG_HAMRADIO is not set
340# CONFIG_IRDA is not set
341# CONFIG_BT is not set
342CONFIG_NETDEVICES=y 422CONFIG_NETDEVICES=y
343# CONFIG_DUMMY is not set 423# CONFIG_DUMMY is not set
344# CONFIG_BONDING is not set 424# CONFIG_BONDING is not set
@@ -346,9 +426,9 @@ CONFIG_NETDEVICES=y
346# CONFIG_TUN is not set 426# CONFIG_TUN is not set
347 427
348# 428#
349# ARCnet devices 429# PHY device support
350# 430#
351# CONFIG_ARCNET is not set 431# CONFIG_PHYLIB is not set
352 432
353# 433#
354# Ethernet (10 or 100Mbit) 434# Ethernet (10 or 100Mbit)
@@ -356,17 +436,7 @@ CONFIG_NETDEVICES=y
356CONFIG_NET_ETHERNET=y 436CONFIG_NET_ETHERNET=y
357CONFIG_MII=y 437CONFIG_MII=y
358# CONFIG_STNIC is not set 438# CONFIG_STNIC is not set
359# CONFIG_NET_VENDOR_3COM is not set
360# CONFIG_LANCE is not set
361# CONFIG_NET_VENDOR_SMC is not set
362CONFIG_SMC91X=y 439CONFIG_SMC91X=y
363# CONFIG_NET_VENDOR_RACAL is not set
364# CONFIG_AT1700 is not set
365# CONFIG_DEPCA is not set
366# CONFIG_HP100 is not set
367# CONFIG_NET_ISA is not set
368# CONFIG_NET_PCI is not set
369# CONFIG_NET_POCKET is not set
370 440
371# 441#
372# Ethernet (1000 Mbit) 442# Ethernet (1000 Mbit)
@@ -379,7 +449,6 @@ CONFIG_SMC91X=y
379# 449#
380# Token Ring devices 450# Token Ring devices
381# 451#
382# CONFIG_TR is not set
383 452
384# 453#
385# Wireless LAN (non-hamradio) 454# Wireless LAN (non-hamradio)
@@ -394,6 +463,8 @@ CONFIG_SMC91X=y
394# CONFIG_SLIP is not set 463# CONFIG_SLIP is not set
395# CONFIG_SHAPER is not set 464# CONFIG_SHAPER is not set
396# CONFIG_NETCONSOLE is not set 465# CONFIG_NETCONSOLE is not set
466# CONFIG_NETPOLL is not set
467# CONFIG_NET_POLL_CONTROLLER is not set
397 468
398# 469#
399# ISDN subsystem 470# ISDN subsystem
@@ -411,20 +482,10 @@ CONFIG_SMC91X=y
411# CONFIG_INPUT is not set 482# CONFIG_INPUT is not set
412 483
413# 484#
414# Userland interfaces 485# Hardware I/O ports
415#
416
417#
418# Input I/O drivers
419# 486#
420# CONFIG_GAMEPORT is not set
421CONFIG_SOUND_GAMEPORT=y
422# CONFIG_SERIO is not set 487# CONFIG_SERIO is not set
423# CONFIG_SERIO_I8042 is not set 488# CONFIG_GAMEPORT is not set
424
425#
426# Input Device Drivers
427#
428 489
429# 490#
430# Character devices 491# Character devices
@@ -464,24 +525,46 @@ CONFIG_RTC=y
464# 525#
465# Ftape, the floppy tape device driver 526# Ftape, the floppy tape device driver
466# 527#
467# CONFIG_DRM is not set
468# CONFIG_RAW_DRIVER is not set 528# CONFIG_RAW_DRIVER is not set
469 529
470# 530#
531# TPM devices
532#
533# CONFIG_TCG_TPM is not set
534# CONFIG_TELCLOCK is not set
535
536#
471# I2C support 537# I2C support
472# 538#
473# CONFIG_I2C is not set 539# CONFIG_I2C is not set
474 540
475# 541#
542# SPI support
543#
544# CONFIG_SPI is not set
545# CONFIG_SPI_MASTER is not set
546
547#
476# Dallas's 1-wire bus 548# Dallas's 1-wire bus
477# 549#
478# CONFIG_W1 is not set 550# CONFIG_W1 is not set
479 551
480# 552#
553# Hardware Monitoring support
554#
555CONFIG_HWMON=y
556# CONFIG_HWMON_VID is not set
557# CONFIG_HWMON_DEBUG_CHIP is not set
558
559#
481# Misc devices 560# Misc devices
482# 561#
483 562
484# 563#
564# Multimedia Capabilities Port drivers
565#
566
567#
485# Multimedia devices 568# Multimedia devices
486# 569#
487# CONFIG_VIDEO_DEV is not set 570# CONFIG_VIDEO_DEV is not set
@@ -508,7 +591,7 @@ CONFIG_RTC=y
508# CONFIG_USB_ARCH_HAS_OHCI is not set 591# CONFIG_USB_ARCH_HAS_OHCI is not set
509 592
510# 593#
511# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information 594# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
512# 595#
513 596
514# 597#
@@ -524,13 +607,21 @@ CONFIG_RTC=y
524# 607#
525# InfiniBand support 608# InfiniBand support
526# 609#
527# CONFIG_INFINIBAND is not set 610
611#
612# SN Devices
613#
614
615#
616# EDAC - error detection and reporting (RAS)
617#
528 618
529# 619#
530# File systems 620# File systems
531# 621#
532CONFIG_EXT2_FS=y 622CONFIG_EXT2_FS=y
533# CONFIG_EXT2_FS_XATTR is not set 623# CONFIG_EXT2_FS_XATTR is not set
624# CONFIG_EXT2_FS_XIP is not set
534CONFIG_EXT3_FS=y 625CONFIG_EXT3_FS=y
535CONFIG_EXT3_FS_XATTR=y 626CONFIG_EXT3_FS_XATTR=y
536# CONFIG_EXT3_FS_POSIX_ACL is not set 627# CONFIG_EXT3_FS_POSIX_ACL is not set
@@ -540,17 +631,17 @@ CONFIG_JBD=y
540CONFIG_FS_MBCACHE=y 631CONFIG_FS_MBCACHE=y
541# CONFIG_REISERFS_FS is not set 632# CONFIG_REISERFS_FS is not set
542# CONFIG_JFS_FS is not set 633# CONFIG_JFS_FS is not set
543 634# CONFIG_FS_POSIX_ACL is not set
544#
545# XFS support
546#
547# CONFIG_XFS_FS is not set 635# CONFIG_XFS_FS is not set
636# CONFIG_OCFS2_FS is not set
548# CONFIG_MINIX_FS is not set 637# CONFIG_MINIX_FS is not set
549# CONFIG_ROMFS_FS is not set 638# CONFIG_ROMFS_FS is not set
639CONFIG_INOTIFY=y
550# CONFIG_QUOTA is not set 640# CONFIG_QUOTA is not set
551CONFIG_DNOTIFY=y 641CONFIG_DNOTIFY=y
552# CONFIG_AUTOFS_FS is not set 642# CONFIG_AUTOFS_FS is not set
553# CONFIG_AUTOFS4_FS is not set 643# CONFIG_AUTOFS4_FS is not set
644# CONFIG_FUSE_FS is not set
554 645
555# 646#
556# CD-ROM/DVD Filesystems 647# CD-ROM/DVD Filesystems
@@ -574,16 +665,12 @@ CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
574CONFIG_PROC_FS=y 665CONFIG_PROC_FS=y
575CONFIG_PROC_KCORE=y 666CONFIG_PROC_KCORE=y
576CONFIG_SYSFS=y 667CONFIG_SYSFS=y
577CONFIG_DEVFS_FS=y
578CONFIG_DEVFS_MOUNT=y
579# CONFIG_DEVFS_DEBUG is not set
580CONFIG_DEVPTS_FS_XATTR=y
581# CONFIG_DEVPTS_FS_SECURITY is not set
582CONFIG_TMPFS=y 668CONFIG_TMPFS=y
583# CONFIG_TMPFS_XATTR is not set
584# CONFIG_HUGETLBFS is not set 669# CONFIG_HUGETLBFS is not set
585# CONFIG_HUGETLB_PAGE is not set 670# CONFIG_HUGETLB_PAGE is not set
586CONFIG_RAMFS=y 671CONFIG_RAMFS=y
672# CONFIG_RELAYFS_FS is not set
673# CONFIG_CONFIGFS_FS is not set
587 674
588# 675#
589# Miscellaneous filesystems 676# Miscellaneous filesystems
@@ -607,12 +694,14 @@ CONFIG_RAMFS=y
607# 694#
608CONFIG_NFS_FS=y 695CONFIG_NFS_FS=y
609CONFIG_NFS_V3=y 696CONFIG_NFS_V3=y
697# CONFIG_NFS_V3_ACL is not set
610CONFIG_NFS_V4=y 698CONFIG_NFS_V4=y
611# CONFIG_NFS_DIRECTIO is not set 699# CONFIG_NFS_DIRECTIO is not set
612# CONFIG_NFSD is not set 700# CONFIG_NFSD is not set
613CONFIG_ROOT_NFS=y 701CONFIG_ROOT_NFS=y
614CONFIG_LOCKD=y 702CONFIG_LOCKD=y
615CONFIG_LOCKD_V4=y 703CONFIG_LOCKD_V4=y
704CONFIG_NFS_COMMON=y
616CONFIG_SUNRPC=y 705CONFIG_SUNRPC=y
617CONFIG_SUNRPC_GSS=y 706CONFIG_SUNRPC_GSS=y
618CONFIG_RPCSEC_GSS_KRB5=y 707CONFIG_RPCSEC_GSS_KRB5=y
@@ -622,6 +711,7 @@ CONFIG_RPCSEC_GSS_KRB5=y
622# CONFIG_NCP_FS is not set 711# CONFIG_NCP_FS is not set
623# CONFIG_CODA_FS is not set 712# CONFIG_CODA_FS is not set
624# CONFIG_AFS_FS is not set 713# CONFIG_AFS_FS is not set
714# CONFIG_9P_FS is not set
625 715
626# 716#
627# Partition Types 717# Partition Types
@@ -681,8 +771,10 @@ CONFIG_NLS_DEFAULT="iso8859-1"
681# 771#
682# Kernel hacking 772# Kernel hacking
683# 773#
774# CONFIG_PRINTK_TIME is not set
775# CONFIG_MAGIC_SYSRQ is not set
684# CONFIG_DEBUG_KERNEL is not set 776# CONFIG_DEBUG_KERNEL is not set
685CONFIG_DEBUG_PREEMPT=y 777CONFIG_LOG_BUF_SHIFT=14
686# CONFIG_FRAME_POINTER is not set 778# CONFIG_FRAME_POINTER is not set
687# CONFIG_SH_STANDARD_BIOS is not set 779# CONFIG_SH_STANDARD_BIOS is not set
688# CONFIG_EARLY_SCIF_CONSOLE is not set 780# CONFIG_EARLY_SCIF_CONSOLE is not set
@@ -706,6 +798,7 @@ CONFIG_CRYPTO_MD5=y
706# CONFIG_CRYPTO_SHA256 is not set 798# CONFIG_CRYPTO_SHA256 is not set
707# CONFIG_CRYPTO_SHA512 is not set 799# CONFIG_CRYPTO_SHA512 is not set
708# CONFIG_CRYPTO_WP512 is not set 800# CONFIG_CRYPTO_WP512 is not set
801# CONFIG_CRYPTO_TGR192 is not set
709CONFIG_CRYPTO_DES=y 802CONFIG_CRYPTO_DES=y
710# CONFIG_CRYPTO_BLOWFISH is not set 803# CONFIG_CRYPTO_BLOWFISH is not set
711# CONFIG_CRYPTO_TWOFISH is not set 804# CONFIG_CRYPTO_TWOFISH is not set
@@ -730,5 +823,6 @@ CONFIG_CRYPTO_DES=y
730# Library routines 823# Library routines
731# 824#
732# CONFIG_CRC_CCITT is not set 825# CONFIG_CRC_CCITT is not set
826# CONFIG_CRC16 is not set
733CONFIG_CRC32=y 827CONFIG_CRC32=y
734# CONFIG_LIBCRC32C is not set 828# CONFIG_LIBCRC32C is not set
diff --git a/arch/sh/kernel/Makefile b/arch/sh/kernel/Makefile
index 7a86eeb22655..f05cd96f8867 100644
--- a/arch/sh/kernel/Makefile
+++ b/arch/sh/kernel/Makefile
@@ -8,7 +8,7 @@ obj-y := process.o signal.o entry.o traps.o irq.o \
8 ptrace.o setup.o time.o sys_sh.o semaphore.o \ 8 ptrace.o setup.o time.o sys_sh.o semaphore.o \
9 io.o io_generic.o sh_ksyms.o 9 io.o io_generic.o sh_ksyms.o
10 10
11obj-y += cpu/ 11obj-y += cpu/ timers/
12 12
13obj-$(CONFIG_SMP) += smp.o 13obj-$(CONFIG_SMP) += smp.o
14obj-$(CONFIG_CF_ENABLER) += cf-enabler.o 14obj-$(CONFIG_CF_ENABLER) += cf-enabler.o
diff --git a/arch/sh/kernel/cpu/Makefile b/arch/sh/kernel/cpu/Makefile
index 5bfc33bec5d0..59d5b748752f 100644
--- a/arch/sh/kernel/cpu/Makefile
+++ b/arch/sh/kernel/cpu/Makefile
@@ -2,7 +2,7 @@
2# Makefile for the Linux/SuperH CPU-specifc backends. 2# Makefile for the Linux/SuperH CPU-specifc backends.
3# 3#
4 4
5obj-y += irq/ init.o bus.o clock.o 5obj-y += irq/ init.o clock.o
6 6
7obj-$(CONFIG_CPU_SH2) += sh2/ 7obj-$(CONFIG_CPU_SH2) += sh2/
8obj-$(CONFIG_CPU_SH3) += sh3/ 8obj-$(CONFIG_CPU_SH3) += sh3/
diff --git a/arch/sh/kernel/cpu/bus.c b/arch/sh/kernel/cpu/bus.c
deleted file mode 100644
index fc6c4bd40c65..000000000000
--- a/arch/sh/kernel/cpu/bus.c
+++ /dev/null
@@ -1,197 +0,0 @@
1/*
2 * arch/sh/kernel/cpu/bus.c
3 *
4 * Virtual bus for SuperH.
5 *
6 * Copyright (C) 2004 Paul Mundt
7 *
8 * Shamelessly cloned from arch/arm/mach-omap/bus.c, which was written
9 * by:
10 *
11 * Copyright (C) 2003 - 2004 Nokia Corporation
12 * Written by Tony Lindgren <tony@atomide.com>
13 * Portions of code based on sa1111.c.
14 *
15 * This program is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by the
17 * Free Software Foundation; either version 2 of the License, or (at your
18 * option) any later version.
19 */
20#include <linux/kernel.h>
21#include <linux/device.h>
22#include <linux/init.h>
23#include <linux/module.h>
24#include <asm/bus-sh.h>
25
26static int sh_bus_match(struct device *dev, struct device_driver *drv)
27{
28 struct sh_driver *shdrv = to_sh_driver(drv);
29 struct sh_dev *shdev = to_sh_dev(dev);
30
31 return shdev->dev_id == shdrv->dev_id;
32}
33
34static int sh_bus_suspend(struct device *dev, pm_message_t state)
35{
36 struct sh_dev *shdev = to_sh_dev(dev);
37 struct sh_driver *shdrv = to_sh_driver(dev->driver);
38
39 if (shdrv && shdrv->suspend)
40 return shdrv->suspend(shdev, state);
41
42 return 0;
43}
44
45static int sh_bus_resume(struct device *dev)
46{
47 struct sh_dev *shdev = to_sh_dev(dev);
48 struct sh_driver *shdrv = to_sh_driver(dev->driver);
49
50 if (shdrv && shdrv->resume)
51 return shdrv->resume(shdev);
52
53 return 0;
54}
55
56static int sh_device_probe(struct device *dev)
57{
58 struct sh_dev *shdev = to_sh_dev(dev);
59 struct sh_driver *shdrv = to_sh_driver(dev->driver);
60
61 if (shdrv && shdrv->probe)
62 return shdrv->probe(shdev);
63
64 return -ENODEV;
65}
66
67static int sh_device_remove(struct device *dev)
68{
69 struct sh_dev *shdev = to_sh_dev(dev);
70 struct sh_driver *shdrv = to_sh_driver(dev->driver);
71
72 if (shdrv && shdrv->remove)
73 return shdrv->remove(shdev);
74
75 return 0;
76}
77
78static struct device sh_bus_devices[SH_NR_BUSES] = {
79 {
80 .bus_id = SH_BUS_NAME_VIRT,
81 },
82};
83
84struct bus_type sh_bus_types[SH_NR_BUSES] = {
85 {
86 .name = SH_BUS_NAME_VIRT,
87 .match = sh_bus_match,
88 .probe = sh_bus_probe,
89 .remove = sh_bus_remove,
90 .suspend = sh_bus_suspend,
91 .resume = sh_bus_resume,
92 },
93};
94
95int sh_device_register(struct sh_dev *dev)
96{
97 if (!dev)
98 return -EINVAL;
99
100 if (dev->bus_id < 0 || dev->bus_id >= SH_NR_BUSES) {
101 printk(KERN_ERR "%s: bus_id invalid: %s bus: %d\n",
102 __FUNCTION__, dev->name, dev->bus_id);
103 return -EINVAL;
104 }
105
106 dev->dev.parent = &sh_bus_devices[dev->bus_id];
107 dev->dev.bus = &sh_bus_types[dev->bus_id];
108
109 /* This is needed for USB OHCI to work */
110 if (dev->dma_mask)
111 dev->dev.dma_mask = dev->dma_mask;
112 if (dev->coherent_dma_mask)
113 dev->dev.coherent_dma_mask = dev->coherent_dma_mask;
114
115 snprintf(dev->dev.bus_id, BUS_ID_SIZE, "%s%u",
116 dev->name, dev->dev_id);
117
118 printk(KERN_INFO "Registering SH device '%s'. Parent at %s\n",
119 dev->dev.bus_id, dev->dev.parent->bus_id);
120
121 return device_register(&dev->dev);
122}
123
124void sh_device_unregister(struct sh_dev *dev)
125{
126 device_unregister(&dev->dev);
127}
128
129int sh_driver_register(struct sh_driver *drv)
130{
131 if (!drv)
132 return -EINVAL;
133
134 if (drv->bus_id < 0 || drv->bus_id >= SH_NR_BUSES) {
135 printk(KERN_ERR "%s: bus_id invalid: bus: %d device %d\n",
136 __FUNCTION__, drv->bus_id, drv->dev_id);
137 return -EINVAL;
138 }
139
140 drv->drv.bus = &sh_bus_types[drv->bus_id];
141
142 return driver_register(&drv->drv);
143}
144
145void sh_driver_unregister(struct sh_driver *drv)
146{
147 driver_unregister(&drv->drv);
148}
149
150static int __init sh_bus_init(void)
151{
152 int i, ret = 0;
153
154 for (i = 0; i < SH_NR_BUSES; i++) {
155 ret = device_register(&sh_bus_devices[i]);
156 if (ret != 0) {
157 printk(KERN_ERR "Unable to register bus device %s\n",
158 sh_bus_devices[i].bus_id);
159 continue;
160 }
161
162 ret = bus_register(&sh_bus_types[i]);
163 if (ret != 0) {
164 printk(KERN_ERR "Unable to register bus %s\n",
165 sh_bus_types[i].name);
166 device_unregister(&sh_bus_devices[i]);
167 }
168 }
169
170 printk(KERN_INFO "SH Virtual Bus initialized\n");
171
172 return ret;
173}
174
175static void __exit sh_bus_exit(void)
176{
177 int i;
178
179 for (i = 0; i < SH_NR_BUSES; i++) {
180 bus_unregister(&sh_bus_types[i]);
181 device_unregister(&sh_bus_devices[i]);
182 }
183}
184
185module_init(sh_bus_init);
186module_exit(sh_bus_exit);
187
188MODULE_AUTHOR("Paul Mundt <lethal@linux-sh.org>");
189MODULE_DESCRIPTION("SH Virtual Bus");
190MODULE_LICENSE("GPL");
191
192EXPORT_SYMBOL(sh_bus_types);
193EXPORT_SYMBOL(sh_device_register);
194EXPORT_SYMBOL(sh_device_unregister);
195EXPORT_SYMBOL(sh_driver_register);
196EXPORT_SYMBOL(sh_driver_unregister);
197
diff --git a/arch/sh/kernel/cpu/clock.c b/arch/sh/kernel/cpu/clock.c
index 989e7fdd524d..97fa37f42b84 100644
--- a/arch/sh/kernel/cpu/clock.c
+++ b/arch/sh/kernel/cpu/clock.c
@@ -38,9 +38,7 @@ static DECLARE_MUTEX(clock_list_sem);
38static struct clk master_clk = { 38static struct clk master_clk = {
39 .name = "master_clk", 39 .name = "master_clk",
40 .flags = CLK_ALWAYS_ENABLED | CLK_RATE_PROPAGATES, 40 .flags = CLK_ALWAYS_ENABLED | CLK_RATE_PROPAGATES,
41#ifdef CONFIG_SH_PCLK_FREQ_BOOL
42 .rate = CONFIG_SH_PCLK_FREQ, 41 .rate = CONFIG_SH_PCLK_FREQ,
43#endif
44}; 42};
45 43
46static struct clk module_clk = { 44static struct clk module_clk = {
@@ -227,16 +225,7 @@ int __init clk_init(void)
227{ 225{
228 int i, ret = 0; 226 int i, ret = 0;
229 227
230 if (unlikely(!master_clk.rate)) 228 BUG_ON(unlikely(!master_clk.rate));
231 /*
232 * NOTE: This will break if the default divisor has been
233 * changed.
234 *
235 * No one should be changing the default on us however,
236 * expect that a sane value for CONFIG_SH_PCLK_FREQ will
237 * be defined in the event of a different divisor.
238 */
239 master_clk.rate = get_timer_frequency() * 4;
240 229
241 for (i = 0; i < ARRAY_SIZE(onchip_clocks); i++) { 230 for (i = 0; i < ARRAY_SIZE(onchip_clocks); i++) {
242 struct clk *clk = onchip_clocks[i]; 231 struct clk *clk = onchip_clocks[i];
diff --git a/arch/sh/kernel/cpu/irq/ipr.c b/arch/sh/kernel/cpu/irq/ipr.c
index fdbd718ae5c6..e55150ed0856 100644
--- a/arch/sh/kernel/cpu/irq/ipr.c
+++ b/arch/sh/kernel/cpu/irq/ipr.c
@@ -108,8 +108,7 @@ static void end_ipr_irq(unsigned int irq)
108 enable_ipr_irq(irq); 108 enable_ipr_irq(irq);
109} 109}
110 110
111void make_ipr_irq(unsigned int irq, unsigned int addr, int pos, 111void make_ipr_irq(unsigned int irq, unsigned int addr, int pos, int priority)
112 int priority, int maskpos)
113{ 112{
114 disable_irq_nosync(irq); 113 disable_irq_nosync(irq);
115 ipr_data[irq].addr = addr; 114 ipr_data[irq].addr = addr;
@@ -123,44 +122,44 @@ void make_ipr_irq(unsigned int irq, unsigned int addr, int pos,
123void __init init_IRQ(void) 122void __init init_IRQ(void)
124{ 123{
125#ifndef CONFIG_CPU_SUBTYPE_SH7780 124#ifndef CONFIG_CPU_SUBTYPE_SH7780
126 make_ipr_irq(TIMER_IRQ, TIMER_IPR_ADDR, TIMER_IPR_POS, TIMER_PRIORITY, 0); 125 make_ipr_irq(TIMER_IRQ, TIMER_IPR_ADDR, TIMER_IPR_POS, TIMER_PRIORITY);
127 make_ipr_irq(TIMER1_IRQ, TIMER1_IPR_ADDR, TIMER1_IPR_POS, TIMER1_PRIORITY, 0); 126 make_ipr_irq(TIMER1_IRQ, TIMER1_IPR_ADDR, TIMER1_IPR_POS, TIMER1_PRIORITY);
128#if defined(CONFIG_SH_RTC) 127#if defined(CONFIG_SH_RTC)
129 make_ipr_irq(RTC_IRQ, RTC_IPR_ADDR, RTC_IPR_POS, RTC_PRIORITY, 0); 128 make_ipr_irq(RTC_IRQ, RTC_IPR_ADDR, RTC_IPR_POS, RTC_PRIORITY);
130#endif 129#endif
131 130
132#ifdef SCI_ERI_IRQ 131#ifdef SCI_ERI_IRQ
133 make_ipr_irq(SCI_ERI_IRQ, SCI_IPR_ADDR, SCI_IPR_POS, SCI_PRIORITY, 0); 132 make_ipr_irq(SCI_ERI_IRQ, SCI_IPR_ADDR, SCI_IPR_POS, SCI_PRIORITY);
134 make_ipr_irq(SCI_RXI_IRQ, SCI_IPR_ADDR, SCI_IPR_POS, SCI_PRIORITY, 0); 133 make_ipr_irq(SCI_RXI_IRQ, SCI_IPR_ADDR, SCI_IPR_POS, SCI_PRIORITY);
135 make_ipr_irq(SCI_TXI_IRQ, SCI_IPR_ADDR, SCI_IPR_POS, SCI_PRIORITY, 0); 134 make_ipr_irq(SCI_TXI_IRQ, SCI_IPR_ADDR, SCI_IPR_POS, SCI_PRIORITY);
136#endif 135#endif
137 136
138#ifdef SCIF1_ERI_IRQ 137#ifdef SCIF1_ERI_IRQ
139 make_ipr_irq(SCIF1_ERI_IRQ, SCIF1_IPR_ADDR, SCIF1_IPR_POS, SCIF1_PRIORITY, 0); 138 make_ipr_irq(SCIF1_ERI_IRQ, SCIF1_IPR_ADDR, SCIF1_IPR_POS, SCIF1_PRIORITY);
140 make_ipr_irq(SCIF1_RXI_IRQ, SCIF1_IPR_ADDR, SCIF1_IPR_POS, SCIF1_PRIORITY, 0); 139 make_ipr_irq(SCIF1_RXI_IRQ, SCIF1_IPR_ADDR, SCIF1_IPR_POS, SCIF1_PRIORITY);
141 make_ipr_irq(SCIF1_BRI_IRQ, SCIF1_IPR_ADDR, SCIF1_IPR_POS, SCIF1_PRIORITY, 0); 140 make_ipr_irq(SCIF1_BRI_IRQ, SCIF1_IPR_ADDR, SCIF1_IPR_POS, SCIF1_PRIORITY);
142 make_ipr_irq(SCIF1_TXI_IRQ, SCIF1_IPR_ADDR, SCIF1_IPR_POS, SCIF1_PRIORITY, 0); 141 make_ipr_irq(SCIF1_TXI_IRQ, SCIF1_IPR_ADDR, SCIF1_IPR_POS, SCIF1_PRIORITY);
143#endif 142#endif
144 143
145#if defined(CONFIG_CPU_SUBTYPE_SH7300) 144#if defined(CONFIG_CPU_SUBTYPE_SH7300)
146 make_ipr_irq(SCIF0_IRQ, SCIF0_IPR_ADDR, SCIF0_IPR_POS, SCIF0_PRIORITY, 0); 145 make_ipr_irq(SCIF0_IRQ, SCIF0_IPR_ADDR, SCIF0_IPR_POS, SCIF0_PRIORITY);
147 make_ipr_irq(DMTE2_IRQ, DMA1_IPR_ADDR, DMA1_IPR_POS, DMA1_PRIORITY, 0); 146 make_ipr_irq(DMTE2_IRQ, DMA1_IPR_ADDR, DMA1_IPR_POS, DMA1_PRIORITY);
148 make_ipr_irq(DMTE3_IRQ, DMA1_IPR_ADDR, DMA1_IPR_POS, DMA1_PRIORITY, 0); 147 make_ipr_irq(DMTE3_IRQ, DMA1_IPR_ADDR, DMA1_IPR_POS, DMA1_PRIORITY);
149 make_ipr_irq(VIO_IRQ, VIO_IPR_ADDR, VIO_IPR_POS, VIO_PRIORITY, 0); 148 make_ipr_irq(VIO_IRQ, VIO_IPR_ADDR, VIO_IPR_POS, VIO_PRIORITY);
150#endif 149#endif
151 150
152#ifdef SCIF_ERI_IRQ 151#ifdef SCIF_ERI_IRQ
153 make_ipr_irq(SCIF_ERI_IRQ, SCIF_IPR_ADDR, SCIF_IPR_POS, SCIF_PRIORITY, 0); 152 make_ipr_irq(SCIF_ERI_IRQ, SCIF_IPR_ADDR, SCIF_IPR_POS, SCIF_PRIORITY);
154 make_ipr_irq(SCIF_RXI_IRQ, SCIF_IPR_ADDR, SCIF_IPR_POS, SCIF_PRIORITY, 0); 153 make_ipr_irq(SCIF_RXI_IRQ, SCIF_IPR_ADDR, SCIF_IPR_POS, SCIF_PRIORITY);
155 make_ipr_irq(SCIF_BRI_IRQ, SCIF_IPR_ADDR, SCIF_IPR_POS, SCIF_PRIORITY, 0); 154 make_ipr_irq(SCIF_BRI_IRQ, SCIF_IPR_ADDR, SCIF_IPR_POS, SCIF_PRIORITY);
156 make_ipr_irq(SCIF_TXI_IRQ, SCIF_IPR_ADDR, SCIF_IPR_POS, SCIF_PRIORITY, 0); 155 make_ipr_irq(SCIF_TXI_IRQ, SCIF_IPR_ADDR, SCIF_IPR_POS, SCIF_PRIORITY);
157#endif 156#endif
158 157
159#ifdef IRDA_ERI_IRQ 158#ifdef IRDA_ERI_IRQ
160 make_ipr_irq(IRDA_ERI_IRQ, IRDA_IPR_ADDR, IRDA_IPR_POS, IRDA_PRIORITY, 0); 159 make_ipr_irq(IRDA_ERI_IRQ, IRDA_IPR_ADDR, IRDA_IPR_POS, IRDA_PRIORITY);
161 make_ipr_irq(IRDA_RXI_IRQ, IRDA_IPR_ADDR, IRDA_IPR_POS, IRDA_PRIORITY, 0); 160 make_ipr_irq(IRDA_RXI_IRQ, IRDA_IPR_ADDR, IRDA_IPR_POS, IRDA_PRIORITY);
162 make_ipr_irq(IRDA_BRI_IRQ, IRDA_IPR_ADDR, IRDA_IPR_POS, IRDA_PRIORITY, 0); 161 make_ipr_irq(IRDA_BRI_IRQ, IRDA_IPR_ADDR, IRDA_IPR_POS, IRDA_PRIORITY);
163 make_ipr_irq(IRDA_TXI_IRQ, IRDA_IPR_ADDR, IRDA_IPR_POS, IRDA_PRIORITY, 0); 162 make_ipr_irq(IRDA_TXI_IRQ, IRDA_IPR_ADDR, IRDA_IPR_POS, IRDA_PRIORITY);
164#endif 163#endif
165 164
166#if defined(CONFIG_CPU_SUBTYPE_SH7707) || defined(CONFIG_CPU_SUBTYPE_SH7709) || \ 165#if defined(CONFIG_CPU_SUBTYPE_SH7707) || defined(CONFIG_CPU_SUBTYPE_SH7709) || \
@@ -175,12 +174,12 @@ void __init init_IRQ(void)
175 * You should set corresponding bits of PFC to "00" 174 * You should set corresponding bits of PFC to "00"
176 * to enable these interrupts. 175 * to enable these interrupts.
177 */ 176 */
178 make_ipr_irq(IRQ0_IRQ, IRQ0_IPR_ADDR, IRQ0_IPR_POS, IRQ0_PRIORITY, 0); 177 make_ipr_irq(IRQ0_IRQ, IRQ0_IPR_ADDR, IRQ0_IPR_POS, IRQ0_PRIORITY);
179 make_ipr_irq(IRQ1_IRQ, IRQ1_IPR_ADDR, IRQ1_IPR_POS, IRQ1_PRIORITY, 0); 178 make_ipr_irq(IRQ1_IRQ, IRQ1_IPR_ADDR, IRQ1_IPR_POS, IRQ1_PRIORITY);
180 make_ipr_irq(IRQ2_IRQ, IRQ2_IPR_ADDR, IRQ2_IPR_POS, IRQ2_PRIORITY, 0); 179 make_ipr_irq(IRQ2_IRQ, IRQ2_IPR_ADDR, IRQ2_IPR_POS, IRQ2_PRIORITY);
181 make_ipr_irq(IRQ3_IRQ, IRQ3_IPR_ADDR, IRQ3_IPR_POS, IRQ3_PRIORITY, 0); 180 make_ipr_irq(IRQ3_IRQ, IRQ3_IPR_ADDR, IRQ3_IPR_POS, IRQ3_PRIORITY);
182 make_ipr_irq(IRQ4_IRQ, IRQ4_IPR_ADDR, IRQ4_IPR_POS, IRQ4_PRIORITY, 0); 181 make_ipr_irq(IRQ4_IRQ, IRQ4_IPR_ADDR, IRQ4_IPR_POS, IRQ4_PRIORITY);
183 make_ipr_irq(IRQ5_IRQ, IRQ5_IPR_ADDR, IRQ5_IPR_POS, IRQ5_PRIORITY, 0); 182 make_ipr_irq(IRQ5_IRQ, IRQ5_IPR_ADDR, IRQ5_IPR_POS, IRQ5_PRIORITY);
184#endif 183#endif
185#endif 184#endif
186 185
diff --git a/arch/sh/kernel/entry.S b/arch/sh/kernel/entry.S
index fb6368159dd0..a440d36ee618 100644
--- a/arch/sh/kernel/entry.S
+++ b/arch/sh/kernel/entry.S
@@ -16,6 +16,7 @@
16#include <linux/config.h> 16#include <linux/config.h>
17#include <asm/asm-offsets.h> 17#include <asm/asm-offsets.h>
18#include <asm/thread_info.h> 18#include <asm/thread_info.h>
19#include <asm/cpu/mmu_context.h>
19#include <asm/unistd.h> 20#include <asm/unistd.h>
20 21
21#if !defined(CONFIG_NFSD) && !defined(CONFIG_NFSD_MODULE) 22#if !defined(CONFIG_NFSD) && !defined(CONFIG_NFSD_MODULE)
@@ -75,23 +76,6 @@
75ENOSYS = 38 76ENOSYS = 38
76EINVAL = 22 77EINVAL = 22
77 78
78#if defined(CONFIG_CPU_SH3)
79TRA = 0xffffffd0
80EXPEVT = 0xffffffd4
81#if defined(CONFIG_CPU_SUBTYPE_SH7707) || defined(CONFIG_CPU_SUBTYPE_SH7709) || \
82 defined(CONFIG_CPU_SUBTYPE_SH7300) || defined(CONFIG_CPU_SUBTYPE_SH7705)
83INTEVT = 0xa4000000 ! INTEVTE2(0xa4000000)
84#else
85INTEVT = 0xffffffd8
86#endif
87MMU_TEA = 0xfffffffc ! TLB Exception Address Register
88#elif defined(CONFIG_CPU_SH4)
89TRA = 0xff000020
90EXPEVT = 0xff000024
91INTEVT = 0xff000028
92MMU_TEA = 0xff00000c ! TLB Exception Address Register
93#endif
94
95#if defined(CONFIG_KGDB_NMI) 79#if defined(CONFIG_KGDB_NMI)
96NMI_VEC = 0x1c0 ! Must catch early for debounce 80NMI_VEC = 0x1c0 ! Must catch early for debounce
97#endif 81#endif
diff --git a/arch/sh/kernel/process.c b/arch/sh/kernel/process.c
index a4dc2b532e10..9fd1723e6219 100644
--- a/arch/sh/kernel/process.c
+++ b/arch/sh/kernel/process.c
@@ -15,21 +15,18 @@
15#include <linux/unistd.h> 15#include <linux/unistd.h>
16#include <linux/mm.h> 16#include <linux/mm.h>
17#include <linux/elfcore.h> 17#include <linux/elfcore.h>
18#include <linux/slab.h>
19#include <linux/a.out.h> 18#include <linux/a.out.h>
19#include <linux/slab.h>
20#include <linux/pm.h>
20#include <linux/ptrace.h> 21#include <linux/ptrace.h>
21#include <linux/platform.h> 22#include <linux/platform.h>
22#include <linux/kallsyms.h> 23#include <linux/kallsyms.h>
24#include <linux/kexec.h>
23 25
24#include <asm/io.h> 26#include <asm/io.h>
25#include <asm/uaccess.h> 27#include <asm/uaccess.h>
26#include <asm/mmu_context.h> 28#include <asm/mmu_context.h>
27#include <asm/elf.h> 29#include <asm/elf.h>
28#if defined(CONFIG_SH_HS7751RVOIP)
29#include <asm/hs7751rvoip/hs7751rvoip.h>
30#elif defined(CONFIG_SH_RTS7751R2D)
31#include <asm/rts7751r2d/rts7751r2d.h>
32#endif
33 30
34static int hlt_counter=0; 31static int hlt_counter=0;
35 32
@@ -37,6 +34,11 @@ int ubc_usercnt = 0;
37 34
38#define HARD_IDLE_TIMEOUT (HZ / 3) 35#define HARD_IDLE_TIMEOUT (HZ / 3)
39 36
37void (*pm_idle)(void);
38
39void (*pm_power_off)(void);
40EXPORT_SYMBOL(pm_power_off);
41
40void disable_hlt(void) 42void disable_hlt(void)
41{ 43{
42 hlt_counter++; 44 hlt_counter++;
@@ -51,17 +53,25 @@ void enable_hlt(void)
51 53
52EXPORT_SYMBOL(enable_hlt); 54EXPORT_SYMBOL(enable_hlt);
53 55
56void default_idle(void)
57{
58 if (!hlt_counter)
59 cpu_sleep();
60 else
61 cpu_relax();
62}
63
54void cpu_idle(void) 64void cpu_idle(void)
55{ 65{
56 /* endless idle loop with no priority at all */ 66 /* endless idle loop with no priority at all */
57 while (1) { 67 while (1) {
58 if (hlt_counter) { 68 void (*idle)(void) = pm_idle;
59 while (!need_resched()) 69
60 cpu_relax(); 70 if (!idle)
61 } else { 71 idle = default_idle;
62 while (!need_resched()) 72
63 cpu_sleep(); 73 while (!need_resched())
64 } 74 idle();
65 75
66 preempt_enable_no_resched(); 76 preempt_enable_no_resched();
67 schedule(); 77 schedule();
@@ -88,28 +98,16 @@ void machine_restart(char * __unused)
88 98
89void machine_halt(void) 99void machine_halt(void)
90{ 100{
91#if defined(CONFIG_SH_HS7751RVOIP) 101 local_irq_disable();
92 unsigned short value;
93 102
94 value = ctrl_inw(PA_OUTPORTR);
95 ctrl_outw((value & 0xffdf), PA_OUTPORTR);
96#elif defined(CONFIG_SH_RTS7751R2D)
97 ctrl_outw(0x0001, PA_POWOFF);
98#endif
99 while (1) 103 while (1)
100 cpu_sleep(); 104 cpu_sleep();
101} 105}
102 106
103void machine_power_off(void) 107void machine_power_off(void)
104{ 108{
105#if defined(CONFIG_SH_HS7751RVOIP) 109 if (pm_power_off)
106 unsigned short value; 110 pm_power_off();
107
108 value = ctrl_inw(PA_OUTPORTR);
109 ctrl_outw((value & 0xffdf), PA_OUTPORTR);
110#elif defined(CONFIG_SH_RTS7751R2D)
111 ctrl_outw(0x0001, PA_POWOFF);
112#endif
113} 111}
114 112
115void show_regs(struct pt_regs * regs) 113void show_regs(struct pt_regs * regs)
diff --git a/arch/sh/kernel/setup.c b/arch/sh/kernel/setup.c
index 036050b377cd..a067a34e0b64 100644
--- a/arch/sh/kernel/setup.c
+++ b/arch/sh/kernel/setup.c
@@ -22,10 +22,10 @@
22#include <linux/cpu.h> 22#include <linux/cpu.h>
23#include <asm/uaccess.h> 23#include <asm/uaccess.h>
24#include <asm/io.h> 24#include <asm/io.h>
25#include <asm/io_generic.h>
26#include <asm/sections.h> 25#include <asm/sections.h>
27#include <asm/irq.h> 26#include <asm/irq.h>
28#include <asm/setup.h> 27#include <asm/setup.h>
28#include <asm/clock.h>
29 29
30#ifdef CONFIG_SH_KGDB 30#ifdef CONFIG_SH_KGDB
31#include <asm/kgdb.h> 31#include <asm/kgdb.h>
@@ -41,7 +41,7 @@ extern void * __rd_start, * __rd_end;
41 * This value will be used at the very early stage of serial setup. 41 * This value will be used at the very early stage of serial setup.
42 * The bigger value means no problem. 42 * The bigger value means no problem.
43 */ 43 */
44struct sh_cpuinfo boot_cpu_data = { CPU_SH_NONE, 0, 10000000, }; 44struct sh_cpuinfo boot_cpu_data = { CPU_SH_NONE, 10000000, };
45struct screen_info screen_info; 45struct screen_info screen_info;
46 46
47#if defined(CONFIG_SH_UNKNOWN) 47#if defined(CONFIG_SH_UNKNOWN)
@@ -186,7 +186,7 @@ static inline void parse_cmdline (char ** cmdline_p, char mv_name[MV_NAME_SIZE],
186 186
187static int __init sh_mv_setup(char **cmdline_p) 187static int __init sh_mv_setup(char **cmdline_p)
188{ 188{
189#if defined(CONFIG_SH_UNKNOWN) 189#ifdef CONFIG_SH_UNKNOWN
190 extern struct sh_machine_vector mv_unknown; 190 extern struct sh_machine_vector mv_unknown;
191#endif 191#endif
192 struct sh_machine_vector *mv = NULL; 192 struct sh_machine_vector *mv = NULL;
@@ -196,7 +196,7 @@ static int __init sh_mv_setup(char **cmdline_p)
196 196
197 parse_cmdline(cmdline_p, mv_name, &mv, &mv_io_base, &mv_mmio_enable); 197 parse_cmdline(cmdline_p, mv_name, &mv, &mv_io_base, &mv_mmio_enable);
198 198
199#ifdef CONFIG_SH_GENERIC 199#ifdef CONFIG_SH_UNKNOWN
200 if (mv == NULL) { 200 if (mv == NULL) {
201 mv = &mv_unknown; 201 mv = &mv_unknown;
202 if (*mv_name != '\0') { 202 if (*mv_name != '\0') {
@@ -206,9 +206,6 @@ static int __init sh_mv_setup(char **cmdline_p)
206 } 206 }
207 sh_mv = *mv; 207 sh_mv = *mv;
208#endif 208#endif
209#ifdef CONFIG_SH_UNKNOWN
210 sh_mv = mv_unknown;
211#endif
212 209
213 /* 210 /*
214 * Manually walk the vec, fill in anything that the board hasn't yet 211 * Manually walk the vec, fill in anything that the board hasn't yet
@@ -231,10 +228,8 @@ static int __init sh_mv_setup(char **cmdline_p)
231 mv_set(readb); mv_set(readw); mv_set(readl); 228 mv_set(readb); mv_set(readw); mv_set(readl);
232 mv_set(writeb); mv_set(writew); mv_set(writel); 229 mv_set(writeb); mv_set(writew); mv_set(writel);
233 230
234 mv_set(ioremap); 231 mv_set(ioport_map);
235 mv_set(iounmap); 232 mv_set(ioport_unmap);
236
237 mv_set(isa_port2addr);
238 mv_set(irq_demux); 233 mv_set(irq_demux);
239 234
240#ifdef CONFIG_SH_UNKNOWN 235#ifdef CONFIG_SH_UNKNOWN
@@ -273,10 +268,10 @@ void __init setup_arch(char **cmdline_p)
273 init_mm.end_data = (unsigned long) _edata; 268 init_mm.end_data = (unsigned long) _edata;
274 init_mm.brk = (unsigned long) _end; 269 init_mm.brk = (unsigned long) _end;
275 270
276 code_resource.start = virt_to_bus(_text); 271 code_resource.start = (unsigned long)virt_to_phys(_text);
277 code_resource.end = virt_to_bus(_etext)-1; 272 code_resource.end = (unsigned long)virt_to_phys(_etext)-1;
278 data_resource.start = virt_to_bus(_etext); 273 data_resource.start = (unsigned long)virt_to_phys(_etext);
279 data_resource.end = virt_to_bus(_edata)-1; 274 data_resource.end = (unsigned long)virt_to_phys(_edata)-1;
280 275
281 sh_mv_setup(cmdline_p); 276 sh_mv_setup(cmdline_p);
282 277
@@ -435,6 +430,9 @@ static const char *cpu_name[] = {
435 [CPU_ST40GX1] = "ST40GX1", 430 [CPU_ST40GX1] = "ST40GX1",
436 [CPU_SH4_202] = "SH4-202", 431 [CPU_SH4_202] = "SH4-202",
437 [CPU_SH4_501] = "SH4-501", 432 [CPU_SH4_501] = "SH4-501",
433 [CPU_SH7770] = "SH7770",
434 [CPU_SH7780] = "SH7780",
435 [CPU_SH7781] = "SH7781",
438 [CPU_SH_NONE] = "Unknown" 436 [CPU_SH_NONE] = "Unknown"
439}; 437};
440 438
@@ -445,7 +443,7 @@ const char *get_cpu_subtype(void)
445 443
446#ifdef CONFIG_PROC_FS 444#ifdef CONFIG_PROC_FS
447static const char *cpu_flags[] = { 445static const char *cpu_flags[] = {
448 "none", "fpu", "p2flush", "mmuassoc", "dsp", "perfctr", 446 "none", "fpu", "p2flush", "mmuassoc", "dsp", "perfctr", "ptea", NULL
449}; 447};
450 448
451static void show_cpuflags(struct seq_file *m) 449static void show_cpuflags(struct seq_file *m)
@@ -459,7 +457,7 @@ static void show_cpuflags(struct seq_file *m)
459 return; 457 return;
460 } 458 }
461 459
462 for (i = 0; i < cpu_data->flags; i++) 460 for (i = 0; cpu_flags[i]; i++)
463 if ((cpu_data->flags & (1 << i))) 461 if ((cpu_data->flags & (1 << i)))
464 seq_printf(m, " %s", cpu_flags[i+1]); 462 seq_printf(m, " %s", cpu_flags[i+1]);
465 463
@@ -472,7 +470,8 @@ static void show_cacheinfo(struct seq_file *m, const char *type, struct cache_in
472 470
473 cache_size = info.ways * info.sets * info.linesz; 471 cache_size = info.ways * info.sets * info.linesz;
474 472
475 seq_printf(m, "%s size\t: %dKiB\n", type, cache_size >> 10); 473 seq_printf(m, "%s size\t: %2dKiB (%d-way)\n",
474 type, cache_size >> 10, info.ways);
476} 475}
477 476
478/* 477/*
@@ -511,21 +510,9 @@ static int show_cpuinfo(struct seq_file *m, void *v)
511 boot_cpu_data.loops_per_jiffy/(500000/HZ), 510 boot_cpu_data.loops_per_jiffy/(500000/HZ),
512 (boot_cpu_data.loops_per_jiffy/(5000/HZ)) % 100); 511 (boot_cpu_data.loops_per_jiffy/(5000/HZ)) % 100);
513 512
514#define PRINT_CLOCK(name, value) \ 513 return show_clocks(m);
515 seq_printf(m, name " clock\t: %d.%02dMHz\n", \
516 ((value) / 1000000), ((value) % 1000000)/10000)
517
518 PRINT_CLOCK("cpu", boot_cpu_data.cpu_clock);
519 PRINT_CLOCK("bus", boot_cpu_data.bus_clock);
520#ifdef CONFIG_CPU_SUBTYPE_ST40STB1
521 PRINT_CLOCK("memory", boot_cpu_data.memory_clock);
522#endif
523 PRINT_CLOCK("module", boot_cpu_data.module_clock);
524
525 return 0;
526} 514}
527 515
528
529static void *c_start(struct seq_file *m, loff_t *pos) 516static void *c_start(struct seq_file *m, loff_t *pos)
530{ 517{
531 return *pos < NR_CPUS ? cpu_data + *pos : NULL; 518 return *pos < NR_CPUS ? cpu_data + *pos : NULL;
@@ -596,7 +583,7 @@ static int __init kgdb_parse_options(char *options)
596 options += map->namelen + 1; 583 options += map->namelen + 1;
597 584
598 options = (*options == ',') ? options+1 : options; 585 options = (*options == ',') ? options+1 : options;
599 586
600 /* Read optional parameters (baud/parity/bits) */ 587 /* Read optional parameters (baud/parity/bits) */
601 baud = simple_strtoul(options, &options, 10); 588 baud = simple_strtoul(options, &options, 10);
602 if (baud != 0) { 589 if (baud != 0) {