Skip to contentSkip to conversation

imx: syscounter: allow timer_init for SPL build

PATCH New Oleksandr Suvorov 2 participants 2 messages Aug 3, 2023 – Oct 16, 2023

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 imx: syscounter: allow timer_init for SPL build

From: Michael Scott <[email protected]>

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")

---

Changes in v3:
- add Reviewed-by from https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/

Changes in v2:
- rebased on top of a2ac2b964b ("Convert CONFIG_SKIP_LOWLEVEL_INIT et al to Kconfig")

 arch/arm/mach-imx/syscounter.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/mach-imx/syscounter.c +1 -1
index 129efac6fa6..16df1186759 100644
@@ -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;
Signature · 1 line
2.40.1
#1 lore raw

PATCH v3 1/1 imx: syscounter: allow timer_init for SPL build

Quoted 10 lines

From: Michael Scott <[email protected]>
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")

Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,        Managing Director: Erika Unter  
HRB 165235 Munich,   Office: Kirchenstr.5, 82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: [email protected]
=====================================================================