Merge master.kernel.org:/pub/scm/linux/kernel/git/herbert/crypto-2.6
[linux-drm-fsl-dcu.git] / arch / sh / kernel / cpu / irq / intc2.c
index 74ca576a7ce502984e26cf8511a7808acaf65c03..d8e22f4ff0f0a517497307fa45f4f1ff5322c4cf 100644 (file)
  * Hitachi 7751, the STM ST40 STB1, SH7760, and SH7780.
  */
 #include <linux/kernel.h>
-#include <linux/irq.h>
+#include <linux/interrupt.h>
 #include <linux/io.h>
-#include <asm/system.h>
+
+#if defined(CONFIG_CPU_SUBTYPE_SH7760)
+#define INTC2_BASE     0xfe080000
+#define INTC2_INTMSK   (INTC2_BASE + 0x40)
+#define INTC2_INTMSKCLR        (INTC2_BASE + 0x60)
+#elif defined(CONFIG_CPU_SUBTYPE_SH7780) || \
+      defined(CONFIG_CPU_SUBTYPE_SH7785)
+#define INTC2_BASE     0xffd40000
+#define INTC2_INTMSK   (INTC2_BASE + 0x38)
+#define INTC2_INTMSKCLR        (INTC2_BASE + 0x3c)
+#endif
 
 static void disable_intc2_irq(unsigned int irq)
 {
        struct intc2_data *p = get_irq_chip_data(irq);
-       ctrl_outl(1 << p->msk_shift,
-                 INTC2_BASE + INTC2_INTMSK_OFFSET + p->msk_offset);
+       ctrl_outl(1 << p->msk_shift, INTC2_INTMSK + p->msk_offset);
 }
 
 static void enable_intc2_irq(unsigned int irq)
 {
        struct intc2_data *p = get_irq_chip_data(irq);
-       ctrl_outl(1 << p->msk_shift,
-                 INTC2_BASE + INTC2_INTMSKCLR_OFFSET + p->msk_offset);
+       ctrl_outl(1 << p->msk_shift, INTC2_INTMSKCLR + p->msk_offset);
 }
 
 static struct irq_chip intc2_irq_chip = {
@@ -61,12 +69,10 @@ void make_intc2_irq(struct intc2_data *table, unsigned int nr_irqs)
                /* Set the priority level */
                local_irq_save(flags);
 
-               ipr = ctrl_inl(INTC2_BASE + INTC2_INTPRI_OFFSET +
-                              p->ipr_offset);
+               ipr = ctrl_inl(INTC2_BASE + p->ipr_offset);
                ipr &= ~(0xf << p->ipr_shift);
                ipr |= p->priority << p->ipr_shift;
-               ctrl_outl(ipr, INTC2_BASE + INTC2_INTPRI_OFFSET +
-                         p->ipr_offset);
+               ctrl_outl(ipr, INTC2_BASE + p->ipr_offset);
 
                local_irq_restore(flags);