Skip to contentSkip to conversation

mx7ulp: soc: s_init should only be executed once

PATCH New Jorge Ramirez-Ortiz 4 participants 6 messages Jan 17, 2020 – Jan 20, 2020

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

PATCH 1/1 mx7ulp: soc: s_init should only be executed once

On SPL enabled systems, the current s_init code (wdog, clock and ldo init) is executed twice (by SPL and u-boot). This is not necessary and might lead to boot issues (ie, starting PMC1 when it is already running).

---
 arch/arm/mach-imx/mx7ulp/soc.c | 2 ++
 1 file changed, 2 insertions(+)
arch/arm/mach-imx/mx7ulp/soc.c +2 -0
index 8345b01398..316262f71b 100644
@@ -117,6 +117,7 @@ void init_wdog(void)
 	disable_wdog(WDG2_RBASE);
 }
 
+#if !defined(CONFIG_SPL) || (defined(CONFIG_SPL) && defined(CONFIG_SPL_BUILD))
 #if defined(CONFIG_LDO_ENABLED_MODE)
 static void init_ldo_mode(void)
 {
@@ -174,6 +175,7 @@ void s_init(void)
 #endif
 	return;
 }
+#endif
 
 #ifndef CONFIG_ULP_WATCHDOG
 void reset_cpu(ulong addr)
Signature · 1 line
2.17.1
reviewer
#1 lore raw

PATCH 1/1 mx7ulp: soc: s_init should only be executed once

Hi Jorge,

Quoted 6 lines · Jorge Ramirez-Ortiz

On SPL enabled systems, the current s_init code (wdog, clock and ldo init) is executed twice (by SPL and u-boot). This is not necessary and might lead to boot issues (ie, starting PMC1 when it is already running).

The target I use to test LDO-enabled mode does not use SPL, so that's why I did not notice the problem.

Thanks for the fix:

#2 lore raw

PATCH 1/1 mx7ulp: soc: s_init should only be executed once

Quoted 8 lines · Fabio Estevam

Hi Jorge,

Quoted 5 lines · Jorge Ramirez-Ortiz

On SPL enabled systems, the current s_init code (wdog, clock and ldo init) is executed twice (by SPL and u-boot). This is not necessary and might lead to boot issues (ie, starting PMC1 when it is already running).

Quoted 6 lines
Quoted 1 line

The target I use to test LDO-enabled mode does not use SPL, so that's why I did not notice the problem.

Thanks for the fix:

Hi Favio,

sorry I forgot to mention: this does not fix the issue I see when executing the LDO init code - that still locks when run from SPL or U-Boot. This commit is just because I noticed that s_init was being called twice (for SPL and U-Boot) and I dont think it makes sense.

Quoted 2 lines
#3 lore raw

PATCH 1/1 mx7ulp: soc: s_init should only be executed once

Quoted 14 lines · Gmail
Quoted 13 lines · Fabio Estevam

Hi Jorge,

Quoted 6 lines · Jorge Ramirez-Ortiz

On SPL enabled systems, the current s_init code (wdog, clock and ldo init) is executed twice (by SPL and u-boot). This is not necessary and might lead to boot issues (ie, starting PMC1 when it is already running).

The target I use to test LDO-enabled mode does not use SPL, so that's why I did not notice the problem.

Quoted 9 lines
Quoted 1 line

Thanks for the fix:

Hi Favio,

sorry I forgot to mention: this does not fix the issue I see when executing the LDO init code - that still locks when run from SPL or U-Boot. This commit is just because I noticed that s_init was being called twice (for SPL and U-Boot) and I dont think it makes sense.

Quoted 2 lines

hi Favio/all

plese could you confirm if this patch will be merged (just so we dont have to carry it separately in our product branches)

thanks!
Jorge

reviewer
#4 lore raw

PATCH 1/1 mx7ulp: soc: s_init should only be executed once

Hi Jorge,

Quoted 3 lines · Foundries

hi Favio/all

plese could you confirm if this patch will be merged (just so we dont have to carry it separately in our product branches)

Yes, I think it makes sense to apply it. I have already given my Reviewed-by tag.

#5 lore raw

PATCH 1/1 mx7ulp: soc: s_init should only be executed once

In reply to Jorge Ramirez-Ortiz
Quoted 5 lines

On SPL enabled systems, the current s_init code (wdog, clock and ldo init) is executed twice (by SPL and u-boot). This is not necessary and might lead to boot issues (ie, starting PMC1 when it is already running).

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

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================