Skip to content
Snippets Groups Projects
Commit dab8af15 authored by Bai Ping's avatar Bai Ping Committed by Leonard Crestez
Browse files

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: default avatarBai Ping <ping.bai@nxp.com>
Reviewed-by: default avatarAnson Huang <anson.huang@nxp.com>
(cherry picked from commit d3244056)
parent ef3b3a0a
No related branches found
No related tags found
No related merge requests found
...@@ -63,6 +63,8 @@ struct gic_chip_data { ...@@ -63,6 +63,8 @@ struct gic_chip_data {
static struct gic_chip_data gic_data __read_mostly; static struct gic_chip_data gic_data __read_mostly;
static DEFINE_STATIC_KEY_TRUE(supports_deactivate_key); static DEFINE_STATIC_KEY_TRUE(supports_deactivate_key);
static void __iomem *iomuxc_gpr_base;
static struct gic_kvm_info gic_v3_kvm_info; static struct gic_kvm_info gic_v3_kvm_info;
static DEFINE_PER_CPU(bool, has_rss); static DEFINE_PER_CPU(bool, has_rss);
...@@ -741,6 +743,7 @@ static void gic_send_sgi(u64 cluster_id, u16 tlist, unsigned int irq) ...@@ -741,6 +743,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) static void gic_raise_softirq(const struct cpumask *mask, unsigned int irq)
{ {
int cpu; int cpu;
u32 val;
if (WARN_ON(irq >= 16)) if (WARN_ON(irq >= 16))
return; return;
...@@ -757,8 +760,18 @@ static void gic_raise_softirq(const struct cpumask *mask, unsigned int irq) ...@@ -757,8 +760,18 @@ static void gic_raise_softirq(const struct cpumask *mask, unsigned int irq)
tlist = gic_compute_target_list(&cpu, mask, cluster_id); tlist = gic_compute_target_list(&cpu, mask, cluster_id);
gic_send_sgi(cluster_id, tlist, irq); 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 */ /* Force the above writes to ICC_SGI1R_EL1 to be executed */
isb(); isb();
} }
...@@ -1314,6 +1327,9 @@ static int __init gic_of_init(struct device_node *node, struct device_node *pare ...@@ -1314,6 +1327,9 @@ static int __init gic_of_init(struct device_node *node, struct device_node *pare
rdist_regs[i].phys_base = res.start; 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)) if (of_property_read_u64(node, "redistributor-stride", &redist_stride))
redist_stride = 0; redist_stride = 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment