]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
imx: syscounter: allow timer_init for SPL build
authorMichael Scott <mike@foundries.io>
Thu, 3 Aug 2023 15:25:20 +0000 (18:25 +0300)
committerStefano Babic <sbabic@denx.de>
Mon, 16 Oct 2023 06:46:01 +0000 (08:46 +0200)
With enabled SKIP_LOWLEVEL_INIT, the weak function timer_init() is
used in the SPL build. For iMX6 SoC, this leads MMC to fail once
u-boot proper is booted due to a timing issue.
Always use iMX-specific timer_init() in SPL to fix timing issues.

Fixes: be277c3a89 ("imx: mx7: avoid some initialization if low level is skipped")
Signed-off-by: Michael Scott <mike@foundries.io>
Co-developed-by: Oleksandr Suvorov <oleksandr.suvorov@foundries.io>
Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@foundries.io>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
arch/arm/mach-imx/syscounter.c

index 129efac6fa699b2335fb9e7e9388e1524a07a106..16df1186759e9a0393ded38c1ffd7719dfc74555 100644 (file)
@@ -59,7 +59,7 @@ static inline unsigned long long us_to_tick(unsigned long long usec)
        return usec;
 }
 
-#if !CONFIG_IS_ENABLED(SKIP_LOWLEVEL_INIT)
+#if !CONFIG_IS_ENABLED(SKIP_LOWLEVEL_INIT) || IS_ENABLED(CONFIG_SPL_BUILD)
 int timer_init(void)
 {
        struct sctr_regs *sctr = (struct sctr_regs *)SCTR_BASE_ADDR;