]> pilppa.org Git - linux-2.6-omap-h63xx.git/blob - arch/sh/boards/dreamcast/setup.c
sh: Various cosmetic cleanups.
[linux-2.6-omap-h63xx.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, 2004 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 #include <linux/device.h>
25
26 #include <asm/io.h>
27 #include <asm/irq.h>
28 #include <asm/rtc.h>
29 #include <asm/machvec.h>
30 #include <asm/mach/sysasic.h>
31
32 extern struct hw_interrupt_type systemasic_int;
33 extern void aica_time_init(void);
34 extern int gapspci_init(void);
35 extern int systemasic_irq_demux(int);
36
37 void *dreamcast_consistent_alloc(struct device *, size_t, dma_addr_t *, gfp_t);
38 int dreamcast_consistent_free(struct device *, size_t, void *, dma_addr_t);
39
40 const char *get_system_type(void)
41 {
42         return "Sega Dreamcast";
43 }
44
45 struct sh_machine_vector mv_dreamcast __initmv = {
46         .mv_nr_irqs             = NR_IRQS,
47
48         .mv_irq_demux           = systemasic_irq_demux,
49
50 #ifdef CONFIG_PCI
51         .mv_consistent_alloc    = dreamcast_consistent_alloc,
52         .mv_consistent_free     = dreamcast_consistent_free,
53 #endif
54 };
55 ALIAS_MV(dreamcast)
56
57 int __init platform_setup(void)
58 {
59         int i;
60
61         /* Mask all hardware events */
62         /* XXX */
63
64         /* Acknowledge any previous events */
65         /* XXX */
66
67         __set_io_port_base(0xa0000000);
68
69         /* Assign all virtual IRQs to the System ASIC int. handler */
70         for (i = HW_EVENT_IRQ_BASE; i < HW_EVENT_IRQ_MAX; i++)
71                 irq_desc[i].chip = &systemasic_int;
72
73         board_time_init = aica_time_init;
74
75 #ifdef CONFIG_PCI
76         if (gapspci_init() < 0)
77                 printk(KERN_WARNING "GAPSPCI was not detected.\n");
78 #endif
79
80         return 0;
81 }