Skip to contentSkip to conversation

arm: xea: Modify board code to generate single binary u-boot

PATCH Superseded Lukasz Majewski 2 participants 2 messages Oct 25, 2021 – Nov 2, 2021

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 arm: xea: Modify board code to generate single binary u-boot

This change provides the possibility to build XEA (imx287 based) board U-Boot as a single binary (without support for CONFIG_SPL_FRAMEWORK).

The generated u-boot.sb can be used in the factory environment to for example perform initial setup or HW testing.

It can be used with 'uuu' utility
(SDPS: boot -f /srv/tftp/xea/u-boot.sb)

In the configs/imx28_xea_defconfig one needs to disable following configs:
# CONFIG_SPL_BLK is not set
# CONFIG_SPL_FRAMEWORK is not set

The board_init_ll() is used in arch/arm/cpu/arm926ejs/mxs/start.S, which is utilized when CONFIG_SPL_FRAMEWORK is disabled.

However, when it is enabled - the arch/arm/cpu/arm926ejs/start.S is used, which requires the lowlevel_init() function.

---

Changes in v2:
- Use CONFIG_IS_ENABLED(FRAMEWORK) instead of #ifdef CONFIG_SPL_FRAMEWORK (previous version used CONFIG_IS_ENABLED(SPL_FRAMEWORK), which was wrong).
- Restructure spl_xea.c code to be more readable

 board/liebherr/xea/spl_xea.c | 8 ++++++++
 board/liebherr/xea/xea.c     | 3 ++-
 2 files changed, 10 insertions(+), 1 deletion(-)
board/liebherr/xea/spl_xea.c +8 -0
index 192f68fca5f..5ee561b8b78 100644
@@ -290,6 +290,13 @@ u32 mxs_dram_vals[] = {
 	0x00000000, 0xffffffff
 };
 
+/* #ifndef CONFIG_SPL_FRAMEWORK */
+#if !CONFIG_IS_ENABLED(FRAMEWORK)
+void board_init_ll(const u32 arg, const uint32_t *resptr)
+{
+	mxs_common_spl_init(arg, resptr, iomux_setup, ARRAY_SIZE(iomux_setup));
+}
+#else
 void lowlevel_init(void)
 {
 	struct mxs_pinctrl_regs *pinctrl_regs =
@@ -301,3 +308,4 @@ void lowlevel_init(void)
 
 	mxs_common_spl_init(0, NULL, iomux_setup, ARRAY_SIZE(iomux_setup));
 }
+#endif
board/liebherr/xea/xea.c +2 -1
index cd11b0ada77..685e2e26a18 100644
@@ -58,7 +58,8 @@ static void init_clocks(void)
 	mxs_set_sspclk(MXC_SSPCLK3, 96000, 0);
 }
 
-#ifdef CONFIG_SPL_BUILD
+/* #if CONFIG_SPL_BUILD && CONFIG_SPL_FRAMEWORK */
+#if CONFIG_IS_ENABLED(BUILD) && CONFIG_IS_ENABLED(FRAMEWORK)
 void board_init_f(ulong arg)
 {
 	init_clocks();
Signature · 1 line
2.20.1
Reviewed-by on v2 1/1
#1 lore raw
Quoted 30 lines · Lukasz Majewski

This change provides the possibility to build XEA (imx287 based) board U-Boot as a single binary (without support for CONFIG_SPL_FRAMEWORK).

The generated u-boot.sb can be used in the factory environment to for example perform initial setup or HW testing.

It can be used with 'uuu' utility
(SDPS: boot -f /srv/tftp/xea/u-boot.sb)

In the configs/imx28_xea_defconfig one needs to disable following configs:
# CONFIG_SPL_BLK is not set
# CONFIG_SPL_FRAMEWORK is not set

The board_init_ll() is used in arch/arm/cpu/arm926ejs/mxs/start.S, which is utilized when CONFIG_SPL_FRAMEWORK is disabled.

However, when it is enabled - the arch/arm/cpu/arm926ejs/start.S is used, which requires the lowlevel_init() function.

---

Changes in v2:
- Use CONFIG_IS_ENABLED(FRAMEWORK) instead of #ifdef CONFIG_SPL_FRAMEWORK (previous version used CONFIG_IS_ENABLED(SPL_FRAMEWORK), which was wrong).
- Restructure spl_xea.c code to be more readable

Quoted 3 lines
 board/liebherr/xea/spl_xea.c | 8 ++++++++
 board/liebherr/xea/xea.c     | 3 ++-
 2 files changed, 10 insertions(+), 1 deletion(-)