diff mbox series

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

Message ID 20211023150343.26260-1-lukma@denx.de
State Superseded
Delegated to: Stefano Babic
Headers show
Series [v1] arm: xea: Modify board code to generate single binary u-boot | expand

Commit Message

Lukasz Majewski Oct. 23, 2021, 3:03 p.m. UTC
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:

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.

Signed-off-by: Lukasz Majewski <lukma@denx.de>

---

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

Comments

Simon Glass Oct. 31, 2021, 11:47 p.m. UTC | #1
Hi Lukasz,

On Sat, 23 Oct 2021 at 09:04, Lukasz Majewski <lukma@denx.de> wrote:
>
> 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:

Something is missing here.

>
> 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.
>
> Signed-off-by: Lukasz Majewski <lukma@denx.de>
>
> ---
>
>  board/liebherr/xea/spl_xea.c | 7 +++++++
>  board/liebherr/xea/xea.c     | 2 +-
>  2 files changed, 8 insertions(+), 1 deletion(-)

Could you add a Kconifig to control this feature and add something to
the board docs?

Regards,
Simon
Lukasz Majewski Nov. 1, 2021, 11:42 a.m. UTC | #2
Hi Simon,

> Hi Lukasz,
> 
> On Sat, 23 Oct 2021 at 09:04, Lukasz Majewski <lukma@denx.de> wrote:
> >
> > 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:  
> 
> Something is missing here.

I've posted the v2 of this patch with this information added.

> 
> >
> > 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.
> >
> > Signed-off-by: Lukasz Majewski <lukma@denx.de>
> >
> > ---
> >
> >  board/liebherr/xea/spl_xea.c | 7 +++++++
> >  board/liebherr/xea/xea.c     | 2 +-
> >  2 files changed, 8 insertions(+), 1 deletion(-)  
> 
> Could you add a Kconifig to control this feature and add something to
> the board docs?

This don't need any special Kconfig option. You just undefine the
CONFIG_SPL_FRAMEWORK, and that's all.

As fair as I can tell - the CONFIG_SPL_FRAMEWORK option is used with
for example imx28evk board. The issue here is that imx28 SoC needs
u-boot.sb to boot up when USB is used to debrick it (this is somewhat
the legacy approach with a single binary u-boot).

> 
> Regards,
> Simon




Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma@denx.de
diff mbox series

Patch

diff --git a/board/liebherr/xea/spl_xea.c b/board/liebherr/xea/spl_xea.c
index 192f68fca5f..92ba08248b4 100644
--- a/board/liebherr/xea/spl_xea.c
+++ b/board/liebherr/xea/spl_xea.c
@@ -290,6 +290,7 @@  u32 mxs_dram_vals[] = {
 	0x00000000, 0xffffffff
 };
 
+#if CONFIG_IS_ENABLED(SPL_FRAMEWORK)
 void lowlevel_init(void)
 {
 	struct mxs_pinctrl_regs *pinctrl_regs =
@@ -301,3 +302,9 @@  void lowlevel_init(void)
 
 	mxs_common_spl_init(0, NULL, iomux_setup, ARRAY_SIZE(iomux_setup));
 }
+#else
+void board_init_ll(const u32 arg, const uint32_t *resptr)
+{
+	mxs_common_spl_init(arg, resptr, iomux_setup, ARRAY_SIZE(iomux_setup));
+}
+#endif
diff --git a/board/liebherr/xea/xea.c b/board/liebherr/xea/xea.c
index cd11b0ada77..4437f9cb265 100644
--- a/board/liebherr/xea/xea.c
+++ b/board/liebherr/xea/xea.c
@@ -58,7 +58,7 @@  static void init_clocks(void)
 	mxs_set_sspclk(MXC_SSPCLK3, 96000, 0);
 }
 
-#ifdef CONFIG_SPL_BUILD
+#if defined CONFIG_SPL_BUILD && defined CONFIG_SPL_FRAMEWORK
 void board_init_f(ulong arg)
 {
 	init_clocks();