Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Sergey Matyukevich <geomatsi@gmail.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH v2 5/6] boot/arm-trusted-firmware: add EDK2 as BL33 option
Date: Mon, 27 Jul 2020 11:24:44 +0300	[thread overview]
Message-ID: <20200727082444.GB1615@curiosity> (raw)
In-Reply-To: <20200726100541.7710-6-hi@senzilla.io>

> ARM Trusted Firmware (ATF) has the ability to load EDK2 UEFI when dropping
> into EL2. This is done via a new configuration option that build the BL33
> payload with EDK2 images that will run in the EL2 context.
> 
> Signed-off-by: Dick Olsson <hi@senzilla.io>
> 
> ---
> 
> Revision 2:
> 
>  * It was concluded that relying on variables from EDK2 is ok
>   since they are expanded inside _BUILD_CMDS
>  * Now relying on the more specific variable EDK2_EL2_NAME for BL33
> ---
>  boot/arm-trusted-firmware/Config.in               | 15 ++++++++++++++-
>  boot/arm-trusted-firmware/arm-trusted-firmware.mk |  8 ++++++++
>  2 files changed, 22 insertions(+), 1 deletion(-)
> 
> diff --git a/boot/arm-trusted-firmware/Config.in b/boot/arm-trusted-firmware/Config.in
> index 7d0f6aa4e0..f24813f8e6 100644
> --- a/boot/arm-trusted-firmware/Config.in
> +++ b/boot/arm-trusted-firmware/Config.in
> @@ -1,7 +1,7 @@
>  config BR2_TARGET_ARM_TRUSTED_FIRMWARE
>  	bool "ARM Trusted Firmware (ATF)"
>  	depends on (BR2_ARM_CPU_ARMV8A || BR2_ARM_CPU_ARMV7A) && \
> -           BR2_TARGET_UBOOT
> +           (BR2_TARGET_UBOOT || BR2_TARGET_EDK2)
>  	help
>  	  Enable this option if you want to build the ATF for your ARM
>  	  based embedded device.
> @@ -115,6 +115,19 @@ config BR2_TARGET_ARM_TRUSTED_FIRMWARE_BL32_OPTEE
>  
>  endchoice
>  
> +config BR2_TARGET_ARM_TRUSTED_FIRMWARE_EDK2_AS_BL33
> +	bool "Use EDK2 as BL33"
> +	depends on BR2_TARGET_EDK2
> +	help
> +	  This option allows to embed EDK2 as the BL33 part of
> +	  the ARM Trusted Firmware. It ensures that the EDK2 package
> +	  gets built before ATF, and that the appropriate BL33
> +	  variable pointing to the EDK2 is passed when building ATF.
> +
> +	  Do not choose this option if you intend to build ATF and EDK2
> +	  for the 'qemu_sbsa' platform. In this case, due to the EDK2
> +	  build system, the dependency between ATF and EDK is reversed.

Is it possible to 'automate' this restriction by some Config.in rule,
e.g. depends on !BR2_TARGET_EDK2_PLATFORM_QEMU_SBSA ?

> +
>  config BR2_TARGET_ARM_TRUSTED_FIRMWARE_UBOOT_AS_BL33
>  	bool "Use U-Boot as BL33"
>  	depends on BR2_TARGET_UBOOT
> diff --git a/boot/arm-trusted-firmware/arm-trusted-firmware.mk b/boot/arm-trusted-firmware/arm-trusted-firmware.mk
> index a3553e36cf..51a5877ba1 100644
> --- a/boot/arm-trusted-firmware/arm-trusted-firmware.mk
> +++ b/boot/arm-trusted-firmware/arm-trusted-firmware.mk
> @@ -79,6 +79,14 @@ ARM_TRUSTED_FIRMWARE_MAKE_OPTS += AARCH32_SP=optee
>  endif
>  endif # BR2_TARGET_ARM_TRUSTED_FIRMWARE_BL32_OPTEE
>  
> +ifeq ($(BR2_TARGET_ARM_TRUSTED_FIRMWARE_EDK2_AS_BL33),y)
> +ARM_TRUSTED_FIRMWARE_DEPENDENCIES += edk2
> +# Since the flash device name vary between platforms, we use the variable
> +# provided by the EDK2 package for this. Using this variable here is OK
> +# as it will expand after all dependencies are resolved, inside _BUILD_CMDS.
> +ARM_TRUSTED_FIRMWARE_MAKE_OPTS += BL33=$(BINARIES_DIR)/$(EDK2_EL2_NAME).fd
> +endif
> +
>  ifeq ($(BR2_TARGET_ARM_TRUSTED_FIRMWARE_UBOOT_AS_BL33),y)
>  ARM_TRUSTED_FIRMWARE_UBOOT_BIN = $(call qstrip,$(BR2_TARGET_ARM_TRUSTED_FIRMWARE_UBOOT_BL33_IMAGE))
>  ARM_TRUSTED_FIRMWARE_MAKE_OPTS += BL33=$(BINARIES_DIR)/$(ARM_TRUSTED_FIRMWARE_UBOOT_BIN)

This option is not added but not used in this patch series. I see that
it should not be added for SBSA reference platform since in that case
EDK2 embeds ATF binaries.

Is it prepared for the upcoming new boards or is it supposed to be used
by aarch64_efi_defconfig ? In the latter case ATF as well as this new
BL33 option has to be explicitly specified in board config.

Regards,
Sergey

  reply	other threads:[~2020-07-27  8:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-26 10:07 [Buildroot] [PATCH v2 5/6] boot/arm-trusted-firmware: add EDK2 as BL33 option D. Olsson
2020-07-27  8:24 ` Sergey Matyukevich [this message]
2020-07-31 12:00   ` D. Olsson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200727082444.GB1615@curiosity \
    --to=geomatsi@gmail.com \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox