diff mbox series

[3/9] boot/arm-trusted-firmware: Add u-boot-dtb.bin support

Message ID 20191120040725.32207-4-jerry.huang@nxp.com
State Superseded
Headers show
Series new board ls1028ardb introduced | expand

Commit Message

Changming Huang Nov. 20, 2019, 4:07 a.m. UTC
NXP Layerscape platforms use u-boot-dtb.bin to boot the board.

Signed-off-by: Changming Huang <jerry.huang@nxp.com>
---
 boot/arm-trusted-firmware/arm-trusted-firmware.mk | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Sergey Matyukevich Nov. 20, 2019, 7:37 a.m. UTC | #1
> NXP Layerscape platforms use u-boot-dtb.bin to boot the board.
> 
> Signed-off-by: Changming Huang <jerry.huang@nxp.com>
> ---
>  boot/arm-trusted-firmware/arm-trusted-firmware.mk | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/boot/arm-trusted-firmware/arm-trusted-firmware.mk b/boot/arm-trusted-firmware/arm-trusted-firmware.mk
> index e528686aa1..70d36fff73 100644
> --- a/boot/arm-trusted-firmware/arm-trusted-firmware.mk
> +++ b/boot/arm-trusted-firmware/arm-trusted-firmware.mk
> @@ -70,7 +70,11 @@ endif
>  endif # BR2_TARGET_ARM_TRUSTED_FIRMWARE_BL32_OPTEE
>  
>  ifeq ($(BR2_TARGET_ARM_TRUSTED_FIRMWARE_UBOOT_AS_BL33),y)
> +ifeq ($(BR2_TARGET_UBOOT_FORMAT_DTB_BIN),y)
> +ARM_TRUSTED_FIRMWARE_MAKE_OPTS += BL33=$(BINARIES_DIR)/u-boot-dtb.bin
> +else
>  ARM_TRUSTED_FIRMWARE_MAKE_OPTS += BL33=$(BINARIES_DIR)/u-boot.bin
> +endif
>  ARM_TRUSTED_FIRMWARE_DEPENDENCIES += uboot
>  endif

Hi Jerry, Thomas, and all

Looks good, but probably we could make it a little bit more future-proof.
What do you think about using the same pattern-based approach here as
implemented in commit e4d276c357fdf9f19f99f8 (buildroot next branch)
for ATF firmware images.

In brief, to add option BR2_TARGET_ARM_TRUSTED_FIRMWARE_UBOOT_BL33_IMAGE
in arm-trusted-firmware Config.in and set its default value to u-boot.bin.
Then u-boot-dtb.bin value could be specified in the board defconfig.

Thoughts ? Comments ?

Regards,
Sergey
Changming Huang Nov. 20, 2019, 8:13 a.m. UTC | #2
Best Regards
Jerry Huang

> -----Original Message-----
> From: Sergey Matyukevich <geomatsi@gmail.com>
> Sent: Wednesday, November 20, 2019 3:38 PM
> To: Jerry Huang <jerry.huang@nxp.com>
> Cc: buildroot@busybox.net
> Subject: [EXT] Re: [Buildroot] [PATCH 3/9] boot/arm-trusted-firmware: Add
> u-boot-dtb.bin support
> 
> Caution: EXT Email
> 
> > NXP Layerscape platforms use u-boot-dtb.bin to boot the board.
> >
> > Signed-off-by: Changming Huang <jerry.huang@nxp.com>
> > ---
> >  boot/arm-trusted-firmware/arm-trusted-firmware.mk | 4 ++++
> >  1 file changed, 4 insertions(+)
> >
> > diff --git a/boot/arm-trusted-firmware/arm-trusted-firmware.mk
> > b/boot/arm-trusted-firmware/arm-trusted-firmware.mk
> > index e528686aa1..70d36fff73 100644
> > --- a/boot/arm-trusted-firmware/arm-trusted-firmware.mk
> > +++ b/boot/arm-trusted-firmware/arm-trusted-firmware.mk
> > @@ -70,7 +70,11 @@ endif
> >  endif # BR2_TARGET_ARM_TRUSTED_FIRMWARE_BL32_OPTEE
> >
> >  ifeq ($(BR2_TARGET_ARM_TRUSTED_FIRMWARE_UBOOT_AS_BL33),y)
> > +ifeq ($(BR2_TARGET_UBOOT_FORMAT_DTB_BIN),y)
> > +ARM_TRUSTED_FIRMWARE_MAKE_OPTS +=
> BL33=$(BINARIES_DIR)/u-boot-dtb.bin
> > +else
> >  ARM_TRUSTED_FIRMWARE_MAKE_OPTS +=
> BL33=$(BINARIES_DIR)/u-boot.bin
> > +endif
> >  ARM_TRUSTED_FIRMWARE_DEPENDENCIES += uboot  endif
> 
> Hi Jerry, Thomas, and all
> 
> Looks good, but probably we could make it a little bit more future-proof.
> What do you think about using the same pattern-based approach here as
> implemented in commit e4d276c357fdf9f19f99f8 (buildroot next branch) for ATF
> firmware images.
> 
> In brief, to add option
> BR2_TARGET_ARM_TRUSTED_FIRMWARE_UBOOT_BL33_IMAGE
> in arm-trusted-firmware Config.in and set its default value to u-boot.bin.
> Then u-boot-dtb.bin value could be specified in the board defconfig.
> 
> Thoughts ? Comments ?
>
That sound good for me.
May I draft the first version for that?

> Regards,
> Sergey
Thomas Petazzoni Nov. 20, 2019, 9:07 a.m. UTC | #3
Hello Sergey, Hello Jerry,

On Wed, 20 Nov 2019 10:37:54 +0300
Sergey Matyukevich <geomatsi@gmail.com> wrote:

> >  ifeq ($(BR2_TARGET_ARM_TRUSTED_FIRMWARE_UBOOT_AS_BL33),y)
> > +ifeq ($(BR2_TARGET_UBOOT_FORMAT_DTB_BIN),y)
> > +ARM_TRUSTED_FIRMWARE_MAKE_OPTS += BL33=$(BINARIES_DIR)/u-boot-dtb.bin
> > +else
> >  ARM_TRUSTED_FIRMWARE_MAKE_OPTS += BL33=$(BINARIES_DIR)/u-boot.bin
> > +endif
> >  ARM_TRUSTED_FIRMWARE_DEPENDENCIES += uboot
> >  endif  
> 
> Hi Jerry, Thomas, and all
> 
> Looks good, but probably we could make it a little bit more future-proof.
> What do you think about using the same pattern-based approach here as
> implemented in commit e4d276c357fdf9f19f99f8 (buildroot next branch)
> for ATF firmware images.
> 
> In brief, to add option BR2_TARGET_ARM_TRUSTED_FIRMWARE_UBOOT_BL33_IMAGE
> in arm-trusted-firmware Config.in and set its default value to u-boot.bin.
> Then u-boot-dtb.bin value could be specified in the board defconfig.

I was going to say that Jerry's solution looks better, as it's more
automatic for the user.

However, the selection of the U-Boot image format is not a Kconfig
"choice" in boot/uboot/Config.in: one can select multiple images. In
this case, how can ATF know which one to use ? Jerry's proposal is to
assume that if BR2_TARGET_UBOOT_FORMAT_DTB_BIN=y, then you want to use
u-boot-dtb.bin, but if there are multiple U-Boot images enabled, it's
indeed difficult to know which one to chose for ATF.

So, I agree with Sergey: probably the easiest is simply some free-form
string option, with a default to u-boot.bin to preserve backward
compatibility.

Best regards,

Thomas
diff mbox series

Patch

diff --git a/boot/arm-trusted-firmware/arm-trusted-firmware.mk b/boot/arm-trusted-firmware/arm-trusted-firmware.mk
index e528686aa1..70d36fff73 100644
--- a/boot/arm-trusted-firmware/arm-trusted-firmware.mk
+++ b/boot/arm-trusted-firmware/arm-trusted-firmware.mk
@@ -70,7 +70,11 @@  endif
 endif # BR2_TARGET_ARM_TRUSTED_FIRMWARE_BL32_OPTEE
 
 ifeq ($(BR2_TARGET_ARM_TRUSTED_FIRMWARE_UBOOT_AS_BL33),y)
+ifeq ($(BR2_TARGET_UBOOT_FORMAT_DTB_BIN),y)
+ARM_TRUSTED_FIRMWARE_MAKE_OPTS += BL33=$(BINARIES_DIR)/u-boot-dtb.bin
+else
 ARM_TRUSTED_FIRMWARE_MAKE_OPTS += BL33=$(BINARIES_DIR)/u-boot.bin
+endif
 ARM_TRUSTED_FIRMWARE_DEPENDENCIES += uboot
 endif