summaryrefslogtreecommitdiff
path: root/drivers/irqchip/irq-gic-v3.c
diff options
context:
space:
mode:
authorBai Ping <ping.bai@nxp.com>2017-11-08 17:48:47 +0800
committerJason Liu <jason.hui.liu@nxp.com>2019-02-12 10:29:08 +0800
commitd3244056f749c0ce590a671e215eb39fff336fc2 (patch)
treef0c1ac729b7b43196a4c8b0da8d5b1b790fa4975 /drivers/irqchip/irq-gic-v3.c
parent9a9a5d33b86722994640787e419771ef1ef3e7c5 (diff)
MLK-16804-04 driver: irqchip: Add IPI SW workaround for imx8mq
On i.MX8MQ, when the CPU core is in power down state, the IPI can NOT wakeup the core anymore(ERR011171), so using the external IRQ32 to wakeup the core in power down idle state successfully. Signed-off-by: Bai Ping <ping.bai@nxp.com> Reviewed-by: Anson Huang <anson.huang@nxp.com>
Diffstat (limited to 'drivers/irqchip/irq-gic-v3.c')
-rw-r--r--drivers/irqchip/irq-gic-v3.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c
index 3d7374655587..d4093cd24a1e 100644
--- a/drivers/irqchip/irq-gic-v3.c
+++ b/drivers/irqchip/irq-gic-v3.c
@@ -62,6 +62,8 @@ struct gic_chip_data {
static struct gic_chip_data gic_data __read_mostly;
static struct static_key supports_deactivate = STATIC_KEY_INIT_TRUE;
+static void __iomem *iomuxc_gpr_base;
+
static struct gic_kvm_info gic_v3_kvm_info;
#define gic_data_rdist() (this_cpu_ptr(gic_data.rdists.rdist))
@@ -652,6 +654,7 @@ static void gic_send_sgi(u64 cluster_id, u16 tlist, unsigned int irq)
static void gic_raise_softirq(const struct cpumask *mask, unsigned int irq)
{
int cpu;
+ u32 val;
if (WARN_ON(irq >= 16))
return;
@@ -668,8 +671,18 @@ static void gic_raise_softirq(const struct cpumask *mask, unsigned int irq)
tlist = gic_compute_target_list(&cpu, mask, cluster_id);
gic_send_sgi(cluster_id, tlist, irq);
- }
+ if (iomuxc_gpr_base) {
+ /* pending the IRQ32 to wakeup the core */
+ val = readl_relaxed(iomuxc_gpr_base + 0x4);
+ val |= (1 << 12);
+ writel_relaxed(val, iomuxc_gpr_base + 0x4);
+ /* delay for a while to make sure cores wakeup done */
+ udelay(50);
+ val &= ~(1 << 12);
+ writel_relaxed(val, iomuxc_gpr_base + 0x4);
+ }
+ }
/* Force the above writes to ICC_SGI1R_EL1 to be executed */
isb();
}
@@ -1222,6 +1235,9 @@ static int __init gic_of_init(struct device_node *node, struct device_node *pare
rdist_regs[i].phys_base = res.start;
}
+ /* sw workaround for IPI can't wakeup CORE ERRATA(ERR011171) on i.MX8MQ */
+ iomuxc_gpr_base = of_iomap(node, 2);
+
if (of_property_read_u64(node, "redistributor-stride", &redist_stride))
redist_stride = 0;