ARM: sunxi: Fix CPU powerdown on A83T
PATCH 1/1 ARM: sunxi: Fix CPU powerdown on A83T
PRCM_PWROFF_GATING_REG has CPU0 at bit 4 on A83T. So without this patch, instead of gating the CPU0, the whole cluster was power gated, when shutting down first CPU in the cluster.
--- arch/arm/mach-sunxi/mc_smp.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
arch/arm/mach-sunxi/mc_smp.c +5 -1
@@ -481,14 +481,18 @@ static void sunxi_mc_smp_cpu_die(unsigned int l_cpu)static int sunxi_cpu_powerdown (unsigned int cpu,unsigned int cluster) {u32 reg; +int gating_bit = cpu;pr_debug ("%s: cluster %u cpu %u\n" , __func__, cluster, cpu);if (cpu >=SUNXI_CPUS_PER_CLUSTER || cluster >=SUNXI_NR_CLUSTERS )return -EINVAL ; +if (is_a83t && cpu ==0 ) + gating_bit =4 ; +/* gate processor power */ reg =readl (prcm_base +PRCM_PWROFF_GATING_REG (cluster)); - reg |=PRCM_PWROFF_GATING_REG_CORE (cpu); + reg |=PRCM_PWROFF_GATING_REG_CORE (gating_bit);writel (reg, prcm_base +PRCM_PWROFF_GATING_REG (cluster));udelay (20 );
Signature · 1 line
2.23.0
Quoted 8 lines · Ondrej Jirman
PRCM_PWROFF_GATING_REGhas CPU0 at bit 4 on A83T. So without this patch, instead of gating the CPU0, the whole cluster was power gated, when shutting down first CPU in the cluster.Fixes 6961275e72a8c1 ("ARM: sun8i: smp: Add support for A83T")Signed-off-by Ondrej Jirman <[email protected]>
Though I distinctly remember the BSP had some code dealing with chip revisions in which the two bits were reversed. :(
Quoted 6 lines · Chen-Yu Tsai
Quoted 5 lines · Ondrej Jirman
PRCM_PWROFF_GATING_REGhas CPU0 at bit 4 on A83T. So without this patch, instead of gating the CPU0, the whole cluster was power gated, when shutting down first CPU in the cluster.
Quoted 8 lines
Quoted 3 lines
Fixes 6961275e72a8c1 ("ARM: sun8i: smp: Add support for A83T")Signed-off-by Ondrej Jirman <[email protected]>Acked-by Chen-Yu Tsai <[email protected]>Though I distinctly remember the BSP had some code dealing with chip revisions in which the two bits were reversed. :(
Actually, it's a bit more complicated. There's a special check in BSP code (grep for SUN8IW6P1_REV_A) that instead of power gating, just holds the core in reset for that revision.
regards,
o.
Maxime Ripard
AppliedQuoted 7 lines · Ondrej Jirman
PRCM_PWROFF_GATING_REGhas CPU0 at bit 4 on A83T. So without this patch, instead of gating the CPU0, the whole cluster was power gated, when shutting down first CPU in the cluster.Fixes 6961275e72a8c1 ("ARM: sun8i: smp: Add support for A83T")Signed-off-by Ondrej Jirman <[email protected]>
Applied, thanks
Maxime