[PATCH 2/2] ARM: i.MX8MM: move system counter enabling into imx8mm_cpu_lowlevel_init

Ahmad Fatoum a.fatoum at pengutronix.de
Fri Jan 29 10:25:54 EST 2021


From: Ahmad Fatoum <ahmad at a3f.at>

Other i.MX8MM boards will likely need this as well, so just move it
into the helper and while at it, rewrite it using
imx8m_ccgr_clock_enable, which is defined as:

  void __iomem *ccm = IOMEM(MX8M_CCM_BASE_ADDR);

  writel(IMX8M_CCM_CCGR_SETTINGn_NEEDED(0),
    ccm + IMX8M_CCM_CCGRn_SET(index));

No functional change.

Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
---
 arch/arm/boards/nxp-imx8mm-evk/lowlevel.c | 5 -----
 arch/arm/mach-imx/cpu_init.c              | 4 ++++
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/arch/arm/boards/nxp-imx8mm-evk/lowlevel.c b/arch/arm/boards/nxp-imx8mm-evk/lowlevel.c
index 2297dc01e77f..4bd29c226912 100644
--- a/arch/arm/boards/nxp-imx8mm-evk/lowlevel.c
+++ b/arch/arm/boards/nxp-imx8mm-evk/lowlevel.c
@@ -172,11 +172,6 @@ static __noreturn noinline void nxp_imx8mm_evk_start(void)
 
 ENTRY_FUNCTION(start_nxp_imx8mm_evk, r0, r1, r2)
 {
-	void __iomem *ccm = IOMEM(MX8M_CCM_BASE_ADDR);
-
-	writel(IMX8M_CCM_CCGR_SETTINGn_NEEDED(0),
-	       ccm + IMX8M_CCM_CCGRn_SET(IMX8M_CCM_CCGR_SCTR));
-
 	imx8mm_cpu_lowlevel_init();
 
 	relocate_to_current_adr();
diff --git a/arch/arm/mach-imx/cpu_init.c b/arch/arm/mach-imx/cpu_init.c
index cc7a409e373a..9d86353e2255 100644
--- a/arch/arm/mach-imx/cpu_init.c
+++ b/arch/arm/mach-imx/cpu_init.c
@@ -20,6 +20,7 @@
 #include <mach/generic.h>
 #include <mach/imx7-regs.h>
 #include <mach/imx8mq-regs.h>
+#include <mach/imx8m-ccm-regs.h>
 #include <common.h>
 #include <io.h>
 #include <asm/syscounter.h>
@@ -79,6 +80,9 @@ static void imx8m_cpu_lowlevel_init(void)
 
 void imx8mm_cpu_lowlevel_init(void)
 {
+	/* ungate system counter */
+	imx8m_ccgr_clock_enable(IMX8M_CCM_CCGR_SCTR);
+
 	imx8m_cpu_lowlevel_init();
 }
 
-- 
2.30.0




More information about the barebox mailing list