diff mbox series

[v2] imx: syscounter: allow timer_init for SPL build

Message ID 20211013192903.370968-1-oleksandr.suvorov@foundries.io
State Not Applicable
Delegated to: Stefano Babic
Headers show
Series [v2] imx: syscounter: allow timer_init for SPL build | expand

Commit Message

Oleksandr Suvorov Oct. 13, 2021, 7:29 p.m. UTC
From: Michael Scott <mike@foundries.io>

If we enable SPL and SKIP_LOWLEVEL_INIT, this results in the weak
function timer_init() being used in the SPL build. This is not
desirable as on iMX6 SoC, MMC will then fail once u-boot proper is
booted due to timing issue.

Fixes: be277c3a89 ("imx: mx7: avoid some initialization if low level is skipped")
Signed-off-by: Michael Scott <mike@foundries.io>
Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@foundries.io>
---

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(-)
diff mbox series

Patch

diff --git a/arch/arm/mach-imx/syscounter.c b/arch/arm/mach-imx/syscounter.c
index 7c02e199a3..058369d5ea 100644
--- a/arch/arm/mach-imx/syscounter.c
+++ b/arch/arm/mach-imx/syscounter.c
@@ -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;