Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

sh: mach-dreamcast: Convert to sparseirq.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>

+34 -19
+1 -2
arch/sh/Kconfig
··· 730 730 731 731 config SPARSE_IRQ 732 732 def_bool y 733 - depends on SUPERH32 && !SH_DREAMCAST && !SH_HIGHLANDER && \ 734 - !SH_RTS7751R2D 733 + depends on SUPERH32 && !SH_HIGHLANDER && !SH_RTS7751R2D 735 734 help 736 735 This enables support for sparse irqs. This is useful in general 737 736 as most CPUs have a fairly sparse array of IRQ vectors, which
+27
arch/sh/boards/mach-dreamcast/irq.c
··· 135 135 /* Not reached */ 136 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 + }
+1 -17
arch/sh/boards/mach-dreamcast/setup.c
··· 28 28 #include <asm/machvec.h> 29 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 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 33 board_time_init = aica_time_init; 51 34 } 52 35 ··· 37 54 .mv_name = "Sega Dreamcast", 38 55 .mv_setup = dreamcast_setup, 39 56 .mv_irq_demux = systemasic_irq_demux, 57 + .mv_init_irq = systemasic_irq_init, 40 58 };
+5
arch/sh/include/mach-dreamcast/mach/sysasic.h
··· 39 39 40 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 47 #endif /* __ASM_SH_DREAMCAST_SYSASIC_H */ 43 48