From patchwork Tue Feb 21 17:51:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: mohamed.omarasaker@arm.com X-Patchwork-Id: 19947 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 73365C636D7 for ; Tue, 21 Feb 2023 17:51:48 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web11.49516.1677001898525774868 for ; Tue, 21 Feb 2023 09:51:38 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: mohamed.omarasaker@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 F3E301655; Tue, 21 Feb 2023 09:52:20 -0800 (PST) Received: from e126544.cambridge.arm.com (unknown [10.1.199.74]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 665A33F881; Tue, 21 Feb 2023 09:51:37 -0800 (PST) From: mohamed.omarasaker@arm.com To: meta-arm@lists.yoctoproject.org, Ross.Burton@arm.com Cc: nd@arm.com, Mohamed Omar Asaker Subject: [PATCH 1/2] arm-bsp/trusted-firmware-m:corstone1000: Increase number of assets Date: Tue, 21 Feb 2023 17:51:28 +0000 Message-Id: <20230221175129.308197-2-mohamed.omarasaker@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230221175129.308197-1-mohamed.omarasaker@arm.com> References: <20230221175129.308197-1-mohamed.omarasaker@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 ; Tue, 21 Feb 2023 17:51:48 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/meta-arm/message/4434 From: Mohamed Omar Asaker As Corstone1000 stores at boot time few efi variables. Therefore, number of assets is increased to compansate this early usage. Note: Adding platform customized configs to config_tfm.h More information see: https://tf-m-user-guide.trustedfirmware.org/configuration/header_file_system.html Signed-off-by: Mohamed Omar Asaker --- ...rstone1000-Increase-number-of-assets.patch | 38 +++++++++++++++++++ .../trusted-firmware-m-1.7.0-corstone1000.inc | 5 +++ 2 files changed, 43 insertions(+) create mode 100644 meta-arm-bsp/recipes-bsp/trusted-firmware-m/files/corstone1000/0001-Platform-corstone1000-Increase-number-of-assets.patch diff --git a/meta-arm-bsp/recipes-bsp/trusted-firmware-m/files/corstone1000/0001-Platform-corstone1000-Increase-number-of-assets.patch b/meta-arm-bsp/recipes-bsp/trusted-firmware-m/files/corstone1000/0001-Platform-corstone1000-Increase-number-of-assets.patch new file mode 100644 index 00000000..f0368b84 --- /dev/null +++ b/meta-arm-bsp/recipes-bsp/trusted-firmware-m/files/corstone1000/0001-Platform-corstone1000-Increase-number-of-assets.patch @@ -0,0 +1,38 @@ +From decb355247c4ba4b876997f55c27ec3f55dbacd2 Mon Sep 17 00:00:00 2001 +From: Mohamed Omar Asaker +Date: Mon, 23 Jan 2023 13:25:28 +0000 +Subject: [PATCH] Platform: corstone1000: Increase number of assets + +As Corstone1000 stores at boot time few efi variables. +Therefore, number of assets is increased to compansate this early usage. + +Note: Adding platform customized configs to config_tfm.h + More information see: +https://tf-m-user-guide.trustedfirmware.org/configuration/header_file_system.html + +Signed-off-by: Mohamed Omar Asaker +Upstream-Status: Pending [Not submitted yet] +--- + platform/ext/target/arm/corstone1000/config_tfm_target.h | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/platform/ext/target/arm/corstone1000/config_tfm_target.h b/platform/ext/target/arm/corstone1000/config_tfm_target.h +index bf8d2f95f7..e968366639 100644 +--- a/platform/ext/target/arm/corstone1000/config_tfm_target.h ++++ b/platform/ext/target/arm/corstone1000/config_tfm_target.h +@@ -16,4 +16,12 @@ + #undef PLATFORM_SERVICE_OUTPUT_BUFFER_SIZE + #define PLATFORM_SERVICE_OUTPUT_BUFFER_SIZE 256 + ++/* The maximum number of assets to be stored in the Internal Trusted Storage. */ ++#undef ITS_NUM_ASSETS ++#define ITS_NUM_ASSETS 20 ++ ++/* The maximum number of assets to be stored in the Protected Storage area. */ ++#undef PS_NUM_ASSETS ++#define PS_NUM_ASSETS 20 ++ + #endif /* __CONFIG_TFM_TARGET_H__ */ +-- +2.25.1 + diff --git a/meta-arm-bsp/recipes-bsp/trusted-firmware-m/trusted-firmware-m-1.7.0-corstone1000.inc b/meta-arm-bsp/recipes-bsp/trusted-firmware-m/trusted-firmware-m-1.7.0-corstone1000.inc index 279109e0..ee35a253 100644 --- a/meta-arm-bsp/recipes-bsp/trusted-firmware-m/trusted-firmware-m-1.7.0-corstone1000.inc +++ b/meta-arm-bsp/recipes-bsp/trusted-firmware-m/trusted-firmware-m-1.7.0-corstone1000.inc @@ -26,6 +26,11 @@ SRCREV_openamp = "347397decaa43372fc4d00f965640ebde042966d" EXTRA_OECMAKE += "-DLIBOPENAMP_SRC_PATH=${S}/../openamp -DLIBOPENAMP_BIN_PATH=${B}/libopenamp-build" +FILESEXTRAPATHS:prepend := "${THISDIR}/files:" +SRC_URI:append= " \ + file://0001-Platform-corstone1000-Increase-number-of-assets.patch \ + " + do_install() { install -D -p -m 0644 ${B}/install/outputs/tfm_s_signed.bin ${D}/firmware/tfm_s_signed.bin install -D -p -m 0644 ${B}/install/outputs/bl2_signed.bin ${D}/firmware/bl2_signed.bin From patchwork Tue Feb 21 17:51:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: mohamed.omarasaker@arm.com X-Patchwork-Id: 19948 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 7FD72C61DA3 for ; Tue, 21 Feb 2023 17:51:48 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.48757.1677001899787276403 for ; Tue, 21 Feb 2023 09:51:39 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: mohamed.omarasaker@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 D5FE81650; Tue, 21 Feb 2023 09:52:21 -0800 (PST) Received: from e126544.cambridge.arm.com (unknown [10.1.199.74]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 484B63F881; Tue, 21 Feb 2023 09:51:38 -0800 (PST) From: mohamed.omarasaker@arm.com To: meta-arm@lists.yoctoproject.org, Ross.Burton@arm.com Cc: nd@arm.com, Mohamed Omar Asaker Subject: [PATCH 2/2] arm-bsp/trusted-firmware-m:corstone1000: Set SPM backend to IPC Date: Tue, 21 Feb 2023 17:51:29 +0000 Message-Id: <20230221175129.308197-3-mohamed.omarasaker@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230221175129.308197-1-mohamed.omarasaker@arm.com> References: <20230221175129.308197-1-mohamed.omarasaker@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 ; Tue, 21 Feb 2023 17:51:48 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/meta-arm/message/4435 From: Mohamed Omar Asaker TF-M provides IPC as a SPM backend which gives SPM and each Secure Partition it's own execution context. And provides higher isolation levels. corstone1000 isolation level is 2. Hence, switching to IPC backend. Signed-off-by: Mohamed Omar Asaker --- .../trusted-firmware-m-1.7.0-corstone1000.inc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/meta-arm-bsp/recipes-bsp/trusted-firmware-m/trusted-firmware-m-1.7.0-corstone1000.inc b/meta-arm-bsp/recipes-bsp/trusted-firmware-m/trusted-firmware-m-1.7.0-corstone1000.inc index ee35a253..d89aca37 100644 --- a/meta-arm-bsp/recipes-bsp/trusted-firmware-m/trusted-firmware-m-1.7.0-corstone1000.inc +++ b/meta-arm-bsp/recipes-bsp/trusted-firmware-m/trusted-firmware-m-1.7.0-corstone1000.inc @@ -11,6 +11,9 @@ TFM_PLATFORM_IS_FVP ?= "FALSE" EXTRA_OECMAKE += "-DPLATFORM_IS_FVP=${TFM_PLATFORM_IS_FVP}" EXTRA_OECMAKE += "-DCC312_LEGACY_DRIVER_API_ENABLED=OFF" +## Setting SPM backend to IPC +EXTRA_OECMAKE += "-DCONFIG_TFM_SPM_BACKEND=IPC" + # libmetal LICENSE += "& BSD-3-Clause" LIC_FILES_CHKSUM += "file://../libmetal/LICENSE.md;md5=fe0b8a4beea8f0813b606d15a3df3d3c"