From: Peng Fan Date: Tue, 27 Aug 2019 06:25:37 +0000 (+0000) Subject: imx8m: soc: enable SCTR clock before timer init X-Git-Url: http://git.dujemihanovic.xyz/?a=commitdiff_plain;h=0528ba0e1c4f879278d597b1aeaf1bf31a943f75;p=u-boot.git imx8m: soc: enable SCTR clock before timer init To i.MX8MM SCTR clock is disabled by ROM, so before timer init need to enable it. To i.MX8MQ, it does not hurt the clock is enabled again. Signed-off-by: Peng Fan --- diff --git a/arch/arm/mach-imx/imx8m/soc.c b/arch/arm/mach-imx/imx8m/soc.c index a33ca35653..ac80266010 100644 --- a/arch/arm/mach-imx/imx8m/soc.c +++ b/arch/arm/mach-imx/imx8m/soc.c @@ -231,6 +231,12 @@ static void imx_set_wdog_powerdown(bool enable) int arch_cpu_init(void) { struct ocotp_regs *ocotp = (struct ocotp_regs *)OCOTP_BASE_ADDR; + /* + * ROM might disable clock for SCTR, + * enable the clock before timer_init. + */ + if (IS_ENABLED(CONFIG_SPL_BUILD)) + clock_enable(CCGR_SCTR, 1); /* * Init timer at very early state, because sscg pll setting * will use it