]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/arm/plat-omap/include/mach/entry-macro.S
OMAP3: ack spurious IRQs in get_irqnr_and_base
[linux-2.6-omap-h63xx.git] / arch / arm / plat-omap / include / mach / entry-macro.S
index d4e9043bf2013c23b08f34c9eefcba9322059c45..c88a4cb52e2dc206a43d5229230f789ac614b82e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * arch/arm/plat-omap/include/mach/entry-macro.S
+ * include/asm-arm/arch-omap/entry-macro.S
  *
  * Low-level IRQ helper macros for OMAP-based platforms
  *
 1510:
                .endm
 
-#elif defined(CONFIG_ARCH_OMAP24XX)
+#endif
+#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX)
 
+#if defined(CONFIG_ARCH_OMAP24XX)
 #include <mach/omap24xx.h>
+#endif
+#if defined(CONFIG_ARCH_OMAP34XX)
+#include <mach/omap34xx.h>
+#endif
+
+#define INTCPS_SIR_IRQ_OFFSET  0x0040          /* Active interrupt number */
 
                .macro  disable_fiq
                .endm
                ldr     \irqnr, [\base, #0xd8] /* IRQ pending reg 3 */
                cmp     \irqnr, #0x0
 2222:
-               ldrne   \irqnr, [\base, #IRQ_SIR_IRQ]
+#if defined(CONFIG_ARCH_OMAP34XX)
+               mov     \tmp, \irqnr
+#endif
+               ldrne   \irqnr, [\base, #INTCPS_SIR_IRQ_OFFSET]
+#if defined(CONFIG_ARCH_OMAP34XX)
+               mov     \irqstat, \irqnr
+               bic     \irqstat, \irqstat, #0x7f /* check for spurious flag */
+               cmp     \irqstat, #0x0
+               beq     2223f
+               mov     \irqstat, #0x1 /* Ack the spurious irq, this lets it
+                                       * generate a bad irq error message,
+                                       * but prevents infinitely repeating
+                                       * irq.
+                                       */
+               str     \irqstat, [\base, #0x48] /* INTC_CONTROL register */
+2223:
+               cmp     \tmp, #0x0 /* set conditional back to what it was
+                                   * before spurious test
+                                   */
+#endif
 
                .endm