[U-Boot] [PATCH 0/3] 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(-)

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.
Signed-off-by: Lokesh Vutla lokeshvutla@ti.com --- 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(-)
diff --git a/arch/arm/mach-omap2/am33xx/board.c b/arch/arm/mach-omap2/am33xx/board.c index 5f1bf9ce7c..db757d91fb 100644 --- a/arch/arm/mach-omap2/am33xx/board.c +++ b/arch/arm/mach-omap2/am33xx/board.c @@ -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 diff --git a/arch/arm/mach-omap2/boot-common.c b/arch/arm/mach-omap2/boot-common.c index b77506df83..700e6c2f79 100644 --- a/arch/arm/mach-omap2/boot-common.c +++ b/arch/arm/mach-omap2/boot-common.c @@ -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();
diff --git a/arch/arm/mach-omap2/hwinit-common.c b/arch/arm/mach-omap2/hwinit-common.c index 7f6db3cf37..77368ee85f 100644 --- a/arch/arm/mach-omap2/hwinit-common.c +++ b/arch/arm/mach-omap2/hwinit-common.c @@ -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

On Tue, Jun 27, 2017 at 01:50:56PM +0530, Lokesh Vutla wrote:
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.
Signed-off-by: Lokesh Vutla lokeshvutla@ti.com
Reviewed-by: Tom Rini trini@konsulko.com

On Tue, Jun 27, 2017 at 01:50:56PM +0530, Lokesh Vutla wrote:
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.
Signed-off-by: Lokesh Vutla lokeshvutla@ti.com Reviewed-by: Tom Rini trini@konsulko.com
Applied to u-boot/master, thanks!

On Tue, Jul 11, 2017 at 7:40 AM, Tom Rini trini@konsulko.com wrote:
On Tue, Jun 27, 2017 at 01:50:56PM +0530, Lokesh Vutla wrote:
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.
Signed-off-by: Lokesh Vutla lokeshvutla@ti.com Reviewed-by: Tom Rini trini@konsulko.com
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 lokeshvutla@ti.com 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.
Signed-off-by: Lokesh Vutla lokeshvutla@ti.com Reviewed-by: Tom Rini trini@konsulko.com
:040000 040000 eba151d04f1f62d4acd83b7ba47f627956eab8fb b36ef87618be765d9a4986dd9a8b013b357f4611 M arch
-- Tom
U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot

On Fri, Jul 14, 2017 at 6:35 AM, Adam Ford aford173@gmail.com wrote:
On Tue, Jul 11, 2017 at 7:40 AM, Tom Rini trini@konsulko.com wrote:
On Tue, Jun 27, 2017 at 01:50:56PM +0530, Lokesh Vutla wrote:
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.
Signed-off-by: Lokesh Vutla lokeshvutla@ti.com Reviewed-by: Tom Rini trini@konsulko.com
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 lokeshvutla@ti.com 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. Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com>
: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.
diff --git a/arch/arm/mach-omap2/omap3/board.c b/arch/arm/mach-omap2/omap3/board.c index cd8e302..f8db543 100644 --- a/arch/arm/mach-omap2/omap3/board.c +++ b/arch/arm/mach-omap2/omap3/board.c @@ -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
-- Tom
U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot

On 7/14/2017 6:30 PM, Adam Ford wrote:
On Fri, Jul 14, 2017 at 6:35 AM, Adam Ford aford173@gmail.com wrote:
On Tue, Jul 11, 2017 at 7:40 AM, Tom Rini trini@konsulko.com wrote:
On Tue, Jun 27, 2017 at 01:50:56PM +0530, Lokesh Vutla wrote:
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.
Signed-off-by: Lokesh Vutla lokeshvutla@ti.com Reviewed-by: Tom Rini trini@konsulko.com
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 lokeshvutla@ti.com 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. Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com>
: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.
Yeas, this looks good to me.
Reviewed-by: Lokesh Vutla lokeshvutla@ti.com
Thanks and regards, Lokesh
diff --git a/arch/arm/mach-omap2/omap3/board.c b/arch/arm/mach-omap2/omap3/board.c index cd8e302..f8db543 100644 --- a/arch/arm/mach-omap2/omap3/board.c +++ b/arch/arm/mach-omap2/omap3/board.c @@ -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
-- Tom
U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot

Enable spl_early_init() so that spl can use DT very early during boot.
Signed-off-by: Lokesh Vutla lokeshvutla@ti.com --- arch/arm/mach-omap2/hwinit-common.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/arch/arm/mach-omap2/hwinit-common.c b/arch/arm/mach-omap2/hwinit-common.c index 77368ee85f..7324d522ee 100644 --- a/arch/arm/mach-omap2/hwinit-common.c +++ b/arch/arm/mach-omap2/hwinit-common.c @@ -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();

On Tue, Jun 27, 2017 at 01:50:57PM +0530, Lokesh Vutla wrote:
Enable spl_early_init() so that spl can use DT very early during boot.
Signed-off-by: Lokesh Vutla lokeshvutla@ti.com
Reviewed-by: Tom Rini trini@konsulko.com

On Tue, Jun 27, 2017 at 01:50:57PM +0530, Lokesh Vutla wrote:
Enable spl_early_init() so that spl can use DT very early during boot.
Signed-off-by: Lokesh Vutla lokeshvutla@ti.com Reviewed-by: Tom Rini trini@konsulko.com
Applied to u-boot/master, thanks!

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.
Signed-off-by: Lokesh Vutla lokeshvutla@ti.com --- arch/arm/dts/omap5-u-boot.dtsi | 8 ++++++++ 1 file changed, 8 insertions(+)
diff --git a/arch/arm/dts/omap5-u-boot.dtsi b/arch/arm/dts/omap5-u-boot.dtsi index 9f9b4d1683..17602909a6 100644 --- a/arch/arm/dts/omap5-u-boot.dtsi +++ b/arch/arm/dts/omap5-u-boot.dtsi @@ -52,3 +52,11 @@ u-boot,dm-spl; }; }; + +&gpio2 { + u-boot,dm-spl; +}; + +&gpio7 { + u-boot,dm-spl; +};

On Tue, Jun 27, 2017 at 01:50:58PM +0530, Lokesh Vutla wrote:
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.
Signed-off-by: Lokesh Vutla lokeshvutla@ti.com
Reviewed-by: Tom Rini trini@konsulko.com

On Tue, Jun 27, 2017 at 01:50:58PM +0530, Lokesh Vutla wrote:
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.
Signed-off-by: Lokesh Vutla lokeshvutla@ti.com Reviewed-by: Tom Rini trini@konsulko.com
Applied to u-boot/master, thanks!
participants (3)
-
Adam Ford
-
Lokesh Vutla
-
Tom Rini