From 732825eb2cfcf60143e2a21634549ce709f1d9b7 Mon Sep 17 00:00:00 2001 From: Ye Li Date: Mon, 10 Sep 2018 23:03:55 -0700 Subject: [PATCH] MLK-19526-5 imx8mq: Power down core 2/3 for iMX8MD CPU 2/3 are fused on iMX8MD, power down the two cores in SPL to save power. Signed-off-by: Ye Li Reviewed-by: Peng Fan (cherry picked from commit 0fc24973f5f8d32d0925bf0cf1eb3d8b75ae18b4) --- arch/arm/include/asm/arch-imx8m/imx-regs-imx8mq.h | 9 +++++++++ arch/arm/mach-imx/imx8m/soc.c | 11 +++++++++++ 2 files changed, 20 insertions(+) diff --git a/arch/arm/include/asm/arch-imx8m/imx-regs-imx8mq.h b/arch/arm/include/asm/arch-imx8m/imx-regs-imx8mq.h index c7b910424f..8772d61b2f 100644 --- a/arch/arm/include/asm/arch-imx8m/imx-regs-imx8mq.h +++ b/arch/arm/include/asm/arch-imx8m/imx-regs-imx8mq.h @@ -459,6 +459,15 @@ struct gpc_reg { u32 slt19_cfg_pu; }; +struct pgc_reg { + u32 pgcr; + u32 pgpupscr; + u32 pgpdnscr; + u32 pgsr; + u32 pgauxsw; + u32 pgdr; +}; + #define WDOG_WDT_MASK BIT(3) #define WDOG_WDZST_MASK BIT(0) struct wdog_regs { diff --git a/arch/arm/mach-imx/imx8m/soc.c b/arch/arm/mach-imx/imx8m/soc.c index 87b2db44ae..243dde4189 100644 --- a/arch/arm/mach-imx/imx8m/soc.c +++ b/arch/arm/mach-imx/imx8m/soc.c @@ -241,6 +241,17 @@ int arch_cpu_init(void) if (IS_ENABLED(CONFIG_SPL_BUILD)) { clock_init(); imx_set_wdog_powerdown(false); + + if (is_imx8md()) { + /* Power down cpu core 2 and 3 for iMX8MD */ + struct pgc_reg *pgc_core2 = (struct pgc_reg *)(GPC_BASE_ADDR + 0x880); + struct pgc_reg *pgc_core3 = (struct pgc_reg *)(GPC_BASE_ADDR + 0x8C0); + struct gpc_reg *gpc = (struct gpc_reg *)GPC_BASE_ADDR; + + writel(0x1, &pgc_core2->pgcr); + writel(0x1, &pgc_core3->pgcr); + writel(0xC, &gpc->cpu_pgc_dn_trg); + } } #ifdef CONFIG_IMX_SEC_INIT -- 2.17.1