|
@@ -271,3 +271,105 @@ static int to_gic_irq(struct irq_data *data)
|
|
{
|
|
{
|
|
unsigned int vect = irq2evt(data->irq) - INTCS_VECT_BASE;
|
|
unsigned int vect = irq2evt(data->irq) - INTCS_VECT_BASE;
|
|
|
|
|
|
|
|
+ if (vect >= 0x3200)
|
|
|
|
+ vect -= 0x3000;
|
|
|
|
+ else
|
|
|
|
+ vect -= 0x0200;
|
|
|
|
+
|
|
|
|
+ return gic_spi((vect >> 5) + 1);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static int to_intca_reloc_irq(struct irq_data *data)
|
|
|
|
+{
|
|
|
|
+ return data->irq + (RELOC_BASE >> 5);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+#define irq_cb(cb, irq) irq_get_chip(irq)->cb(irq_get_irq_data(irq))
|
|
|
|
+#define irq_cbp(cb, irq, p...) irq_get_chip(irq)->cb(irq_get_irq_data(irq), p)
|
|
|
|
+
|
|
|
|
+static void intca_gic_enable(struct irq_data *data)
|
|
|
|
+{
|
|
|
|
+ irq_cb(irq_unmask, to_intca_reloc_irq(data));
|
|
|
|
+ irq_cb(irq_unmask, to_gic_irq(data));
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static void intca_gic_disable(struct irq_data *data)
|
|
|
|
+{
|
|
|
|
+ irq_cb(irq_mask, to_gic_irq(data));
|
|
|
|
+ irq_cb(irq_mask, to_intca_reloc_irq(data));
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static void intca_gic_mask_ack(struct irq_data *data)
|
|
|
|
+{
|
|
|
|
+ irq_cb(irq_mask, to_gic_irq(data));
|
|
|
|
+ irq_cb(irq_mask_ack, to_intca_reloc_irq(data));
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static void intca_gic_eoi(struct irq_data *data)
|
|
|
|
+{
|
|
|
|
+ irq_cb(irq_eoi, to_gic_irq(data));
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static int intca_gic_set_type(struct irq_data *data, unsigned int type)
|
|
|
|
+{
|
|
|
|
+ return irq_cbp(irq_set_type, to_intca_reloc_irq(data), type);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static int intca_gic_set_wake(struct irq_data *data, unsigned int on)
|
|
|
|
+{
|
|
|
|
+ return irq_cbp(irq_set_wake, to_intca_reloc_irq(data), on);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+#ifdef CONFIG_SMP
|
|
|
|
+static int intca_gic_set_affinity(struct irq_data *data,
|
|
|
|
+ const struct cpumask *cpumask,
|
|
|
|
+ bool force)
|
|
|
|
+{
|
|
|
|
+ return irq_cbp(irq_set_affinity, to_gic_irq(data), cpumask, force);
|
|
|
|
+}
|
|
|
|
+#endif
|
|
|
|
+
|
|
|
|
+struct irq_chip intca_gic_irq_chip = {
|
|
|
|
+ .name = "INTCA-GIC",
|
|
|
|
+ .irq_mask = intca_gic_disable,
|
|
|
|
+ .irq_unmask = intca_gic_enable,
|
|
|
|
+ .irq_mask_ack = intca_gic_mask_ack,
|
|
|
|
+ .irq_eoi = intca_gic_eoi,
|
|
|
|
+ .irq_enable = intca_gic_enable,
|
|
|
|
+ .irq_disable = intca_gic_disable,
|
|
|
|
+ .irq_shutdown = intca_gic_disable,
|
|
|
|
+ .irq_set_type = intca_gic_set_type,
|
|
|
|
+ .irq_set_wake = intca_gic_set_wake,
|
|
|
|
+#ifdef CONFIG_SMP
|
|
|
|
+ .irq_set_affinity = intca_gic_set_affinity,
|
|
|
|
+#endif
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+static int to_intc_vect(int irq)
|
|
|
|
+{
|
|
|
|
+ unsigned int irq_pin = irq - gic_spi(1);
|
|
|
|
+ unsigned int offs;
|
|
|
|
+
|
|
|
|
+ if (irq_pin < 16)
|
|
|
|
+ offs = 0x0200;
|
|
|
|
+ else
|
|
|
|
+ offs = 0x3000;
|
|
|
|
+
|
|
|
|
+ return offs + (irq_pin << 5);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static irqreturn_t sh73a0_irq_pin_demux(int irq, void *dev_id)
|
|
|
|
+{
|
|
|
|
+ generic_handle_irq(intcs_evt2irq(to_intc_vect(irq)));
|
|
|
|
+ return IRQ_HANDLED;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static struct irqaction sh73a0_irq_pin_cascade[32];
|
|
|
|
+
|
|
|
|
+#define PINTER0_PHYS 0xe69000a0
|
|
|
|
+#define PINTER1_PHYS 0xe69000a4
|
|
|
|
+#define PINTER0_VIRT IOMEM(0xe69000a0)
|
|
|
|
+#define PINTER1_VIRT IOMEM(0xe69000a4)
|
|
|
|
+#define PINTRR0 IOMEM(0xe69000d0)
|
|
|
|
+#define PINTRR1 IOMEM(0xe69000d4)
|
|
|
|
+
|