aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/boards/superh/microdev
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2006-09-27 05:17:31 -0400
committerPaul Mundt <lethal@linux-sh.org>2006-09-27 05:17:31 -0400
commit2c7834a6f15fe6c50ed4766f1bb6f9183b9e2740 (patch)
tree2dee1fc4b2cd69d8e7f07e0462c57c98261a9fcf /arch/sh/boards/superh/microdev
parentbc8fb5d0471473f775378d09db712dcb8eeece75 (diff)
sh: machvec rework.
Some more machvec overhauling and setup code cleanup. Kill off get_system_type() and platform_setup(), we can do these both through the machvec. While we're add it, kill off more useless mach.c's and drop some legacy cruft from setup.c. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/boards/superh/microdev')
-rw-r--r--arch/sh/boards/superh/microdev/setup.c113
1 files changed, 50 insertions, 63 deletions
diff --git a/arch/sh/boards/superh/microdev/setup.c b/arch/sh/boards/superh/microdev/setup.c
index 61b402a3f5d7..031c814e6e76 100644
--- a/arch/sh/boards/superh/microdev/setup.c
+++ b/arch/sh/boards/superh/microdev/setup.c
@@ -10,7 +10,6 @@
10 * May be copied or modified under the terms of the GNU General Public 10 * May be copied or modified under the terms of the GNU General Public
11 * License. See linux/COPYING for more information. 11 * License. See linux/COPYING for more information.
12 */ 12 */
13
14#include <linux/init.h> 13#include <linux/init.h>
15#include <linux/platform_device.h> 14#include <linux/platform_device.h>
16#include <linux/ioport.h> 15#include <linux/ioport.h>
@@ -21,41 +20,6 @@
21 20
22extern void microdev_heartbeat(void); 21extern void microdev_heartbeat(void);
23 22
24/*
25 * The Machine Vector
26 */
27
28struct sh_machine_vector mv_sh4202_microdev __initmv = {
29 .mv_nr_irqs = 72, /* QQQ need to check this - use the MACRO */
30
31 .mv_inb = microdev_inb,
32 .mv_inw = microdev_inw,
33 .mv_inl = microdev_inl,
34 .mv_outb = microdev_outb,
35 .mv_outw = microdev_outw,
36 .mv_outl = microdev_outl,
37
38 .mv_inb_p = microdev_inb_p,
39 .mv_inw_p = microdev_inw_p,
40 .mv_inl_p = microdev_inl_p,
41 .mv_outb_p = microdev_outb_p,
42 .mv_outw_p = microdev_outw_p,
43 .mv_outl_p = microdev_outl_p,
44
45 .mv_insb = microdev_insb,
46 .mv_insw = microdev_insw,
47 .mv_insl = microdev_insl,
48 .mv_outsb = microdev_outsb,
49 .mv_outsw = microdev_outsw,
50 .mv_outsl = microdev_outsl,
51
52 .mv_init_irq = init_microdev_irq,
53
54#ifdef CONFIG_HEARTBEAT
55 .mv_heartbeat = microdev_heartbeat,
56#endif
57};
58ALIAS_MV(sh4202_microdev)
59 23
60/****************************************************************************/ 24/****************************************************************************/
61 25
@@ -113,11 +77,6 @@ ALIAS_MV(sh4202_microdev)
113 /* assume a Keyboard Controller is present */ 77 /* assume a Keyboard Controller is present */
114int microdev_kbd_controller_present = 1; 78int microdev_kbd_controller_present = 1;
115 79
116const char *get_system_type(void)
117{
118 return "SH4-202 MicroDev";
119}
120
121static struct resource smc91x_resources[] = { 80static struct resource smc91x_resources[] = {
122 [0] = { 81 [0] = {
123 .start = 0x300, 82 .start = 0x300,
@@ -291,25 +250,9 @@ static int __init microdev_devices_setup(void)
291 return platform_add_devices(microdev_devices, ARRAY_SIZE(microdev_devices)); 250 return platform_add_devices(microdev_devices, ARRAY_SIZE(microdev_devices));
292} 251}
293 252
294__initcall(microdev_devices_setup); 253/*
295 254 * Setup for the SMSC FDC37C93xAPM
296void __init platform_setup(void) 255 */
297{
298 int * const fpgaRevisionRegister = (int*)(MICRODEV_FPGA_GP_BASE + 0x8ul);
299 const int fpgaRevision = *fpgaRevisionRegister;
300 int * const CacheControlRegister = (int*)CCR;
301
302 printk("SuperH %s board (FPGA rev: 0x%0x, CCR: 0x%0x)\n",
303 get_system_type(), fpgaRevision, *CacheControlRegister);
304}
305
306
307/****************************************************************************/
308
309
310 /*
311 * Setup for the SMSC FDC37C93xAPM
312 */
313static int __init smsc_superio_setup(void) 256static int __init smsc_superio_setup(void)
314{ 257{
315 258
@@ -412,8 +355,52 @@ static int __init smsc_superio_setup(void)
412 return 0; 355 return 0;
413} 356}
414 357
358static void __init microdev_setup(char **cmdline_p)
359{
360 int * const fpgaRevisionRegister = (int*)(MICRODEV_FPGA_GP_BASE + 0x8ul);
361 const int fpgaRevision = *fpgaRevisionRegister;
362 int * const CacheControlRegister = (int*)CCR;
363
364 device_initcall(microdev_devices_setup);
365 device_initcall(smsc_superio_setup);
415 366
416/* This is grotty, but, because kernel is always referenced on the link line 367 printk("SuperH %s board (FPGA rev: 0x%0x, CCR: 0x%0x)\n",
417 * before any devices, this is safe. 368 get_system_type(), fpgaRevision, *CacheControlRegister);
369}
370
371/*
372 * The Machine Vector
418 */ 373 */
419__initcall(smsc_superio_setup); 374struct sh_machine_vector mv_sh4202_microdev __initmv = {
375 .mv_name = "SH4-202 MicroDev",
376 .mv_setup = microdev_setup,
377 .mv_nr_irqs = 72, /* QQQ need to check this - use the MACRO */
378
379 .mv_inb = microdev_inb,
380 .mv_inw = microdev_inw,
381 .mv_inl = microdev_inl,
382 .mv_outb = microdev_outb,
383 .mv_outw = microdev_outw,
384 .mv_outl = microdev_outl,
385
386 .mv_inb_p = microdev_inb_p,
387 .mv_inw_p = microdev_inw_p,
388 .mv_inl_p = microdev_inl_p,
389 .mv_outb_p = microdev_outb_p,
390 .mv_outw_p = microdev_outw_p,
391 .mv_outl_p = microdev_outl_p,
392
393 .mv_insb = microdev_insb,
394 .mv_insw = microdev_insw,
395 .mv_insl = microdev_insl,
396 .mv_outsb = microdev_outsb,
397 .mv_outsw = microdev_outsw,
398 .mv_outsl = microdev_outsl,
399
400 .mv_init_irq = init_microdev_irq,
401
402#ifdef CONFIG_HEARTBEAT
403 .mv_heartbeat = microdev_heartbeat,
404#endif
405};
406ALIAS_MV(sh4202_microdev)