From patchwork Sun Jul 26 10:07:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "D. Olsson" X-Patchwork-Id: 1336457 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.136; helo=silver.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=reject dis=none) header.from=senzilla.io Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=senzilla.io header.i=@senzilla.io header.a=rsa-sha256 header.s=protonmail2 header.b=BkQQxOXk; dkim-atps=neutral Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BDzC00vcfz9sRK for ; Sun, 26 Jul 2020 20:07:40 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 8949720030; Sun, 26 Jul 2020 10:07:38 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Mw6fXuaJCrlV; Sun, 26 Jul 2020 10:07:37 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id EBE7C21539; Sun, 26 Jul 2020 10:07:36 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 996061BF4DD for ; Sun, 26 Jul 2020 10:07:35 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 7C3FF21539 for ; Sun, 26 Jul 2020 10:07:35 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id qGUhgA95wXmN for ; Sun, 26 Jul 2020 10:07:34 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail-40136.protonmail.ch (mail-40136.protonmail.ch [185.70.40.136]) by silver.osuosl.org (Postfix) with ESMTPS id 6FF2220030 for ; Sun, 26 Jul 2020 10:07:34 +0000 (UTC) Date: Sun, 26 Jul 2020 10:07:28 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=senzilla.io; s=protonmail2; t=1595758052; bh=PiXnTgjllOsK9z6o7BAc/zDva0XvbKgIPzCCOWvAQ2c=; h=Date:To:From:Cc:Reply-To:Subject:From; b=BkQQxOXk1bx0nnIxfyjucV55LodQNXjYzPqGXt2yOUD6y+u8cCVS32ywkJGjst5mD Sr0ywR7wrrDnoHI4N8Xmw84IZ0gjv05AlWavDjpdY0ZfHkTIYju0fehYADcm8k8FTv hXMQaQPfgpPEMwsK3TBjC9SGy8TA5nFDUqWwTIIwZtKLOchiki9EgdjFL6VdNv/kpI l+IIttD4HwLAPljp+q3qZQ7w2KbizM5SogHGurtAgAOg/sqYzeDy3hU3DfSavIQO/m O7GCw7deeD6V+NJlaIznr7tZ0641BqU+59mofuHzZD4+Vcm5x/QaXWJt4k6R0OIP30 JpWRh9NwkRIeA== To: buildroot@buildroot.org From: "D. Olsson" Message-ID: <20200726100541.7710-6-hi@senzilla.io> MIME-Version: 1.0 Subject: [Buildroot] [PATCH v2 5/6] boot/arm-trusted-firmware: add EDK2 as BL33 option X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: "D. Olsson" Cc: Sergey Matyukevich , Dick Olsson Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" From: Dick Olsson 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 --- 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. + 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)