From patchwork Thu Jun 30 09:43:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Johnston X-Patchwork-Id: 9675 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4201AC433EF for ; Thu, 30 Jun 2022 09:44:10 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web08.23032.1656582243327455959 for ; Thu, 30 Jun 2022 02:44:03 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: adam.johnston@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 2D5E51042; Thu, 30 Jun 2022 02:44:03 -0700 (PDT) Received: from e114993.cambridge.arm.com (e114993.cambridge.arm.com [10.1.194.52]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 4AB963F5A1; Thu, 30 Jun 2022 02:44:02 -0700 (PDT) From: adam.johnston@arm.com To: meta-arm@lists.yoctoproject.org, Ross.Burton@arm.com Cc: nd@arm.com, Adam Johnston Subject: [PATCH 1/4] arm-bsp/n1sdp: revert "fix boot due to TF-A 2.7 update" Date: Thu, 30 Jun 2022 10:43:30 +0100 Message-Id: <20220630094333.3738129-2-adam.johnston@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220630094333.3738129-1-adam.johnston@arm.com> References: <20220630094333.3738129-1-adam.johnston@arm.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 30 Jun 2022 09:44:10 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/meta-arm/message/3543 From: Adam Johnston This reverts commit ea3479c27c5e67a1c1a5680d2abb8ecd22e5777f. Signed-off-by: Adam Johnston --- meta-arm-bsp/conf/machine/n1sdp.conf | 2 -- .../trusted-firmware-a_2.6.bbappend | 8 -------- .../trusted-firmware-a/trusted-firmware-a_2.6.bb | 12 ------------ 3 files changed, 22 deletions(-) delete mode 100644 meta-arm-bsp/recipes-bsp/trusted-firmware-a/trusted-firmware-a_2.6.bbappend delete mode 100644 meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a_2.6.bb diff --git a/meta-arm-bsp/conf/machine/n1sdp.conf b/meta-arm-bsp/conf/machine/n1sdp.conf index 5423618c..5e87e61d 100644 --- a/meta-arm-bsp/conf/machine/n1sdp.conf +++ b/meta-arm-bsp/conf/machine/n1sdp.conf @@ -25,8 +25,6 @@ PREFERRED_VERSION_linux-yocto ?= "5.15%" MACHINE_ESSENTIAL_EXTRA_RDEPENDS += "linux-firmware-rtl8168" EXTRA_IMAGEDEPENDS += "trusted-firmware-a" -PREFERRED_VERSION_trusted-firmware-a = "2.6" - EXTRA_IMAGEDEPENDS += "virtual/control-processor-firmware" #UEFI EDK2 firmware diff --git a/meta-arm-bsp/recipes-bsp/trusted-firmware-a/trusted-firmware-a_2.6.bbappend b/meta-arm-bsp/recipes-bsp/trusted-firmware-a/trusted-firmware-a_2.6.bbappend deleted file mode 100644 index ad02f40d..00000000 --- a/meta-arm-bsp/recipes-bsp/trusted-firmware-a/trusted-firmware-a_2.6.bbappend +++ /dev/null @@ -1,8 +0,0 @@ -FILESEXTRAPATHS:prepend := "${THISDIR}/files/:" - -# Machine specific TFAs - -MACHINE_TFA_REQUIRE ?= "" -MACHINE_TFA_REQUIRE:n1sdp = "trusted-firmware-a-n1sdp.inc" - -require ${MACHINE_TFA_REQUIRE} diff --git a/meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a_2.6.bb b/meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a_2.6.bb deleted file mode 100644 index ec1bec95..00000000 --- a/meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a_2.6.bb +++ /dev/null @@ -1,12 +0,0 @@ -require trusted-firmware-a.inc - -# TF-A v2.6 -SRCREV_tfa = "a1f02f4f3daae7e21ee58b4c93ec3e46b8f28d15" - -LIC_FILES_CHKSUM += "file://docs/license.rst;md5=b2c740efedc159745b9b31f88ff03dde" - -# mbed TLS v2.26.0 -SRC_URI_MBEDTLS = "git://github.com/ARMmbed/mbedtls.git;name=mbedtls;protocol=https;destsuffix=git/mbedtls;branch=master" -SRCREV_mbedtls = "e483a77c85e1f9c1dd2eb1c5a8f552d2617fe400" - -LIC_FILES_CHKSUM_MBEDTLS = "file://mbedtls/LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57" From patchwork Thu Jun 30 09:43:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Johnston X-Patchwork-Id: 9678 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 42512C433EF for ; Thu, 30 Jun 2022 09:44:20 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web09.23225.1656582253036912361 for ; Thu, 30 Jun 2022 02:44:13 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: adam.johnston@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id E839E1042; Thu, 30 Jun 2022 02:44:12 -0700 (PDT) Received: from e114993.cambridge.arm.com (e114993.cambridge.arm.com [10.1.194.52]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 10B3F3F5A1; Thu, 30 Jun 2022 02:44:11 -0700 (PDT) From: adam.johnston@arm.com To: meta-arm@lists.yoctoproject.org, Ross.Burton@arm.com Cc: nd@arm.com, Adam Johnston Subject: [PATCH 2/4] arm-bsp/trusted-firmware-a: N1SDP trusted boot Date: Thu, 30 Jun 2022 10:43:31 +0100 Message-Id: <20220630094333.3738129-3-adam.johnston@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220630094333.3738129-1-adam.johnston@arm.com> References: <20220630094333.3738129-1-adam.johnston@arm.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 30 Jun 2022 09:44:20 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/meta-arm/message/3544 From: Adam Johnston This commit configures trusted-firmware-a for TBBR bootflow on N1SDP as follows: * Trusted boot is enabled. * Generation of root-of-trust is enabled * All TB images (BLx, DTBs) are built * uefi.bin is specified as the BL33 image * BL2, BL31, BL33 are signed and stored in the FIP * N1SDP platform sources are patched to increase max size BL2 and reduce max size of BL1 Signed-off-by: Adam Johnston --- .../files/n1sdp/bl_size.patch | 40 +++++++++++++++++++ .../trusted-firmware-a-n1sdp.inc | 21 ++++++++-- 2 files changed, 58 insertions(+), 3 deletions(-) create mode 100644 meta-arm-bsp/recipes-bsp/trusted-firmware-a/files/n1sdp/bl_size.patch diff --git a/meta-arm-bsp/recipes-bsp/trusted-firmware-a/files/n1sdp/bl_size.patch b/meta-arm-bsp/recipes-bsp/trusted-firmware-a/files/n1sdp/bl_size.patch new file mode 100644 index 00000000..a5b30195 --- /dev/null +++ b/meta-arm-bsp/recipes-bsp/trusted-firmware-a/files/n1sdp/bl_size.patch @@ -0,0 +1,40 @@ +From 80b1efa92486a87f9e82dbf665ef612291148de8 Mon Sep 17 00:00:00 2001 +From: Adam Johnston +Date: Tue, 14 Jun 2022 11:19:30 +0000 +Subject: [PATCH] arm-bsp/trusted-firmware-a: N1SDP trusted boot + +Increase max size of BL2 on N1SDP by 4KB to enable trusted boot +Decrease max size of BL1 on N1SDP by 8KB so BL1/BL2 fits above BL31 progbits + +Signed-off-by: Adam Johnston +Upstream-Status: Pending [Flagged to upstream] + +--- + plat/arm/board/n1sdp/include/platform_def.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/plat/arm/board/n1sdp/include/platform_def.h b/plat/arm/board/n1sdp/include/platform_def.h +index c9b81bafa..7468a31ed 100644 +--- a/plat/arm/board/n1sdp/include/platform_def.h ++++ b/plat/arm/board/n1sdp/include/platform_def.h +@@ -91,7 +91,7 @@ + * PLAT_ARM_MAX_BL1_RW_SIZE is calculated using the current BL1 RW debug size + * plus a little space for growth. + */ +-#define PLAT_ARM_MAX_BL1_RW_SIZE 0xE000 ++#define PLAT_ARM_MAX_BL1_RW_SIZE 0xC000 + + /* + * PLAT_ARM_MAX_ROMLIB_RW_SIZE is define to use a full page +@@ -110,7 +110,7 @@ + * little space for growth. + */ + #if TRUSTED_BOARD_BOOT +-# define PLAT_ARM_MAX_BL2_SIZE 0x20000 ++# define PLAT_ARM_MAX_BL2_SIZE 0x21000 + #else + # define PLAT_ARM_MAX_BL2_SIZE 0x14000 + #endif +-- +2.35.1 + diff --git a/meta-arm-bsp/recipes-bsp/trusted-firmware-a/trusted-firmware-a-n1sdp.inc b/meta-arm-bsp/recipes-bsp/trusted-firmware-a/trusted-firmware-a-n1sdp.inc index 112fac8b..f8a0b8d5 100644 --- a/meta-arm-bsp/recipes-bsp/trusted-firmware-a/trusted-firmware-a-n1sdp.inc +++ b/meta-arm-bsp/recipes-bsp/trusted-firmware-a/trusted-firmware-a-n1sdp.inc @@ -2,8 +2,23 @@ COMPATIBLE_MACHINE = "n1sdp" TFA_PLATFORM = "n1sdp" -TFA_BUILD_TARGET = "bl31 dtbs" -TFA_INSTALL_TARGET = "bl31 n1sdp-multi-chip n1sdp-single-chip" +TFA_BUILD_TARGET = "all fip" +TFA_INSTALL_TARGET = "bl1 bl2 bl31 n1sdp-multi-chip n1sdp-single-chip n1sdp_fw_config n1sdp_tb_fw_config fip" TFA_DEBUG = "1" -TFA_MBEDTLS = "0" +TFA_MBEDTLS = "1" TFA_UBOOT = "0" +TFA_UEFI = "1" + +SRC_URI:append = " file://bl_size.patch" + +TFA_ROT_KEY= "plat/arm/board/common/rotpk/arm_rotprivk_rsa.pem" + +EXTRA_OEMAKE:append = "\ + TRUSTED_BOARD_BOOT=1 \ + GENERATE_COT=1 \ + CREATE_KEYS=1 \ + ENABLE_PIE=0 \ + ARM_ROTPK_LOCATION="devel_rsa" \ + ROT_KEY="${TFA_ROT_KEY}" \ + BL33=${RECIPE_SYSROOT}/firmware/uefi.bin \ + " From patchwork Thu Jun 30 09:43:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Johnston X-Patchwork-Id: 9676 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3C104C43334 for ; Thu, 30 Jun 2022 09:44:20 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web08.23035.1656582255382067421 for ; Thu, 30 Jun 2022 02:44:15 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: adam.johnston@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 416FD1042; Thu, 30 Jun 2022 02:44:15 -0700 (PDT) Received: from e114993.cambridge.arm.com (e114993.cambridge.arm.com [10.1.194.52]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 5E6703F5A1; Thu, 30 Jun 2022 02:44:14 -0700 (PDT) From: adam.johnston@arm.com To: meta-arm@lists.yoctoproject.org, Ross.Burton@arm.com Cc: nd@arm.com, Adam Johnston Subject: [PATCH 3/4] arm-bsp/scp-firmware: N1SDP trusted boot Date: Thu, 30 Jun 2022 10:43:32 +0100 Message-Id: <20220630094333.3738129-4-adam.johnston@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220630094333.3738129-1-adam.johnston@arm.com> References: <20220630094333.3738129-1-adam.johnston@arm.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 30 Jun 2022 09:44:20 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/meta-arm/message/3545 From: Adam Johnston This commit configures scp-firmware for TBBR bootflow as follows: * Updates SCP FW to master * BL31 replaced in the SCP firmware image with BL1 Signed-off-by: Adam Johnston --- .../recipes-bsp/scp-firmware/scp-firmware-n1sdp.inc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/meta-arm-bsp/recipes-bsp/scp-firmware/scp-firmware-n1sdp.inc b/meta-arm-bsp/recipes-bsp/scp-firmware/scp-firmware-n1sdp.inc index 0352539a..e66469c3 100644 --- a/meta-arm-bsp/recipes-bsp/scp-firmware/scp-firmware-n1sdp.inc +++ b/meta-arm-bsp/recipes-bsp/scp-firmware/scp-firmware-n1sdp.inc @@ -3,6 +3,10 @@ SCP_PLATFORM = "n1sdp" SCP_LOG_LEVEL = "INFO" +# master branch at n1sdp: Introduce trusted board boot +SRCREV = "3e4c34ceccc1c960eb3a4adaa922f2a0c6b36be3" +PV .= "+git${SRCPV}" + COMPATIBLE_MACHINE:n1sdp = "n1sdp" DEPENDS += "fiptool-native" @@ -12,7 +16,7 @@ do_install:append() { fiptool \ create \ --scp-fw "${D}/firmware/scp_ramfw.bin" \ - --soc-fw "${RECIPE_SYSROOT}/firmware/bl31.bin" \ + --blob uuid=cfacc2c4-15e8-4668-82be-430a38fad705,file="${RECIPE_SYSROOT}/firmware/bl1.bin" \ "scp_fw.bin" # This UUID is FIP_UUID_MCP_BL2 in SCP-Firmware. From patchwork Thu Jun 30 09:43:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Johnston X-Patchwork-Id: 9677 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 401B6CCA47B for ; Thu, 30 Jun 2022 09:44:20 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web12.23162.1656582257687356305 for ; Thu, 30 Jun 2022 02:44:17 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: adam.johnston@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 9EB771042; Thu, 30 Jun 2022 02:44:17 -0700 (PDT) Received: from e114993.cambridge.arm.com (e114993.cambridge.arm.com [10.1.194.52]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B97043F5A1; Thu, 30 Jun 2022 02:44:16 -0700 (PDT) From: adam.johnston@arm.com To: meta-arm@lists.yoctoproject.org, Ross.Burton@arm.com Cc: nd@arm.com, Adam Johnston Subject: [PATCH 4/4] arm-bsp/sdcard-image-n1sdp: N1SDP trusted boot Date: Thu, 30 Jun 2022 10:43:33 +0100 Message-Id: <20220630094333.3738129-5-adam.johnston@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220630094333.3738129-1-adam.johnston@arm.com> References: <20220630094333.3738129-1-adam.johnston@arm.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 30 Jun 2022 09:44:20 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/meta-arm/message/3546 From: Adam Johnston This commit configures N1SDP firmware for TBBR bootflow as follows: * uefi.bin replaced with with fip.bin * load address adjusted for FIP image Signed-off-by: Adam Johnston --- .../recipes-bsp/images/sdcard-image-n1sdp_0.1.bb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/meta-arm-bsp/recipes-bsp/images/sdcard-image-n1sdp_0.1.bb b/meta-arm-bsp/recipes-bsp/images/sdcard-image-n1sdp_0.1.bb index 6f74159c..84498a63 100644 --- a/meta-arm-bsp/recipes-bsp/images/sdcard-image-n1sdp_0.1.bb +++ b/meta-arm-bsp/recipes-bsp/images/sdcard-image-n1sdp_0.1.bb @@ -27,8 +27,8 @@ prepare_package() { cp -av ${RECIPE_SYSROOT}/${FIRMWARE_DIR}/* ${PRIMARY_DIR} mkdir -p ${PRIMARY_DIR}/SOFTWARE/ - # Copy uefi binary - cp -v ${RECIPE_SYSROOT}/firmware/uefi.bin ${PRIMARY_DIR}/SOFTWARE/ + # Copy FIP binary + cp -v ${RECIPE_SYSROOT}/firmware/fip.bin ${PRIMARY_DIR}/SOFTWARE/ # Copy SOC binaries for f in ${SOC_BINARIES}; do @@ -42,6 +42,11 @@ prepare_package() { sed -i -e 's|.*SOCCON: 0x1170.*PLATFORM_CTRL.*|SOCCON: 0x1170 0x00000100 ;SoC SCC PLATFORM_CTRL|' \ ${PRIMARY_DIR}/MB/HBI0316A/io_v123f.txt + # Update load address for trusted boot + sed -i -e '/^IMAGE4ADDRESS:/ s|0x60200000|0x64200000|' ${PRIMARY_DIR}/MB/HBI0316A/images.txt + sed -i -e '/^IMAGE4UPDATE:/ s|FORCE |SCP_AUTO|' ${PRIMARY_DIR}/MB/HBI0316A/images.txt + sed -i -e '/^IMAGE4FILE: \\SOFTWARE\\/s|uefi.bin|fip.bin |' ${PRIMARY_DIR}/MB/HBI0316A/images.txt + # Slave/Secondary cp -av ${RECIPE_SYSROOT}/${FIRMWARE_DIR}/* ${SECONDARY_DIR} mkdir -p ${SECONDARY_DIR}/SOFTWARE/