Skip to content

Commit e690053

Browse files
Ondrej Jirmanmripard
authored andcommitted
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. Fixes: 6961275 ("ARM: sun8i: smp: Add support for A83T") Signed-off-by: Ondrej Jirman <[email protected]> Acked-by: Chen-Yu Tsai <[email protected]> Cc: [email protected] Signed-off-by: Maxime Ripard <[email protected]>
1 parent e614f34 commit e690053

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

arch/arm/mach-sunxi/mc_smp.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -481,14 +481,18 @@ static void sunxi_mc_smp_cpu_die(unsigned int l_cpu)
481481
static int sunxi_cpu_powerdown(unsigned int cpu, unsigned int cluster)
482482
{
483483
u32 reg;
484+
int gating_bit = cpu;
484485

485486
pr_debug("%s: cluster %u cpu %u\n", __func__, cluster, cpu);
486487
if (cpu >= SUNXI_CPUS_PER_CLUSTER || cluster >= SUNXI_NR_CLUSTERS)
487488
return -EINVAL;
488489

490+
if (is_a83t && cpu == 0)
491+
gating_bit = 4;
492+
489493
/* gate processor power */
490494
reg = readl(prcm_base + PRCM_PWROFF_GATING_REG(cluster));
491-
reg |= PRCM_PWROFF_GATING_REG_CORE(cpu);
495+
reg |= PRCM_PWROFF_GATING_REG_CORE(gating_bit);
492496
writel(reg, prcm_base + PRCM_PWROFF_GATING_REG(cluster));
493497
udelay(20);
494498

0 commit comments

Comments
 (0)