sparc32: introduce sparc_irq_config
authorSam Ravnborg <sam@ravnborg.org>
Sat, 26 Feb 2011 07:00:19 +0000 (23:00 -0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 17 Mar 2011 01:19:13 +0000 (18:19 -0700)
sparc_irq_config is used to hold the platform specific irq setup.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
arch/sparc/kernel/irq.h
arch/sparc/kernel/irq_32.c
arch/sparc/kernel/leon_kernel.c
arch/sparc/kernel/sun4c_irq.c
arch/sparc/kernel/sun4d_irq.c
arch/sparc/kernel/sun4m_irq.c
arch/sparc/kernel/time_32.c

index db75138815307780820df94178d14fd5506e1db5..4b4e54f32b266a42c88202a84464cf0a06e0453a 100644 (file)
@@ -1,5 +1,16 @@
 #include <asm/btfixup.h>
 
+/*
+ * Platform specific irq configuration
+ * The individual platforms assign their platform
+ * specifics in their init functions.
+ */
+struct sparc_irq_config {
+       void (*init_timers)(irq_handler_t);
+};
+extern struct sparc_irq_config sparc_irq_config;
+
+
 /* Dave Redman (djhr@tadpole.co.uk)
  * changed these to function pointers.. it saves cycles and will allow
  * the irq dependencies to be split into different files at a later date
@@ -45,12 +56,6 @@ static inline void load_profile_irq(int cpu, int limit)
        BTFIXUP_CALL(load_profile_irq)(cpu, limit);
 }
 
-extern void (*sparc_init_timers)(irq_handler_t lvl10_irq);
-
-extern void claim_ticker14(irq_handler_t irq_handler,
-                          int irq,
-                          unsigned int timeout);
-
 #ifdef CONFIG_SMP
 BTFIXUPDEF_CALL(void, set_cpu_int, int, int)
 BTFIXUPDEF_CALL(void, clear_cpu_int, int, int)
index 93afee00a9278d41d7b7a831beffb01eb4d5845b..b80b8bf0bf00c1b12862eac58a811ee099462417 100644 (file)
@@ -29,6 +29,9 @@
 #define SMP_NOP3
 #endif /* SMP */
 
+/* platform specific irq setup */
+struct sparc_irq_config sparc_irq_config;
+
 unsigned long arch_local_irq_save(void)
 {
        unsigned long retval;
@@ -100,14 +103,7 @@ EXPORT_SYMBOL(arch_local_irq_restore);
  *
  */
 
-static void irq_panic(void)
-{
-       prom_printf("machine: %s doesn't have irq handlers defined!\n",
-                   &cputypval[0]);
-       prom_halt();
-}
 
-void (*sparc_init_timers)(irq_handler_t) = (void (*)(irq_handler_t))irq_panic;
 
 /*
  * Dave Redman (djhr@tadpole.co.uk)
index 2f8a9a25d10d0b6843d29b835db80420f8f15286..2969f777fa11fffe74f7a013bba60cdced4ae31c 100644 (file)
@@ -347,7 +347,7 @@ void leon_enable_irq_cpu(unsigned int irq_nr, unsigned int cpu)
 
 void __init leon_init_IRQ(void)
 {
-       sparc_init_timers = leon_init_timers;
+       sparc_irq_config.init_timers = leon_init_timers;
 
        BTFIXUPSET_CALL(enable_irq, leon_enable_irq, BTFIXUPCALL_NORM);
        BTFIXUPSET_CALL(disable_irq, leon_disable_irq, BTFIXUPCALL_NORM);
index f543b452ebc136d7d11953778d8e44961299373f..90eea38ad66f35a02b091d8a15ef8d888c5637ca 100644 (file)
@@ -221,7 +221,9 @@ void __init sun4c_init_IRQ(void)
        BTFIXUPSET_CALL(disable_pil_irq, sun4c_disable_irq, BTFIXUPCALL_NORM);
        BTFIXUPSET_CALL(clear_clock_irq, sun4c_clear_clock_irq, BTFIXUPCALL_NORM);
        BTFIXUPSET_CALL(load_profile_irq, sun4c_load_profile_irq, BTFIXUPCALL_NOP);
-       sparc_init_timers = sun4c_init_timers;
+
+       sparc_irq_config.init_timers = sun4c_init_timers;
+
 #ifdef CONFIG_SMP
        BTFIXUPSET_CALL(set_cpu_int, sun4c_nop, BTFIXUPCALL_NOP);
        BTFIXUPSET_CALL(clear_cpu_int, sun4c_nop, BTFIXUPCALL_NOP);
index 609a13c85823a6c519a3e1689ee0475138d9545e..fc1c22f121fda584a207447254e3c461658a105f 100644 (file)
@@ -557,7 +557,9 @@ void __init sun4d_init_IRQ(void)
        BTFIXUPSET_CALL(disable_irq, sun4d_disable_irq, BTFIXUPCALL_NORM);
        BTFIXUPSET_CALL(clear_clock_irq, sun4d_clear_clock_irq, BTFIXUPCALL_NORM);
        BTFIXUPSET_CALL(load_profile_irq, sun4d_load_profile_irq, BTFIXUPCALL_NORM);
-       sparc_init_timers = sun4d_init_timers;
+
+       sparc_irq_config.init_timers = sun4d_init_timers;
+
 #ifdef CONFIG_SMP
        BTFIXUPSET_CALL(set_cpu_int, sun4d_set_cpu_int, BTFIXUPCALL_NORM);
        BTFIXUPSET_CALL(clear_cpu_int, sun4d_clear_ipi, BTFIXUPCALL_NOP);
index 3c6657a4caec79b95b5c8a3d33b56e422c443479..1e13ce96dc7eb0df0d1cac0d126ceb632e265b4c 100644 (file)
@@ -470,7 +470,9 @@ void __init sun4m_init_IRQ(void)
        BTFIXUPSET_CALL(disable_pil_irq, sun4m_disable_pil_irq, BTFIXUPCALL_NORM);
        BTFIXUPSET_CALL(clear_clock_irq, sun4m_clear_clock_irq, BTFIXUPCALL_NORM);
        BTFIXUPSET_CALL(load_profile_irq, sun4m_load_profile_irq, BTFIXUPCALL_NORM);
-       sparc_init_timers = sun4m_init_timers;
+
+       sparc_irq_config.init_timers = sun4m_init_timers;
+
 #ifdef CONFIG_SMP
        BTFIXUPSET_CALL(set_cpu_int, sun4m_send_ipi, BTFIXUPCALL_NORM);
        BTFIXUPSET_CALL(clear_cpu_int, sun4m_clear_ipi, BTFIXUPCALL_NORM);
index 19ab42a932db918a307c0c1451166e922b91bef3..8237dd4dfeb40d55e3b35947d3f41cd3d3f43372 100644 (file)
@@ -219,7 +219,7 @@ static void __init sbus_time_init(void)
 
        btfixup();
 
-       sparc_init_timers(timer_interrupt);
+       sparc_irq_config.init_timers(timer_interrupt);
 }
 
 void __init time_init(void)