sparc32,leon: don't rely on bootloader to mask IRQs
authorDaniel Hellstrom <daniel@gaisler.com>
Thu, 21 Apr 2011 04:20:25 +0000 (04:20 +0000)
committerDavid S. Miller <davem@davemloft.net>
Thu, 21 Apr 2011 23:44:45 +0000 (16:44 -0700)
Signed-off-by: Daniel Hellstrom <daniel@gaisler.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
arch/sparc/kernel/leon_kernel.c
arch/sparc/kernel/leon_smp.c

index 8417a914e8a3c2e17d36d65528fd31b80e81c450..2f538ac2e139b68c5ffea31b12520c0672b83a88 100644 (file)
@@ -345,6 +345,9 @@ void __init leon_init_timers(irq_handler_t counter_fn)
        icsel = (icsel >> ((7 - (boot_cpu_id&0x7)) * 4)) & 0xf;
        leon3_irqctrl_regs += icsel;
 
+       /* Mask all IRQs on boot-cpu IRQ controller */
+       LEON3_BYPASS_STORE_PA(&leon3_irqctrl_regs->mask[boot_cpu_id], 0);
+
        /* Probe extended IRQ controller */
        eirq = (LEON3_BYPASS_LOAD_PA(&leon3_irqctrl_regs->mpstatus)
                >> 16) & 0xf;
index cbd8e31d01ffdf526acabe7b9e8a82da84c174f0..de9506d9ad7d399c638cbf6725edd8a083c524eb 100644 (file)
@@ -217,6 +217,10 @@ int __cpuinit leon_boot_one_cpu(int i)
               (unsigned int)&leon3_irqctrl_regs->mpstatus);
        local_flush_cache_all();
 
+       /* Make sure all IRQs are of from the start for this new CPU */
+       LEON_BYPASS_STORE_PA(&leon3_irqctrl_regs->mask[i], 0);
+
+       /* Wake one CPU */
        LEON_BYPASS_STORE_PA(&(leon3_irqctrl_regs->mpstatus), 1 << i);
 
        /* wheee... it's going... */