diff options
author | Paul Mundt <lethal@linux-sh.org> | 2010-02-02 04:01:55 -0500 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2010-02-02 04:01:55 -0500 |
commit | deb9b22b8968fa0166d89c8ad1346e816cf1aec4 (patch) | |
tree | a8f2a46d7498182c11bda07916b4b954c8541a8a | |
parent | 6eb6f98396f7bd653d8fb15b06364c8c7d70e22c (diff) |
sh: mach-dreamcast: Convert to sparseirq.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-rw-r--r-- | arch/sh/Kconfig | 3 | ||||
-rw-r--r-- | arch/sh/boards/mach-dreamcast/irq.c | 27 | ||||
-rw-r--r-- | arch/sh/boards/mach-dreamcast/setup.c | 18 | ||||
-rw-r--r-- | arch/sh/include/mach-dreamcast/mach/sysasic.h | 5 |
4 files changed, 34 insertions, 19 deletions
diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig index 9e565d962dc0..3b3c036cbc30 100644 --- a/arch/sh/Kconfig +++ b/arch/sh/Kconfig | |||
@@ -730,8 +730,7 @@ config GUSA_RB | |||
730 | 730 | ||
731 | config SPARSE_IRQ | 731 | config SPARSE_IRQ |
732 | def_bool y | 732 | def_bool y |
733 | depends on SUPERH32 && !SH_DREAMCAST && !SH_HIGHLANDER && \ | 733 | depends on SUPERH32 && !SH_HIGHLANDER && !SH_RTS7751R2D |
734 | !SH_RTS7751R2D | ||
735 | help | 734 | help |
736 | This enables support for sparse irqs. This is useful in general | 735 | This enables support for sparse irqs. This is useful in general |
737 | as most CPUs have a fairly sparse array of IRQ vectors, which | 736 | as most CPUs have a fairly sparse array of IRQ vectors, which |
diff --git a/arch/sh/boards/mach-dreamcast/irq.c b/arch/sh/boards/mach-dreamcast/irq.c index f55fc8e795e9..d932667410ab 100644 --- a/arch/sh/boards/mach-dreamcast/irq.c +++ b/arch/sh/boards/mach-dreamcast/irq.c | |||
@@ -135,3 +135,30 @@ int systemasic_irq_demux(int irq) | |||
135 | /* Not reached */ | 135 | /* Not reached */ |
136 | return irq; | 136 | return irq; |
137 | } | 137 | } |
138 | |||
139 | void systemasic_irq_init(void) | ||
140 | { | ||
141 | int i, nid = cpu_to_node(boot_cpu_data); | ||
142 | |||
143 | /* Assign all virtual IRQs to the System ASIC int. handler */ | ||
144 | for (i = HW_EVENT_IRQ_BASE; i < HW_EVENT_IRQ_MAX; i++) { | ||
145 | unsigned int irq; | ||
146 | |||
147 | irq = create_irq_nr(i, nid); | ||
148 | if (unlikely(irq == 0)) { | ||
149 | pr_err("%s: failed hooking irq %d for systemasic\n", | ||
150 | __func__, i); | ||
151 | return; | ||
152 | } | ||
153 | |||
154 | if (unlikely(irq != i)) { | ||
155 | pr_err("%s: got irq %d but wanted %d, bailing.\n", | ||
156 | __func__, irq, i); | ||
157 | destroy_irq(irq); | ||
158 | return; | ||
159 | } | ||
160 | |||
161 | set_irq_chip_and_handler(i, &systemasic_int, | ||
162 | handle_level_irq); | ||
163 | } | ||
164 | } | ||
diff --git a/arch/sh/boards/mach-dreamcast/setup.c b/arch/sh/boards/mach-dreamcast/setup.c index a4b7402d6176..ad1a4db72e04 100644 --- a/arch/sh/boards/mach-dreamcast/setup.c +++ b/arch/sh/boards/mach-dreamcast/setup.c | |||
@@ -28,25 +28,8 @@ | |||
28 | #include <asm/machvec.h> | 28 | #include <asm/machvec.h> |
29 | #include <mach/sysasic.h> | 29 | #include <mach/sysasic.h> |
30 | 30 | ||
31 | extern struct irq_chip systemasic_int; | ||
32 | extern void aica_time_init(void); | ||
33 | extern int systemasic_irq_demux(int); | ||
34 | |||
35 | static void __init dreamcast_setup(char **cmdline_p) | 31 | static void __init dreamcast_setup(char **cmdline_p) |
36 | { | 32 | { |
37 | int i; | ||
38 | |||
39 | /* Mask all hardware events */ | ||
40 | /* XXX */ | ||
41 | |||
42 | /* Acknowledge any previous events */ | ||
43 | /* XXX */ | ||
44 | |||
45 | /* Assign all virtual IRQs to the System ASIC int. handler */ | ||
46 | for (i = HW_EVENT_IRQ_BASE; i < HW_EVENT_IRQ_MAX; i++) | ||
47 | set_irq_chip_and_handler(i, &systemasic_int, | ||
48 | handle_level_irq); | ||
49 | |||
50 | board_time_init = aica_time_init; | 33 | board_time_init = aica_time_init; |
51 | } | 34 | } |
52 | 35 | ||
@@ -54,4 +37,5 @@ static struct sh_machine_vector mv_dreamcast __initmv = { | |||
54 | .mv_name = "Sega Dreamcast", | 37 | .mv_name = "Sega Dreamcast", |
55 | .mv_setup = dreamcast_setup, | 38 | .mv_setup = dreamcast_setup, |
56 | .mv_irq_demux = systemasic_irq_demux, | 39 | .mv_irq_demux = systemasic_irq_demux, |
40 | .mv_init_irq = systemasic_irq_init, | ||
57 | }; | 41 | }; |
diff --git a/arch/sh/include/mach-dreamcast/mach/sysasic.h b/arch/sh/include/mach-dreamcast/mach/sysasic.h index f33426608a87..58f710e1ebc2 100644 --- a/arch/sh/include/mach-dreamcast/mach/sysasic.h +++ b/arch/sh/include/mach-dreamcast/mach/sysasic.h | |||
@@ -39,5 +39,10 @@ | |||
39 | 39 | ||
40 | #define HW_EVENT_IRQ_MAX (HW_EVENT_IRQ_BASE + 95) | 40 | #define HW_EVENT_IRQ_MAX (HW_EVENT_IRQ_BASE + 95) |
41 | 41 | ||
42 | /* arch/sh/boards/mach-dreamcast/irq.c */ | ||
43 | extern int systemasic_irq_demux(int); | ||
44 | extern void systemasic_irq_init(void); | ||
45 | extern void aica_time_init(void); | ||
46 | |||
42 | #endif /* __ASM_SH_DREAMCAST_SYSASIC_H */ | 47 | #endif /* __ASM_SH_DREAMCAST_SYSASIC_H */ |
43 | 48 | ||