From patchwork Sun Sep 10 13:43:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jon Mason X-Patchwork-Id: 30250 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 A316EEE57CD for ; Sun, 10 Sep 2023 13:43:28 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.36169.1694353399157938637 for ; Sun, 10 Sep 2023 06:43:19 -0700 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: jon.mason@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 748CCD75 for ; Sun, 10 Sep 2023 06:43:55 -0700 (PDT) Received: from debian.lan?044arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id A273E3F64C for ; Sun, 10 Sep 2023 06:43:17 -0700 (PDT) From: Jon Mason To: meta-arm@lists.yoctoproject.org Subject: [PATCH 1/2] arm/sbsa-acs: update to v7.1.2 Date: Sun, 10 Sep 2023 08:43:12 -0500 Message-Id: <20230910134313.3735787-1-jon.mason@arm.com> X-Mailer: git-send-email 2.30.2 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 ; Sun, 10 Sep 2023 13:43:28 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/meta-arm/message/5025 Signed-off-by: Jon Mason --- .../sbsa-acs/0001-Fix-for-issue-245.patch | 46 ------------------- ...x-for-mismatch-in-function-prototype.patch | 31 +++++++++++++ ...0001-Fix-function-protype-mismatches.patch | 43 ----------------- ...in-the-paths-to-the-SBSA-test-suite.patch} | 2 +- ...2-Enforce-using-good-old-BFD-linker.patch} | 6 +-- .../{sbsa-acs_6.1.0.bb => sbsa-acs_7.1.2.bb} | 11 ++--- 6 files changed, 40 insertions(+), 99 deletions(-) delete mode 100644 meta-arm/recipes-bsp/uefi/sbsa-acs/0001-Fix-for-issue-245.patch create mode 100644 meta-arm/recipes-bsp/uefi/sbsa-acs/0001-Fix-for-mismatch-in-function-prototype.patch delete mode 100644 meta-arm/recipes-bsp/uefi/sbsa-acs/0001-Fix-function-protype-mismatches.patch rename meta-arm/recipes-bsp/uefi/sbsa-acs/{0002-Patch-in-the-paths-to-the-SBSA-test-suite.patch => 0001-Patch-in-the-paths-to-the-SBSA-test-suite.patch} (94%) rename meta-arm/recipes-bsp/uefi/sbsa-acs/{0003-Enforce-using-good-old-BFD-linker.patch => 0002-Enforce-using-good-old-BFD-linker.patch} (92%) rename meta-arm/recipes-bsp/uefi/{sbsa-acs_6.1.0.bb => sbsa-acs_7.1.2.bb} (71%) diff --git a/meta-arm/recipes-bsp/uefi/sbsa-acs/0001-Fix-for-issue-245.patch b/meta-arm/recipes-bsp/uefi/sbsa-acs/0001-Fix-for-issue-245.patch deleted file mode 100644 index 42bdf7d4..00000000 --- a/meta-arm/recipes-bsp/uefi/sbsa-acs/0001-Fix-for-issue-245.patch +++ /dev/null @@ -1,46 +0,0 @@ -From 096150fa19014b397a5d8f8d774bb8236ac37679 Mon Sep 17 00:00:00 2001 -From: Shyamanth RH -Date: Wed, 4 Jan 2023 13:08:35 +0530 -Subject: [PATCH] Fix for issue #245 - -* The change fixes the build issue observed in GCC 12.XX. -* Looks like GCC is confusing label to a local variable and hence triggers dangling-pointer error when a label addres is assigned to a pointer. -* Changed branch_to_test from void * pointer to uint64_t datatype since we just need the retrun address of the label while updating the ELR. This should suppress the dangling-pinter warning thrown by GCC 12.XX - -Signed-off-by: Shyamanth RH -Upstream-Status: Backport ---- - test_pool/peripherals/test_d003.c | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/test_pool/peripherals/test_d003.c b/test_pool/peripherals/test_d003.c -index 9f36e1f..0658a45 100755 ---- a/test_pool/peripherals/test_d003.c -+++ b/test_pool/peripherals/test_d003.c -@@ -30,7 +30,7 @@ - - static uint64_t l_uart_base; - static uint32_t int_id; --static void *branch_to_test; -+static uint64_t branch_to_test; - static uint32_t test_fail; - - static -@@ -40,7 +40,7 @@ esr(uint64_t interrupt_type, void *context) - uint32_t index = val_pe_get_index_mpid(val_pe_get_mpid()); - - /* Update the ELR to point to next instrcution */ -- val_pe_update_elr(context, (uint64_t)branch_to_test); -+ val_pe_update_elr(context, branch_to_test); - - val_print(AVS_PRINT_ERR, "\n Error : Received Sync Exception type %d", interrupt_type); - val_set_status(index, RESULT_FAIL(g_sbsa_level, TEST_NUM, 01)); -@@ -150,7 +150,7 @@ payload(void) - val_pe_install_esr(EXCEPT_AARCH64_SYNCHRONOUS_EXCEPTIONS, esr); - val_pe_install_esr(EXCEPT_AARCH64_SERROR, esr); - -- branch_to_test = &&exception_taken; -+ branch_to_test = (uint64_t)&&exception_taken; - - if (count == 0) { - val_print(AVS_PRINT_WARN, "\n No UART defined by Platform ", 0); diff --git a/meta-arm/recipes-bsp/uefi/sbsa-acs/0001-Fix-for-mismatch-in-function-prototype.patch b/meta-arm/recipes-bsp/uefi/sbsa-acs/0001-Fix-for-mismatch-in-function-prototype.patch new file mode 100644 index 00000000..0babf2fc --- /dev/null +++ b/meta-arm/recipes-bsp/uefi/sbsa-acs/0001-Fix-for-mismatch-in-function-prototype.patch @@ -0,0 +1,31 @@ +From 42cc39fdea21177e82b6cec138c06726242673f7 Mon Sep 17 00:00:00 2001 +From: Srikar Josyula +Date: Tue, 25 Jul 2023 12:55:04 +0530 +Subject: [PATCH] Fix for mismatch in function prototype + + - Mismatch between function prototype and definition + causing build failure with GCC 13.1.1 + - Fixed the function prototype for val_get_exerciser_err_info + +Signed-off-by: Srikar Josyula + +Upstream-Status: Backport +Signed-off-by: Jon Mason + +--- + val/include/sbsa_avs_exerciser.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/val/include/sbsa_avs_exerciser.h b/val/include/sbsa_avs_exerciser.h +index 4b2c62b089f5..7c0e3d0fb58f 100644 +--- a/val/include/sbsa_avs_exerciser.h ++++ b/val/include/sbsa_avs_exerciser.h +@@ -118,7 +118,7 @@ uint32_t val_exerciser_ops(EXERCISER_OPS ops, uint64_t param, uint32_t instance) + uint32_t val_exerciser_get_data(EXERCISER_DATA_TYPE type, exerciser_data_t *data, uint32_t instance); + uint32_t val_exerciser_execute_tests(uint32_t level); + uint32_t val_exerciser_get_bdf(uint32_t instance); +-uint32_t val_get_exerciser_err_info(uint32_t type); ++uint32_t val_get_exerciser_err_info(EXERCISER_ERROR_CODE type); + + uint32_t e001_entry(void); + uint32_t e002_entry(void); diff --git a/meta-arm/recipes-bsp/uefi/sbsa-acs/0001-Fix-function-protype-mismatches.patch b/meta-arm/recipes-bsp/uefi/sbsa-acs/0001-Fix-function-protype-mismatches.patch deleted file mode 100644 index f6039144..00000000 --- a/meta-arm/recipes-bsp/uefi/sbsa-acs/0001-Fix-function-protype-mismatches.patch +++ /dev/null @@ -1,43 +0,0 @@ -From df6006190f112a4ecc54ed0a35d3ea83a2350c73 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Thu, 2 Feb 2023 17:37:52 -0800 -Subject: [PATCH] Fix function protype mismatches - -These are flagged by gcc13 -avs_gic.c:241:1: error: conflicting types for 'val_gic_get_info' due to enum/integer mismatch; have 'uint32_t(uint32_t)' {aka 'unsigned int(unsigned int)'} [-Werror=enum-int-mismatch] -| 241 | val_gic_get_info(uint32_t type) -| | ^~~~~~~~~~~~~~~~ - -Signed-off-by: Khem Raj -Upstream-Status: Backport ---- - val/include/val_interface.h | 2 +- - val/src/avs_gic.c | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/val/include/val_interface.h b/val/include/val_interface.h -index 053fdfa..8814b41 100644 ---- a/val/include/val_interface.h -+++ b/val/include/val_interface.h -@@ -181,7 +181,7 @@ typedef enum { - void val_wd_create_info_table(uint64_t *wd_info_table); - void val_wd_free_info_table(void); - uint32_t val_wd_execute_tests(uint32_t level, uint32_t num_pe); --uint64_t val_wd_get_info(uint32_t index, uint32_t info_type); -+uint64_t val_wd_get_info(uint32_t index, WD_INFO_TYPE_e info_type); - uint32_t val_wd_set_ws0(uint32_t index, uint32_t timeout); - uint64_t val_get_counter_frequency(void); - -diff --git a/val/src/avs_gic.c b/val/src/avs_gic.c -index b37f106..1146a01 100644 ---- a/val/src/avs_gic.c -+++ b/val/src/avs_gic.c -@@ -249,7 +249,7 @@ val_get_cpuif_base(void) - @return 32-bit data - **/ - uint32_t --val_gic_get_info(uint32_t type) -+val_gic_get_info(GIC_INFO_e type) - { - uint32_t rdbase_len; - diff --git a/meta-arm/recipes-bsp/uefi/sbsa-acs/0002-Patch-in-the-paths-to-the-SBSA-test-suite.patch b/meta-arm/recipes-bsp/uefi/sbsa-acs/0001-Patch-in-the-paths-to-the-SBSA-test-suite.patch similarity index 94% rename from meta-arm/recipes-bsp/uefi/sbsa-acs/0002-Patch-in-the-paths-to-the-SBSA-test-suite.patch rename to meta-arm/recipes-bsp/uefi/sbsa-acs/0001-Patch-in-the-paths-to-the-SBSA-test-suite.patch index 0c784c6f..7b0b9b38 100644 --- a/meta-arm/recipes-bsp/uefi/sbsa-acs/0002-Patch-in-the-paths-to-the-SBSA-test-suite.patch +++ b/meta-arm/recipes-bsp/uefi/sbsa-acs/0001-Patch-in-the-paths-to-the-SBSA-test-suite.patch @@ -1,4 +1,4 @@ -From 90d705333521dd85720a17a29abf1aff1612c917 Mon Sep 17 00:00:00 2001 +From 97eb384fcc66326f93813ff14b998bb7336a4422 Mon Sep 17 00:00:00 2001 From: Ross Burton Date: Thu, 16 Feb 2023 21:53:25 +0000 Subject: [PATCH] Patch in the paths to the SBSA test suite diff --git a/meta-arm/recipes-bsp/uefi/sbsa-acs/0003-Enforce-using-good-old-BFD-linker.patch b/meta-arm/recipes-bsp/uefi/sbsa-acs/0002-Enforce-using-good-old-BFD-linker.patch similarity index 92% rename from meta-arm/recipes-bsp/uefi/sbsa-acs/0003-Enforce-using-good-old-BFD-linker.patch rename to meta-arm/recipes-bsp/uefi/sbsa-acs/0002-Enforce-using-good-old-BFD-linker.patch index a9214818..154ff0ec 100644 --- a/meta-arm/recipes-bsp/uefi/sbsa-acs/0003-Enforce-using-good-old-BFD-linker.patch +++ b/meta-arm/recipes-bsp/uefi/sbsa-acs/0002-Enforce-using-good-old-BFD-linker.patch @@ -1,4 +1,4 @@ -From 6673fb1de490575a414de7e4dd9442c921383019 Mon Sep 17 00:00:00 2001 +From 8ce56a02fd722833931d356c372d374845f4c626 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Wed, 7 Apr 2021 00:16:07 -0700 Subject: [PATCH] Enforce using good old BFD linker @@ -18,10 +18,10 @@ Signed-off-by: Khem Raj 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BaseTools/Conf/tools_def.template b/BaseTools/Conf/tools_def.template -index bca09e4648..b775391675 100755 +index 503a6687c1..5cbc5c92a5 100755 --- a/BaseTools/Conf/tools_def.template +++ b/BaseTools/Conf/tools_def.template -@@ -1858,7 +1858,7 @@ DEFINE GCC_ARM_CC_XIPFLAGS = -mno-unaligned-access +@@ -746,7 +746,7 @@ DEFINE GCC_ARM_CC_XIPFLAGS = -mno-unaligned-access DEFINE GCC_AARCH64_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -mlittle-endian -fno-short-enums -fverbose-asm -funsigned-char -ffunction-sections -fdata-sections -Wno-address -fno-asynchronous-unwind-tables -fno-unwind-tables -fno-pic -fno-pie -ffixed-x18 DEFINE GCC_AARCH64_CC_XIPFLAGS = -mstrict-align -mgeneral-regs-only DEFINE GCC_DLINK_FLAGS_COMMON = -nostdlib --pie diff --git a/meta-arm/recipes-bsp/uefi/sbsa-acs_6.1.0.bb b/meta-arm/recipes-bsp/uefi/sbsa-acs_7.1.2.bb similarity index 71% rename from meta-arm/recipes-bsp/uefi/sbsa-acs_6.1.0.bb rename to meta-arm/recipes-bsp/uefi/sbsa-acs_7.1.2.bb index 8995a106..b6c64685 100644 --- a/meta-arm/recipes-bsp/uefi/sbsa-acs_6.1.0.bb +++ b/meta-arm/recipes-bsp/uefi/sbsa-acs_7.1.2.bb @@ -6,15 +6,14 @@ LIC_FILES_CHKSUM += "file://ShellPkg/Application/sbsa-acs/LICENSE.md;md5=2a94494 SRC_URI += "git://github.com/ARM-software/sbsa-acs;destsuffix=edk2/ShellPkg/Application/sbsa-acs;protocol=https;branch=master;name=acs \ git://github.com/tianocore/edk2-libc;destsuffix=edk2/edk2-libc;protocol=https;branch=master;name=libc \ - file://0002-Patch-in-the-paths-to-the-SBSA-test-suite.patch \ - file://0003-Enforce-using-good-old-BFD-linker.patch \ - file://0001-Fix-function-protype-mismatches.patch;patchdir=ShellPkg/Application/sbsa-acs \ - file://0001-Fix-for-issue-245.patch;patchdir=ShellPkg/Application/sbsa-acs \ + file://0001-Patch-in-the-paths-to-the-SBSA-test-suite.patch \ + file://0002-Enforce-using-good-old-BFD-linker.patch \ + file://0001-Fix-for-mismatch-in-function-prototype.patch;patchdir=ShellPkg/Application/sbsa-acs \ " -SRCREV_acs = "7d7a3fe81ad7e6f05143ba17db50107f1ab6c9cd" -SRCREV_libc = "a806ea1062c254bd6e09db7d0f7beb4d14bc3ed0" +SRCREV_acs = "23253befbed2aee7304470fd83b78672488a7fc2" +SRCREV_libc = "d3dea661da9ae4a3421a80905e75a8dc77aa980e" # GCC12 trips on it #see https://src.fedoraproject.org/rpms/edk2/blob/rawhide/f/0032-Basetools-turn-off-gcc12-warning.patch From patchwork Sun Sep 10 13:43:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jon Mason X-Patchwork-Id: 30251 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 BA819EE14D8 for ; Sun, 10 Sep 2023 13:43:28 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web11.36168.1694353398987496929 for ; Sun, 10 Sep 2023 06:43:19 -0700 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: jon.mason@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 BB1001007 for ; Sun, 10 Sep 2023 06:43:55 -0700 (PDT) Received: from debian.lan?044arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 528983F64C for ; Sun, 10 Sep 2023 06:43:18 -0700 (PDT) From: Jon Mason To: meta-arm@lists.yoctoproject.org Subject: [PATCH 2/2] arm-bsp/trusted-firmware-a: remove unneeded patches Date: Sun, 10 Sep 2023 08:43:13 -0500 Message-Id: <20230910134313.3735787-2-jon.mason@arm.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230910134313.3735787-1-jon.mason@arm.com> References: <20230910134313.3735787-1-jon.mason@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 ; Sun, 10 Sep 2023 13:43:28 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/meta-arm/message/5024 Patches (and recipe support) were added for qemuarm64-secureboot support, but that is not present in meta-arm-bsp. Remove it. Signed-off-by: Jon Mason --- .../files/add-spmc_manifest-for-qemu.patch | 67 ----- ...emu-update-abi-between-spmd-and-spmc.patch | 263 ------------------ .../trusted-firmware-a_2.8.6.bb | 6 - 3 files changed, 336 deletions(-) delete mode 100644 meta-arm-bsp/recipes-bsp/trusted-firmware-a/files/add-spmc_manifest-for-qemu.patch delete mode 100644 meta-arm-bsp/recipes-bsp/trusted-firmware-a/files/feat-qemu-update-abi-between-spmd-and-spmc.patch diff --git a/meta-arm-bsp/recipes-bsp/trusted-firmware-a/files/add-spmc_manifest-for-qemu.patch b/meta-arm-bsp/recipes-bsp/trusted-firmware-a/files/add-spmc_manifest-for-qemu.patch deleted file mode 100644 index 50a57d61..00000000 --- a/meta-arm-bsp/recipes-bsp/trusted-firmware-a/files/add-spmc_manifest-for-qemu.patch +++ /dev/null @@ -1,67 +0,0 @@ -From e1cbb35ad4655fe13ccb89247c81e850f6392c92 Mon Sep 17 00:00:00 2001 -From: Gyorgy Szing -Date: Mon, 13 Mar 2023 21:15:59 +0100 -Subject: Add spmc_manifest for qemu - -This version only supports embedded packaging. - -Upstream-Status: Inappropriate [other] - - The SPMC manifest is integration specific and should live at an - integration spcific place. The manifest file is processed by TF-A - and I am adding the patch to TF-A to keep things simple. - -Signed-off-by: Gyorgy Szing ---- - plat/qemu/fdts/optee_spmc_manifest.dts | 40 ++++++++++++++++++++++++++ - 1 file changed, 40 insertions(+) - create mode 100644 plat/qemu/fdts/optee_spmc_manifest.dts - -diff --git a/plat/qemu/fdts/optee_spmc_manifest.dts b/plat/qemu/fdts/optee_spmc_manifest.dts -new file mode 100644 -index 000000000..ae2ae3d95 ---- /dev/null -+++ b/plat/qemu/fdts/optee_spmc_manifest.dts -@@ -0,0 +1,40 @@ -+/* SPDX-License-Identifier: BSD-3-Clause */ -+/* -+ * Copyright (c) 2023, Arm Limited. All rights reserved. -+ */ -+ -+/dts-v1/; -+ -+/ { -+ compatible = "arm,ffa-core-manifest-1.0"; -+ #address-cells = <2>; -+ #size-cells = <1>; -+ -+ attribute { -+ spmc_id = <0x8000>; -+ maj_ver = <0x1>; -+ min_ver = <0x0>; -+ exec_state = <0x0>; -+ load_address = <0x0 0x0e100000>; -+ entrypoint = <0x0 0x0e100000>; -+ binary_size = <0x80000>; -+ }; -+ -+/* -+ * This file will be preprocessed by TF-A's build system. If Measured Boot is -+ * enabled in TF-A's config, the build system will add the MEASURED_BOOT=1 macro -+ * to the preprocessor arguments. -+ */ -+#if MEASURED_BOOT -+ tpm_event_log { -+ compatible = "arm,tpm_event_log"; -+ tpm_event_log_addr = <0x0 0x0>; -+ tpm_event_log_size = <0x0>; -+ }; -+#endif -+ -+/* If the ARM_BL2_SP_LIST_DTS is defined, SPs should be loaded from FIP */ -+#ifdef ARM_BL2_SP_LIST_DTS -+ #error "FIP SP load addresses configuration is missing. -+#endif -+}; --- -2.39.1.windows.1 - diff --git a/meta-arm-bsp/recipes-bsp/trusted-firmware-a/files/feat-qemu-update-abi-between-spmd-and-spmc.patch b/meta-arm-bsp/recipes-bsp/trusted-firmware-a/files/feat-qemu-update-abi-between-spmd-and-spmc.patch deleted file mode 100644 index 7c851fd0..00000000 --- a/meta-arm-bsp/recipes-bsp/trusted-firmware-a/files/feat-qemu-update-abi-between-spmd-and-spmc.patch +++ /dev/null @@ -1,263 +0,0 @@ -From d215b0c08e51192baab96d75beaeacf3abf8724e Mon Sep 17 00:00:00 2001 -From: Jens Wiklander -Date: Fri, 18 Nov 2022 15:40:04 +0100 -Subject: feat(qemu): update abi between spmd and spmc - -Updates the ABI between SPMD and the SPMC at S-EL1 so that the hard -coded SPMC manifest can be replaced by a proper manifest via TOS FW -Config. TOS FW Config is provided via QEMU_TOS_FW_CONFIG_DTS as a DTS -file when building. The DTS is turned into a DTB which is added to the -FIP. - -Note that this is an incompatible change and requires corresponding -change in OP-TEE ("core: sel1 spmc: boot abi update"). - -Upstream-Status: Accepted - -Signed-off-by: Jens Wiklander -Change-Id: Ibabe78ef50a24f775492854ce5ac54e4d471e369 ---- - plat/qemu/common/qemu_bl2_mem_params_desc.c | 18 +++++++++++- - plat/qemu/common/qemu_bl2_setup.c | 32 +++++++++++++-------- - plat/qemu/common/qemu_io_storage.c | 16 ++++++++++- - plat/qemu/common/qemu_spmd_manifest.c | 31 -------------------- - plat/qemu/qemu/include/platform_def.h | 3 ++ - plat/qemu/qemu/platform.mk | 12 +++++++- - 6 files changed, 66 insertions(+), 46 deletions(-) - delete mode 100644 plat/qemu/common/qemu_spmd_manifest.c - -diff --git a/plat/qemu/common/qemu_bl2_mem_params_desc.c b/plat/qemu/common/qemu_bl2_mem_params_desc.c -index 5af3a2264..8d8047c92 100644 ---- a/plat/qemu/common/qemu_bl2_mem_params_desc.c -+++ b/plat/qemu/common/qemu_bl2_mem_params_desc.c -@@ -1,5 +1,5 @@ - /* -- * Copyright (c) 2017-2021, ARM Limited and Contributors. All rights reserved. -+ * Copyright (c) 2017-2022, ARM Limited and Contributors. All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -@@ -122,6 +122,22 @@ static bl_mem_params_node_t bl2_mem_params_descs[] = { - #endif - .next_handoff_image_id = INVALID_IMAGE_ID, - }, -+ -+#if defined(SPD_spmd) -+ /* Fill TOS_FW_CONFIG related information */ -+ { -+ .image_id = TOS_FW_CONFIG_ID, -+ SET_STATIC_PARAM_HEAD(ep_info, PARAM_IMAGE_BINARY, -+ VERSION_2, entry_point_info_t, SECURE | NON_EXECUTABLE), -+ SET_STATIC_PARAM_HEAD(image_info, PARAM_IMAGE_BINARY, -+ VERSION_2, image_info_t, 0), -+ .image_info.image_base = TOS_FW_CONFIG_BASE, -+ .image_info.image_max_size = TOS_FW_CONFIG_LIMIT - -+ TOS_FW_CONFIG_BASE, -+ .next_handoff_image_id = INVALID_IMAGE_ID, -+ }, -+#endif -+ - # endif /* QEMU_LOAD_BL32 */ - - /* Fill BL33 related information */ -diff --git a/plat/qemu/common/qemu_bl2_setup.c b/plat/qemu/common/qemu_bl2_setup.c -index 2c0da15b9..6afa3a44d 100644 ---- a/plat/qemu/common/qemu_bl2_setup.c -+++ b/plat/qemu/common/qemu_bl2_setup.c -@@ -1,5 +1,5 @@ - /* -- * Copyright (c) 2015-2021, ARM Limited and Contributors. All rights reserved. -+ * Copyright (c) 2015-2022, ARM Limited and Contributors. All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -@@ -149,8 +149,7 @@ static int qemu_bl2_handle_post_image_load(unsigned int image_id) - bl_mem_params_node_t *paged_mem_params = NULL; - #endif - #if defined(SPD_spmd) -- unsigned int mode_rw = MODE_RW_64; -- uint64_t pagable_part = 0; -+ bl_mem_params_node_t *bl32_mem_params = NULL; - #endif - - assert(bl_mem_params); -@@ -170,17 +169,18 @@ static int qemu_bl2_handle_post_image_load(unsigned int image_id) - if (err != 0) { - WARN("OPTEE header parse error.\n"); - } --#if defined(SPD_spmd) -- mode_rw = bl_mem_params->ep_info.args.arg0; -- pagable_part = bl_mem_params->ep_info.args.arg1; --#endif - #endif - --#if defined(SPD_spmd) -- bl_mem_params->ep_info.args.arg0 = ARM_PRELOADED_DTB_BASE; -- bl_mem_params->ep_info.args.arg1 = pagable_part; -- bl_mem_params->ep_info.args.arg2 = mode_rw; -- bl_mem_params->ep_info.args.arg3 = 0; -+#if defined(SPMC_OPTEE) -+ /* -+ * Explicit zeroes to unused registers since they may have -+ * been populated by parse_optee_header() above. -+ * -+ * OP-TEE expects system DTB in x2 and TOS_FW_CONFIG in x0, -+ * the latter is filled in below for TOS_FW_CONFIG_ID and -+ * applies to any other SPMC too. -+ */ -+ bl_mem_params->ep_info.args.arg2 = ARM_PRELOADED_DTB_BASE; - #elif defined(SPD_opteed) - /* - * OP-TEE expect to receive DTB address in x2. -@@ -224,6 +224,14 @@ static int qemu_bl2_handle_post_image_load(unsigned int image_id) - - bl_mem_params->ep_info.spsr = qemu_get_spsr_for_bl33_entry(); - break; -+#if defined(SPD_spmd) -+ case TOS_FW_CONFIG_ID: -+ /* An SPMC expects TOS_FW_CONFIG in x0/r0 */ -+ bl32_mem_params = get_bl_mem_params_node(BL32_IMAGE_ID); -+ bl32_mem_params->ep_info.args.arg0 = -+ bl_mem_params->image_info.image_base; -+ break; -+#endif - default: - /* Do nothing in default case */ - break; -diff --git a/plat/qemu/common/qemu_io_storage.c b/plat/qemu/common/qemu_io_storage.c -index 1107e443f..e2d4932c0 100644 ---- a/plat/qemu/common/qemu_io_storage.c -+++ b/plat/qemu/common/qemu_io_storage.c -@@ -1,5 +1,5 @@ - /* -- * Copyright (c) 2015-2016, ARM Limited and Contributors. All rights reserved. -+ * Copyright (c) 2015-2022, ARM Limited and Contributors. All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -@@ -24,6 +24,7 @@ - #define BL2_IMAGE_NAME "bl2.bin" - #define BL31_IMAGE_NAME "bl31.bin" - #define BL32_IMAGE_NAME "bl32.bin" -+#define TOS_FW_CONFIG_NAME "tos_fw_config.dtb" - #define BL32_EXTRA1_IMAGE_NAME "bl32_extra1.bin" - #define BL32_EXTRA2_IMAGE_NAME "bl32_extra2.bin" - #define BL33_IMAGE_NAME "bl33.bin" -@@ -78,6 +79,10 @@ static const io_uuid_spec_t bl32_extra2_uuid_spec = { - .uuid = UUID_SECURE_PAYLOAD_BL32_EXTRA2, - }; - -+static const io_uuid_spec_t tos_fw_config_uuid_spec = { -+ .uuid = UUID_TOS_FW_CONFIG, -+}; -+ - static const io_uuid_spec_t bl33_uuid_spec = { - .uuid = UUID_NON_TRUSTED_FIRMWARE_BL33, - }; -@@ -137,6 +142,10 @@ static const io_file_spec_t sh_file_spec[] = { - .path = BL32_EXTRA2_IMAGE_NAME, - .mode = FOPEN_MODE_RB - }, -+ [TOS_FW_CONFIG_ID] = { -+ .path = TOS_FW_CONFIG_NAME, -+ .mode = FOPEN_MODE_RB -+ }, - [BL33_IMAGE_ID] = { - .path = BL33_IMAGE_NAME, - .mode = FOPEN_MODE_RB -@@ -252,6 +261,11 @@ static const struct plat_io_policy policies[] = { - open_fip - }, - #endif -+ [TOS_FW_CONFIG_ID] = { -+ &fip_dev_handle, -+ (uintptr_t)&tos_fw_config_uuid_spec, -+ open_fip -+ }, - [BL33_IMAGE_ID] = { - &fip_dev_handle, - (uintptr_t)&bl33_uuid_spec, -diff --git a/plat/qemu/common/qemu_spmd_manifest.c b/plat/qemu/common/qemu_spmd_manifest.c -deleted file mode 100644 -index fd46e2675..000000000 ---- a/plat/qemu/common/qemu_spmd_manifest.c -+++ /dev/null -@@ -1,31 +0,0 @@ --/* -- * Copyright (c) 2021, ARM Limited and Contributors. All rights reserved. -- * -- * SPDX-License-Identifier: BSD-3-Clause -- */ -- --#include -- --#include -- --#include --#include -- --int plat_spm_core_manifest_load(spmc_manifest_attribute_t *manifest, -- const void *pm_addr) --{ -- entry_point_info_t *ep_info = bl31_plat_get_next_image_ep_info(SECURE); -- -- assert(ep_info != NULL); -- assert(manifest != NULL); -- -- manifest->major_version = 1; -- manifest->minor_version = 0; -- manifest->exec_state = ep_info->args.arg2; -- manifest->load_address = BL32_BASE; -- manifest->entrypoint = BL32_BASE; -- manifest->binary_size = BL32_LIMIT - BL32_BASE; -- manifest->spmc_id = 0x8000; -- -- return 0; --} -diff --git a/plat/qemu/qemu/include/platform_def.h b/plat/qemu/qemu/include/platform_def.h -index c9ed6409f..5c3239cb8 100644 ---- a/plat/qemu/qemu/include/platform_def.h -+++ b/plat/qemu/qemu/include/platform_def.h -@@ -118,6 +118,9 @@ - #define BL_RAM_BASE (SHARED_RAM_BASE + SHARED_RAM_SIZE) - #define BL_RAM_SIZE (SEC_SRAM_SIZE - SHARED_RAM_SIZE) - -+#define TOS_FW_CONFIG_BASE BL_RAM_BASE -+#define TOS_FW_CONFIG_LIMIT (TOS_FW_CONFIG_BASE + PAGE_SIZE) -+ - /* - * BL1 specific defines. - * -diff --git a/plat/qemu/qemu/platform.mk b/plat/qemu/qemu/platform.mk -index 6becc32fa..02493025a 100644 ---- a/plat/qemu/qemu/platform.mk -+++ b/plat/qemu/qemu/platform.mk -@@ -212,7 +212,10 @@ BL31_SOURCES += lib/cpus/aarch64/aem_generic.S \ - ${QEMU_GIC_SOURCES} - - ifeq (${SPD},spmd) --BL31_SOURCES += plat/qemu/common/qemu_spmd_manifest.c -+BL31_SOURCES += plat/common/plat_spmd_manifest.c \ -+ common/uuid.c \ -+ ${LIBFDT_SRCS} \ -+ ${FDT_WRAPPERS_SOURCES} - endif - endif - -@@ -233,6 +236,13 @@ $(eval $(call TOOL_ADD_IMG,bl32_extra2,--tos-fw-extra2)) - endif - endif - -+ifneq ($(QEMU_TOS_FW_CONFIG_DTS),) -+FDT_SOURCES += ${QEMU_TOS_FW_CONFIG_DTS} -+QEMU_TOS_FW_CONFIG := ${BUILD_PLAT}/fdts/$(notdir $(basename ${QEMU_TOS_FW_CONFIG_DTS})).dtb -+# Add the TOS_FW_CONFIG to FIP -+$(eval $(call TOOL_ADD_PAYLOAD,${QEMU_TOS_FW_CONFIG},--tos-fw-config,${QEMU_TOS_FW_CONFIG})) -+endif -+ - SEPARATE_CODE_AND_RODATA := 1 - ENABLE_STACK_PROTECTOR := 0 - ifneq ($(ENABLE_STACK_PROTECTOR), 0) --- -2.39.1.windows.1 - diff --git a/meta-arm-bsp/recipes-bsp/trusted-firmware-a/trusted-firmware-a_2.8.6.bb b/meta-arm-bsp/recipes-bsp/trusted-firmware-a/trusted-firmware-a_2.8.6.bb index a96df3c0..cffc6db1 100644 --- a/meta-arm-bsp/recipes-bsp/trusted-firmware-a/trusted-firmware-a_2.8.6.bb +++ b/meta-arm-bsp/recipes-bsp/trusted-firmware-a/trusted-firmware-a_2.8.6.bb @@ -6,12 +6,6 @@ SRCBRANCH = "lts-v2.8" SRC_URI += "file://rwx-segments.patch" -# Enable passing TOS_FW_CONFIG from FIP package to Trusted OS. -SRC_URI:append:qemuarm64-secureboot = " \ - file://add-spmc_manifest-for-qemu.patch \ - file://feat-qemu-update-abi-between-spmd-and-spmc.patch \ - " - LIC_FILES_CHKSUM += "file://docs/license.rst;md5=b2c740efedc159745b9b31f88ff03dde" # mbed TLS v2.28.2