ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.6.tar.bz2
[linux-2.6.git] / arch / sh / boards / dreamcast / setup.c
1 /* 
2  * arch/sh/boards/dreamcast/setup.c
3  *
4  * Hardware support for the Sega Dreamcast.
5  *
6  * Copyright (c) 2001, 2002 M. R. Brown <mrbrown@linuxdc.org>
7  * Copyright (c) 2002, 2003 Paul Mundt <lethal@linux-sh.org>
8  *
9  * This file is part of the LinuxDC project (www.linuxdc.org)
10  *
11  * Released under the terms of the GNU GPL v2.0.
12  * 
13  * This file originally bore the message (with enclosed-$):
14  *      Id: setup_dc.c,v 1.5 2001/05/24 05:09:16 mrbrown Exp
15  *      SEGA Dreamcast support
16  */
17
18 #include <linux/sched.h>
19 #include <linux/kernel.h>
20 #include <linux/param.h>
21 #include <linux/interrupt.h>
22 #include <linux/init.h>
23 #include <linux/irq.h>
24
25 #include <asm/io.h>
26 #include <asm/irq.h>
27 #include <asm/machvec.h>
28 #include <asm/machvec_init.h>
29 #include <asm/mach/sysasic.h>
30
31 extern struct hw_interrupt_type systemasic_int;
32 /* XXX: Move this into it's proper header. */
33 extern void (*board_time_init)(void);
34 extern void aica_time_init(void);
35 extern int gapspci_init(void);
36 extern int systemasic_irq_demux(int);
37 const char *get_system_type(void)
38 {
39         return "Sega Dreamcast";
40 }
41
42 struct sh_machine_vector mv_dreamcast __initmv = {
43         .mv_nr_irqs             = NR_IRQS,
44
45         .mv_irq_demux           = systemasic_irq_demux,
46 };
47 ALIAS_MV(dreamcast)
48
49 int __init platform_setup(void)
50 {
51         int i;
52
53         /* Mask all hardware events */
54         /* XXX */
55
56         /* Acknowledge any previous events */
57         /* XXX */
58
59         __set_io_port_base(0xa0000000);
60
61         /* Assign all virtual IRQs to the System ASIC int. handler */
62         for (i = HW_EVENT_IRQ_BASE; i < HW_EVENT_IRQ_MAX; i++)
63                 irq_desc[i].handler = &systemasic_int;
64
65         board_time_init = aica_time_init;
66
67 #ifdef CONFIG_PCI
68         if (gapspci_init() < 0)
69                 printk(KERN_WARNING "GAPSPCI was not detected.\n");
70 #endif
71
72         return 0;
73 }