Skip to contentSkip to conversation

arm: omap: Enable SPL_DM very early

PATCH New Lokesh Vutla 3 participants 13 messages Jun 27, 2017 – Jul 14, 2017

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

cover arm: omap: Enable SPL_DM very early

This series enables SPL_DM very early so that i2c, gpio can be used.

Lokesh Vutla (3):
arm: omap: Detect boot mode very early
arm: omap4+: Enable spl_early_init()
ARM: dts: OMAP5+: Enable gpio in SPL

 arch/arm/dts/omap5-u-boot.dtsi      | 8 ++++++++
 arch/arm/mach-omap2/am33xx/board.c  | 8 ++++++++
 arch/arm/mach-omap2/boot-common.c   | 7 -------
 arch/arm/mach-omap2/hwinit-common.c | 9 +++++++++
 4 files changed, 25 insertions(+), 7 deletions(-)
Signature · 1 line
2.13.0
#1 lore raw

PATCH 1/3 arm: omap: Detect boot mode very early

ROM stores the boot params information in a known location and passes it to SPL. This information needs to be copied very early during boot or else there is a chance of getting corrupted by SPL. So move this boot device detection very early during boot.

---
 arch/arm/mach-omap2/am33xx/board.c  | 8 ++++++++
 arch/arm/mach-omap2/boot-common.c   | 7 -------
 arch/arm/mach-omap2/hwinit-common.c | 8 ++++++++
 3 files changed, 16 insertions(+), 7 deletions(-)
arch/arm/mach-omap2/am33xx/board.c +8 -0
index 5f1bf9ce7c..db757d91fb 100644
@@ -333,6 +333,14 @@ void early_system_init(void)
 	set_uart_mux_conf();
 	setup_early_clocks();
 	uart_soft_reset();
+#ifdef CONFIG_SPL_BUILD
+	/*
+	 * Save the boot parameters passed from romcode.
+	 * We cannot delay the saving further than this,
+	 * to prevent overwrites.
+	 */
+	save_omap_boot_params();
+#endif
 #ifdef CONFIG_DEBUG_UART_OMAP
 	debug_uart_init();
 #endif
arch/arm/mach-omap2/boot-common.c +0 -7
index b77506df83..700e6c2f79 100644
@@ -195,13 +195,6 @@ u32 spl_boot_mode(const u32 boot_device)
 
 void spl_board_init(void)
 {
-	/*
-	 * Save the boot parameters passed from romcode.
-	 * We cannot delay the saving further than this,
-	 * to prevent overwrites.
-	 */
-	save_omap_boot_params();
-
 	/* Prepare console output */
 	preloader_console_init();
 
arch/arm/mach-omap2/hwinit-common.c +8 -0
index 7f6db3cf37..77368ee85f 100644
@@ -158,6 +158,14 @@ void early_system_init(void)
 	do_io_settings();
 #endif
 	setup_early_clocks();
+#ifdef CONFIG_SPL_BUILD
+	/*
+	 * Save the boot parameters passed from romcode.
+	 * We cannot delay the saving further than this,
+	 * to prevent overwrites.
+	 */
+	save_omap_boot_params();
+#endif
 	do_board_detect();
 	vcores_init();
 #ifdef CONFIG_DEBUG_UART_OMAP
Signature · 1 line
2.13.0
#2 lore raw

PATCH 1/3 arm: omap: Detect boot mode very early

Quoted 7 lines · Lokesh Vutla

ROM stores the boot params information in a known location and passes it to SPL. This information needs to be copied very early during boot or else there is a chance of getting corrupted by SPL. So move this boot device detection very early during boot.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170704/fc12e0db/attachment.sig>
#3 lore raw

PATCH 1/3 arm: omap: Detect boot mode very early

In reply to Lokesh Vutla
Quoted 8 lines · Lokesh Vutla

ROM stores the boot params information in a known location and passes it to SPL. This information needs to be copied very early during boot or else there is a chance of getting corrupted by SPL. So move this boot device detection very early during boot.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170711/2c1bb8c7/attachment.sig>
#4 lore raw

PATCH 1/3 arm: omap: Detect boot mode very early

Quoted 8 lines · Tom Rini
Quoted 6 lines · Lokesh Vutla

ROM stores the boot params information in a known location and passes it to SPL. This information needs to be copied very early during boot or else there is a chance of getting corrupted by SPL. So move this boot device detection very early during boot.

Quoted 5 lines
Quoted 2 lines

Applied to u-boot/master, thanks!

Master no longer boots my DM3730 (omap3_logic). Has anyone else had issues with their OMAP3 board? v2017.07 works and the bisect revealed:

4bd754d8abef61835d5da2ba0c65b2b0d3badec9 is the first bad commit commit 4bd754d8abef61835d5da2ba0c65b2b0d3badec9

Author: Lokesh Vutla <[email protected]>
Date:   Tue Jun 27 13:50:56 2017 +0530

arm: omap: Detect boot mode very early

ROM stores the boot params information in a known location and passes it to SPL. This information needs to be copied very early during boot or else there is a chance of getting corrupted by SPL. So move this boot device detection very early during boot.

:040000 040000 eba151d04f1f62d4acd83b7ba47f627956eab8fb b36ef87618be765d9a4986dd9a8b013b357f4611 M arch

Quoted 8 lines

--
Tom

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
https://lists.denx.de/listinfo/u-boot

#5 lore raw

PATCH 1/3 arm: omap: Detect boot mode very early

Quoted 32 lines · Adam Ford
Quoted 8 lines · Tom Rini
Quoted 6 lines · Lokesh Vutla

ROM stores the boot params information in a known location and passes it to SPL. This information needs to be copied very early during boot or else there is a chance of getting corrupted by SPL. So move this boot device detection very early during boot.

Quoted 5 lines
Quoted 2 lines

Applied to u-boot/master, thanks!

Master no longer boots my DM3730 (omap3_logic). Has anyone else had issues with their OMAP3 board? v2017.07 works and the bisect revealed:

4bd754d8abef61835d5da2ba0c65b2b0d3badec9 is the first bad commit commit 4bd754d8abef61835d5da2ba0c65b2b0d3badec9

Author: Lokesh Vutla <[email protected]>
Date:   Tue Jun 27 13:50:56 2017 +0530

arm: omap: Detect boot mode very early

ROM stores the boot params information in a known location and passes it to SPL. This information needs to be copied very early during boot or else there is a chance of getting corrupted by SPL. So move this boot device detection very early during boot.

Quoted 8 lines

:040000 040000 eba151d04f1f62d4acd83b7ba47f627956eab8fb b36ef87618be765d9a4986dd9a8b013b357f4611 M arch

The following patch appears to work, but I would like some feedback from TI guys. If that seems reasonable, I'll submit a more formal patch.

(quoted diff) +0 -0

b/arch/arm/mach-omap2/omap3/board.c
index cd8e302..f8db543 100644

arch/arm/mach-omap2/omap3/board.c +6 -0
@@ -212,6 +212,12 @@ void board_init_f(ulong dummy)
 {
        early_system_init();
        mem_init();
+       /*
+        * Save the boot parameters passed from romcode.
+        * We cannot delay the saving further than this,
+        * to prevent overwrites.
+        */
+       save_omap_boot_params();
 }
 #endif
 
Quoted 8 lines
Quoted 8 lines

--
Tom

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
https://lists.denx.de/listinfo/u-boot

#6 lore raw

PATCH 1/3 arm: omap: Detect boot mode very early

Quoted 42 lines · Adam Ford
Quoted 32 lines · Adam Ford
Quoted 8 lines · Tom Rini
Quoted 6 lines · Lokesh Vutla

ROM stores the boot params information in a known location and passes it to SPL. This information needs to be copied very early during boot or else there is a chance of getting corrupted by SPL. So move this boot device detection very early during boot.

Quoted 5 lines
Quoted 2 lines

Applied to u-boot/master, thanks!

Master no longer boots my DM3730 (omap3_logic). Has anyone else had issues with their OMAP3 board? v2017.07 works and the bisect revealed:

4bd754d8abef61835d5da2ba0c65b2b0d3badec9 is the first bad commit commit 4bd754d8abef61835d5da2ba0c65b2b0d3badec9

Author: Lokesh Vutla <[email protected]>
Date:   Tue Jun 27 13:50:56 2017 +0530

arm: omap: Detect boot mode very early

ROM stores the boot params information in a known location and passes it to SPL. This information needs to be copied very early during boot or else there is a chance of getting corrupted by SPL. So move this boot device detection very early during boot.

Quoted 8 lines

:040000 040000 eba151d04f1f62d4acd83b7ba47f627956eab8fb b36ef87618be765d9a4986dd9a8b013b357f4611 M arch

Quoted 4 lines

The following patch appears to work, but I would like some feedback from TI guys. If that seems reasonable, I'll submit a more formal patch.

Yeas, this looks good to me.

Thanks and regards,
Lokesh

Quoted 29 lines
arch/arm/mach-omap2/omap3/board.c +6 -0
index cd8e302..f8db543 100644
@@ -212,6 +212,12 @@ void board_init_f(ulong dummy)
 {
        early_system_init();
        mem_init();
+       /*
+        * Save the boot parameters passed from romcode.
+        * We cannot delay the saving further than this,
+        * to prevent overwrites.
+        */
+       save_omap_boot_params();
 }
 #endif
 
Quoted 10 lines
Quoted 10 lines

--
Tom

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
https://lists.denx.de/listinfo/u-boot

#7 lore raw

PATCH 2/3 arm: omap4+: Enable spl_early_init()

In reply to Lokesh Vutla

Enable spl_early_init() so that spl can use
DT very early during boot.

---
 arch/arm/mach-omap2/hwinit-common.c | 1 +
 1 file changed, 1 insertion(+)
arch/arm/mach-omap2/hwinit-common.c +1 -0
index 77368ee85f..7324d522ee 100644
@@ -165,6 +165,7 @@ void early_system_init(void)
 	 * to prevent overwrites.
 	 */
 	save_omap_boot_params();
+	spl_early_init();
 #endif
 	do_board_detect();
 	vcores_init();
Signature · 1 line
2.13.0
#8 lore raw

PATCH 2/3 arm: omap4+: Enable spl_early_init()

Quoted 4 lines · Lokesh Vutla

Enable spl_early_init() so that spl can use
DT very early during boot.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170704/e8a19632/attachment.sig>
#9 lore raw

PATCH 2/3 arm: omap4+: Enable spl_early_init()

In reply to Lokesh Vutla
Quoted 5 lines · Lokesh Vutla

Enable spl_early_init() so that spl can use
DT very early during boot.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170711/d852f7ce/attachment.sig>
#10 lore raw

PATCH 3/3 ARM: dts: OMAP5+: Enable gpio in SPL

In reply to Lokesh Vutla

gpio2 is used to detect lcd based on which pin mux is done in SPL. gpio7 is used to enable vtt regulator. Enable these two gpio nodes in SPL.

---
 arch/arm/dts/omap5-u-boot.dtsi | 8 ++++++++
 1 file changed, 8 insertions(+)
arch/arm/dts/omap5-u-boot.dtsi +8 -0
index 9f9b4d1683..17602909a6 100644
@@ -52,3 +52,11 @@
 		u-boot,dm-spl;
 	};
 };
+
+&gpio2 {
+	u-boot,dm-spl;
+};
+
+&gpio7 {
+	u-boot,dm-spl;
+};
Signature · 1 line
2.13.0
#11 lore raw

PATCH 3/3 ARM: dts: OMAP5+: Enable gpio in SPL

Quoted 5 lines · Lokesh Vutla

gpio2 is used to detect lcd based on which pin mux is done in SPL. gpio7 is used to enable vtt regulator. Enable these two gpio nodes in SPL.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170704/6942f837/attachment.sig>
#12 lore raw

PATCH 3/3 ARM: dts: OMAP5+: Enable gpio in SPL

In reply to Lokesh Vutla
Quoted 6 lines · Lokesh Vutla

gpio2 is used to detect lcd based on which pin mux is done in SPL. gpio7 is used to enable vtt regulator. Enable these two gpio nodes in SPL.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170711/264220ae/attachment.sig>