arm-bsp/corstone1000: Various fixes for upcoming release
cover arm-bsp/corstone1000: Various fixes for upcoming release
From: Emekcan Aras <[email protected]>
This patchset fixes various issues on capsule_update and SR-IR tests for corstone1000.
Emekcan Aras (4):
arm-bsp/trusted-services: corstone1000: GetNextVariableName Fix arm-bsp/trusted-services: corstone1000: Fix PSA_RAW_KEY agreement test arm-bsp/trusted-services: corstone1000: Fix Capsule Update arm-bsp/trusted-firmware-a: corstone1000: Fix Trusted-Firmware-A
version for corstone1000
Gowtham Suresh Kumar (4):
arm-bsp/u-boot: corstone1000: Fix EFI multiple protocol install
failure
arm-bsp/u-boot: corstone1000: Enable EFI set/get time services arm-bsp/optee-os:corstone1000: Drop SPMC non secure interrupt patches arm-bsp/u-boot: corstone1000: Fix u-boot compilation warnings
.../trusted-firmware-a-corstone1000.inc | 4 +
...ime-allow-to-reset-a-path-after-boot.patch | 31 ----
...ata-make-sure-structures-are-packed.patch} | 0
...=> 0035-corstone1000-add-boot-index.patch} | 0
...djust-boot-bank-and-kernel-location.patch} | 0
...dd-nvmxip-fwu-mdata-and-gpt-options.patch} | 0
... 0038-nvmxip-move-header-to-include.patch} | 0
...0-set-kernel_addr-based-on-boot_idx.patch} | 0
...corstone1000-boot-index-from-active.patch} | 0
...0041-corstone1000-enable-PSCI-reset.patch} | 0
...042-Enable-EFI-set-get-time-services.patch | 32 ++++
...ion-warnings-in-fwu_plat_get_bootidx.patch | 47 ++++++
.../recipes-bsp/u-boot/u-boot_%.bbappend | 19 +--
.../optee/optee-os-corstone1000-common.inc | 2 +
.../0004-GetNextVariableName-Fix.patch | 33 ++++
...0-add-compile-definitions-for-ECP_DP.patch | 29 ++++
...0-Use-the-stateless-platform-service.patch | 141 ++++++++++++++++++
...0-Initialize-capsule-update-provider.patch | 78 ++++++++++
.../trusted-services/ts-arm-platforms.inc | 4 +
19 files changed, 380 insertions(+), 40 deletions(-)
delete mode 100644 meta-arm-bsp/recipes-bsp/u-boot/u-boot/corstone1000/0034-efi_boottime-allow-to-reset-a-path-after-boot.patch
rename meta-arm-bsp/recipes-bsp/u-boot/u-boot/corstone1000/{0035-fwu_metadata-make-sure-structures-are-packed.patch => 0034-fwu_metadata-make-sure-structures-are-packed.patch} (100%)
rename meta-arm-bsp/recipes-bsp/u-boot/u-boot/corstone1000/{0036-corstone1000-add-boot-index.patch => 0035-corstone1000-add-boot-index.patch} (100%)
rename meta-arm-bsp/recipes-bsp/u-boot/u-boot/corstone1000/{0037-corstone1000-adjust-boot-bank-and-kernel-location.patch => 0036-corstone1000-adjust-boot-bank-and-kernel-location.patch} (100%)
rename meta-arm-bsp/recipes-bsp/u-boot/u-boot/corstone1000/{0038-corstone1000-add-nvmxip-fwu-mdata-and-gpt-options.patch => 0037-corstone1000-add-nvmxip-fwu-mdata-and-gpt-options.patch} (100%)
rename meta-arm-bsp/recipes-bsp/u-boot/u-boot/corstone1000/{0039-nvmxip-move-header-to-include.patch => 0038-nvmxip-move-header-to-include.patch} (100%)
rename meta-arm-bsp/recipes-bsp/u-boot/u-boot/corstone1000/{0040-corstone1000-set-kernel_addr-based-on-boot_idx.patch => 0039-corstone1000-set-kernel_addr-based-on-boot_idx.patch} (100%)
rename meta-arm-bsp/recipes-bsp/u-boot/u-boot/corstone1000/{0041-corstone1000-boot-index-from-active.patch => 0040-corstone1000-boot-index-from-active.patch} (100%)
rename meta-arm-bsp/recipes-bsp/u-boot/u-boot/corstone1000/{0042-corstone1000-enable-PSCI-reset.patch => 0041-corstone1000-enable-PSCI-reset.patch} (100%)
create mode 100644 meta-arm-bsp/recipes-bsp/u-boot/u-boot/corstone1000/0042-Enable-EFI-set-get-time-services.patch
create mode 100644 meta-arm-bsp/recipes-bsp/u-boot/u-boot/corstone1000/0043-corstone1000-fix-compilation-warnings-in-fwu_plat_get_bootidx.patch
create mode 100644 meta-arm-bsp/recipes-security/trusted-services/corstone1000/0004-GetNextVariableName-Fix.patch
create mode 100644 meta-arm-bsp/recipes-security/trusted-services/corstone1000/0005-plat-corstone1000-add-compile-definitions-for-ECP_DP.patch
create mode 100644 meta-arm-bsp/recipes-security/trusted-services/corstone1000/0006-plat-corstone1000-Use-the-stateless-platform-service.patch
create mode 100644 meta-arm-bsp/recipes-security/trusted-services/corstone1000/0007-plat-corstone1000-Initialize-capsule-update-provider.patchSignature · 1 line
2.17.1
PATCH 1/8 arm-bsp/u-boot: corstone1000: Fix EFI multiple protocol install failure
From: Emekcan Aras <[email protected]>
From: Gowtham Suresh Kumar <[email protected]>
The patch fixes the ACS InstallMultipleProtocolInterfaces_Conf failures in corstone1000 platform by dropping a workaround u-boot patch. The NVMXIP initialization had some issues during u-boot boot stage which led to the workaround patch.
Upstream-Status: Pending [Not submitted to upstream yet]
---
...ime-allow-to-reset-a-path-after-boot.patch | 31 -------------------
...ata-make-sure-structures-are-packed.patch} | 0
...=> 0035-corstone1000-add-boot-index.patch} | 0
...djust-boot-bank-and-kernel-location.patch} | 0
...dd-nvmxip-fwu-mdata-and-gpt-options.patch} | 0
... 0038-nvmxip-move-header-to-include.patch} | 0
...0-set-kernel_addr-based-on-boot_idx.patch} | 0
...corstone1000-boot-index-from-active.patch} | 0
...0041-corstone1000-enable-PSCI-reset.patch} | 0
.../recipes-bsp/u-boot/u-boot_%.bbappend | 17 +++++-----
10 files changed, 8 insertions(+), 40 deletions(-)
delete mode 100644 meta-arm-bsp/recipes-bsp/u-boot/u-boot/corstone1000/0034-efi_boottime-allow-to-reset-a-path-after-boot.patch
rename meta-arm-bsp/recipes-bsp/u-boot/u-boot/corstone1000/{0035-fwu_metadata-make-sure-structures-are-packed.patch => 0034-fwu_metadata-make-sure-structures-are-packed.patch} (100%)
rename meta-arm-bsp/recipes-bsp/u-boot/u-boot/corstone1000/{0036-corstone1000-add-boot-index.patch => 0035-corstone1000-add-boot-index.patch} (100%)
rename meta-arm-bsp/recipes-bsp/u-boot/u-boot/corstone1000/{0037-corstone1000-adjust-boot-bank-and-kernel-location.patch => 0036-corstone1000-adjust-boot-bank-and-kernel-location.patch} (100%)
rename meta-arm-bsp/recipes-bsp/u-boot/u-boot/corstone1000/{0038-corstone1000-add-nvmxip-fwu-mdata-and-gpt-options.patch => 0037-corstone1000-add-nvmxip-fwu-mdata-and-gpt-options.patch} (100%)
rename meta-arm-bsp/recipes-bsp/u-boot/u-boot/corstone1000/{0039-nvmxip-move-header-to-include.patch => 0038-nvmxip-move-header-to-include.patch} (100%)
rename meta-arm-bsp/recipes-bsp/u-boot/u-boot/corstone1000/{0040-corstone1000-set-kernel_addr-based-on-boot_idx.patch => 0039-corstone1000-set-kernel_addr-based-on-boot_idx.patch} (100%)
rename meta-arm-bsp/recipes-bsp/u-boot/u-boot/corstone1000/{0041-corstone1000-boot-index-from-active.patch => 0040-corstone1000-boot-index-from-active.patch} (100%)
rename meta-arm-bsp/recipes-bsp/u-boot/u-boot/corstone1000/{0042-corstone1000-enable-PSCI-reset.patch => 0041-corstone1000-enable-PSCI-reset.patch} (100%)meta-arm-bsp/recipes-bsp/u-boot/u-boot/corstone1000/0034-efi_boottime-allow-to-reset-a-path-after-boot.patch deleted +0 -31
@@ -1,31 +0,0 @@ -From eb8e224290149fd39ca4b3a774abef2e31237943 Mon Sep 17 00:00:00 2001 -From: Rui Miguel Silva <[email protected]> -Date: Wed, 1 Feb 2023 16:11:25 +0000 -Subject: [PATCH 34/42] efi_boottime: allow to reset a path after boot - -Allow to install multiple protocol interfaces in an -already installed root interface. -This may need to be fix in other way, but for now -looks like the get away fix. - -Upstream-Status: Pending -Signed-off-by: Rui Miguel Silva <[email protected]> ---- - lib/efi_loader/efi_boottime.c | 1 - - 1 file changed, 1 deletion(-) - -diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c -index fea4eb7a34..90f43ff9a6 100644 ---- a/lib/efi_loader/efi_boottime.c -+++ b/lib/efi_loader/efi_boottime.c -@@ -2669,7 +2669,6 @@ efi_install_multiple_protocol_interfaces_int(efi_handle_t *handle, - EFI_PRINT("Path %pD already installed\n", - protocol_interface); - ret = EFI_ALREADY_STARTED; -- break; - } - } - ret = EFI_CALL(efi_install_protocol_interface(handle, protocol, --- -2.25.1 -
meta-arm-bsp/recipes-bsp/u-boot/u-boot/corstone1000/0034-fwu_metadata-make-sure-structures-are-packed.patch renamed from meta-arm-bsp/recipes-bsp/u-boot/u-boot/corstone1000/0035-fwu_metadata-make-sure-structures-are-packed.patch +0 -0
meta-arm-bsp/recipes-bsp/u-boot/u-boot/corstone1000/0035-corstone1000-add-boot-index.patch renamed from meta-arm-bsp/recipes-bsp/u-boot/u-boot/corstone1000/0036-corstone1000-add-boot-index.patch +0 -0
meta-arm-bsp/recipes-bsp/u-boot/u-boot/corstone1000/0036-corstone1000-adjust-boot-bank-and-kernel-location.patch renamed from meta-arm-bsp/recipes-bsp/u-boot/u-boot/corstone1000/0037-corstone1000-adjust-boot-bank-and-kernel-location.patch +0 -0
meta-arm-bsp/recipes-bsp/u-boot/u-boot/corstone1000/0037-corstone1000-add-nvmxip-fwu-mdata-and-gpt-options.patch renamed from meta-arm-bsp/recipes-bsp/u-boot/u-boot/corstone1000/0038-corstone1000-add-nvmxip-fwu-mdata-and-gpt-options.patch +0 -0
meta-arm-bsp/recipes-bsp/u-boot/u-boot/corstone1000/0038-nvmxip-move-header-to-include.patch renamed from meta-arm-bsp/recipes-bsp/u-boot/u-boot/corstone1000/0039-nvmxip-move-header-to-include.patch +0 -0
meta-arm-bsp/recipes-bsp/u-boot/u-boot/corstone1000/0039-corstone1000-set-kernel_addr-based-on-boot_idx.patch renamed from meta-arm-bsp/recipes-bsp/u-boot/u-boot/corstone1000/0040-corstone1000-set-kernel_addr-based-on-boot_idx.patch +0 -0
meta-arm-bsp/recipes-bsp/u-boot/u-boot/corstone1000/0040-corstone1000-boot-index-from-active.patch renamed from meta-arm-bsp/recipes-bsp/u-boot/u-boot/corstone1000/0041-corstone1000-boot-index-from-active.patch +0 -0
meta-arm-bsp/recipes-bsp/u-boot/u-boot/corstone1000/0041-corstone1000-enable-PSCI-reset.patch renamed from meta-arm-bsp/recipes-bsp/u-boot/u-boot/corstone1000/0042-corstone1000-enable-PSCI-reset.patch +0 -0
meta-arm-bsp/recipes-bsp/u-boot/u-boot_%.bbappend +8 -9
@@ -51,15 +51,14 @@ SRC_URI:append:corstone1000 = " \ file://0031-corstone1000-add-NVM-XIP-QSPI-device-tree-node.patch \ file://0032-sandbox64-add-a-test-case-for-UCLASS_NVMXIP.patch \ file://0033-corstone1000-add-fwu-metadata-store-info.patch \ - file://0034-efi_boottime-allow-to-reset-a-path-after-boot.patch \ - file://0035-fwu_metadata-make-sure-structures-are-packed.patch \ - file://0036-corstone1000-add-boot-index.patch \ - file://0037-corstone1000-adjust-boot-bank-and-kernel-location.patch \ - file://0038-corstone1000-add-nvmxip-fwu-mdata-and-gpt-options.patch \ - file://0039-nvmxip-move-header-to-include.patch \ - file://0040-corstone1000-set-kernel_addr-based-on-boot_idx.patch \ - file://0041-corstone1000-boot-index-from-active.patch \ - file://0042-corstone1000-enable-PSCI-reset.patch \ + file://0034-fwu_metadata-make-sure-structures-are-packed.patch \ + file://0035-corstone1000-add-boot-index.patch \ + file://0036-corstone1000-adjust-boot-bank-and-kernel-location.patch \ + file://0037-corstone1000-add-nvmxip-fwu-mdata-and-gpt-options.patch \ + file://0038-nvmxip-move-header-to-include.patch \ + file://0039-corstone1000-set-kernel_addr-based-on-boot_idx.patch \ + file://0040-corstone1000-boot-index-from-active.patch \ + file://0041-corstone1000-enable-PSCI-reset.patch \ " #
Signature · 1 line
2.17.1
PATCH 2/8 arm-bsp/u-boot: corstone1000: Enable EFI set/get time services
In reply to [email protected]From: Emekcan Aras <[email protected]>
From: Gowtham Suresh Kumar <[email protected]>
This patch adds the required configs to the corstone1000 u-boot defconfig to enable the EFI services. This is done to fix the SCT failure reported by the SetTime_Conf and SetTime_Func.
--- ...042-Enable-EFI-set-get-time-services.patch | 32 +++++++++++++++++++ .../recipes-bsp/u-boot/u-boot_%.bbappend | 3 +- 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 meta-arm-bsp/recipes-bsp/u-boot/u-boot/corstone1000/0042-Enable-EFI-set-get-time-services.patch
meta-arm-bsp/recipes-bsp/u-boot/u-boot/corstone1000/0042-Enable-EFI-set-get-time-services.patch new file +32 -0
@@ -0,0 +1,32 @@ +From 9f326f0db8aa13fde93e2ed79055b920c8598a28 Mon Sep 17 00:00:00 2001 +From: Gowtham Suresh Kumar <[email protected]> +Date: Mon, 12 Jun 2023 15:14:52 +0000 +Subject: [PATCH] Enable EFI set/get time services + +SetTime_Conf and SetTime_Func tests in UEFI SCT test suite of ACS +fails with unsupported return value. CONFIG_EFI_SET_TIME and +CONFIG_EFI_GET_TIME config values are added to enable these EFI +services. + +Upstream-Status: Pending [Not submitted to upstream yet] +Signed-off-by: Gowtham Suresh Kumar <[email protected]> +--- + configs/corstone1000_defconfig | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/configs/corstone1000_defconfig b/configs/corstone1000_defconfig +index c692cc91bd..f1901dfe8b 100644 +--- a/configs/corstone1000_defconfig ++++ b/configs/corstone1000_defconfig +@@ -7,6 +7,8 @@ CONFIG_NR_DRAM_BANKS=1 + CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y + CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x83f00000 + CONFIG_DM_GPIO=y ++CONFIG_EFI_SET_TIME=y ++CONFIG_EFI_GET_TIME=y + CONFIG_DEFAULT_DEVICE_TREE="corstone1000-mps3" + CONFIG_SYS_PROMPT="corstone1000# " + CONFIG_IDENT_STRING=" corstone1000 aarch64 " +-- +2.17.1 +
meta-arm-bsp/recipes-bsp/u-boot/u-boot_%.bbappend +2 -1
@@ -58,7 +58,8 @@ SRC_URI:append:corstone1000 = " \ file://0038-nvmxip-move-header-to-include.patch \ file://0039-corstone1000-set-kernel_addr-based-on-boot_idx.patch \ file://0040-corstone1000-boot-index-from-active.patch \ - file://0041-corstone1000-enable-PSCI-reset.patch \ + file://0041-corstone1000-enable-PSCI-reset.patch \ + file://0042-Enable-EFI-set-get-time-services.patch \ " #
Signature · 1 line
2.17.1
PATCH 3/8 arm-bsp/trusted-services: corstone1000: GetNextVariableName Fix
In reply to [email protected]From: Emekcan Aras <[email protected]>
This patch is required to handle one of the corner cases of the GetNextVariableName EFI service as specified in the UEFI spec.
--- .../0004-GetNextVariableName-Fix.patch | 33 +++++++++++++++++++ .../trusted-services/ts-arm-platforms.inc | 1 + 2 files changed, 34 insertions(+) create mode 100644 meta-arm-bsp/recipes-security/trusted-services/corstone1000/0004-GetNextVariableName-Fix.patch
meta-arm-bsp/recipes-security/trusted-services/corstone1000/0004-GetNextVariableName-Fix.patch new file +33 -0
@@ -0,0 +1,33 @@ +From 2aa665ad2cb13bc79b645db41686449a47593aab Mon Sep 17 00:00:00 2001 +From: Emekcan <[email protected]> +Date: Thu, 3 Nov 2022 17:43:40 +0000 +Subject: [PATCH] smm_gateway: GetNextVariableName Fix + +GetNextVariableName() should return EFI_BUFFER_TOO_SMALL +when NameSize is smaller than the actual NameSize. It +currently returns EFI_BUFFER_OUT_OF_RESOURCES due to setting +max_name_len incorrectly. This fixes max_name_len error by +replacing it with actual NameSize request by u-boot. + +Upstream-Status: Pending +Signed-off-by: Emekcan Aras <[email protected]> +--- + .../service/smm_variable/provider/smm_variable_provider.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/components/service/smm_variable/provider/smm_variable_provider.c b/components/service/smm_variable/provider/smm_variable_provider.c +index a9679b7e..6a4b6fa7 100644 +--- a/components/service/smm_variable/provider/smm_variable_provider.c ++++ b/components/service/smm_variable/provider/smm_variable_provider.c +@@ -197,7 +197,7 @@ static rpc_status_t get_next_variable_name_handler(void *context, struct call_re + efi_status = uefi_variable_store_get_next_variable_name( + &this_instance->variable_store, + (SMM_VARIABLE_COMMUNICATE_GET_NEXT_VARIABLE_NAME*)resp_buf->data, +- max_name_len, ++ ((SMM_VARIABLE_COMMUNICATE_GET_NEXT_VARIABLE_NAME*)resp_buf->data)->NameSize, + &resp_buf->data_len); + } + else { +-- +2.17.1 +
meta-arm-bsp/recipes-security/trusted-services/ts-arm-platforms.inc +1 -0
@@ -5,6 +5,7 @@ SRC_URI:append:corstone1000 = " \ file://0001-Add-stub-capsule-update-service-components.patch;patchdir=../trusted-services \ file://0002-Fixes-in-AEAD-for-psa-arch-test-54-and-58.patch;patchdir=../trusted-services \ file://0003-FMP-Support-in-Corstone1000.patch;patchdir=../trusted-services \ + file://0004-GetNextVariableName-Fix.patch;patchdir=../trusted-services \ "
Signature · 1 line
2.17.1
PATCH 4/8 arm-bsp/optee-os:corstone1000: Drop SPMC non secure interrupt patches
In reply to [email protected]From: Emekcan Aras <[email protected]>
From: Gowtham Suresh Kumar <[email protected]>
These 2 patches causes the secure world to enter into an infinite loop when the PSA arch tests are triggered. This is a temporary fix and the issue needs to be investigated before the patches can be enabled.
--- .../recipes-security/optee/optee-os-corstone1000-common.inc | 2 ++ 1 file changed, 2 insertions(+)
meta-arm-bsp/recipes-security/optee/optee-os-corstone1000-common.inc +2 -0
@@ -1,5 +1,7 @@ SRC_URI:remove = " \ file://0003-core-link-add-no-warn-rwx-segments.patch \ + file://0007-core-spmc-handle-non-secure-interrupts.patch \ + file://0008-core-spmc-configure-SP-s-NS-interrupt-action-based-o.patch \ " COMPATIBLE_MACHINE = "corstone1000"
Signature · 1 line
2.17.1
PATCH 5/8 arm-bsp/u-boot: corstone1000: Fix u-boot compilation warnings
In reply to [email protected]From: Emekcan Aras <[email protected]>
From: Gowtham Suresh Kumar <[email protected]>
--- ...ion-warnings-in-fwu_plat_get_bootidx.patch | 47 +++++++++++++++++++ .../recipes-bsp/u-boot/u-boot_%.bbappend | 3 +- 2 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 meta-arm-bsp/recipes-bsp/u-boot/u-boot/corstone1000/0043-corstone1000-fix-compilation-warnings-in-fwu_plat_get_bootidx.patch
meta-arm-bsp/recipes-bsp/u-boot/u-boot/corstone1000/0043-corstone1000-fix-compilation-warnings-in-fwu_plat_get_bootidx.patch new file +47 -0
@@ -0,0 +1,47 @@ +From dfebda98ce08d0cab411521ab3d9e832ed1b4608 Mon Sep 17 00:00:00 2001 +From: Abdellatif El Khlifi <[email protected]> +Date: Thu, 15 Jun 2023 16:51:49 +0100 +Subject: [PATCH] corstone1000: fix compilation warnings in + fwu_plat_get_bootidx() + +Upstream-Status: Pending [Not submitted to upstream yet] +Signed-off-by: Abdellatif El Khlifi <[email protected]> +--- + board/armltd/corstone1000/corstone1000.c | 7 +++---- + 1 file changed, 3 insertions(+), 4 deletions(-) + +diff --git a/board/armltd/corstone1000/corstone1000.c b/board/armltd/corstone1000/corstone1000.c +index db508ac3cb..2e1ace5d04 100644 +--- a/board/armltd/corstone1000/corstone1000.c ++++ b/board/armltd/corstone1000/corstone1000.c +@@ -9,6 +9,7 @@ + #include <common.h> + #include <dm.h> + #include <env.h> ++#include <fwu.h> + #include <netdev.h> + #include <nvmxip.h> + #include <part.h> +@@ -116,7 +117,7 @@ int dram_init_banksize(void) + return 0; + } + +-void fwu_plat_get_bootidx(int *boot_idx) ++void fwu_plat_get_bootidx(uint *boot_idx) + { + int ret; + +@@ -127,9 +128,7 @@ void fwu_plat_get_bootidx(int *boot_idx) + */ + ret = fwu_get_active_index(boot_idx); + if (ret < 0) +- log_err("corstone1000: failed to read active index\n"); +- +- return ret; ++ log_err("corstone1000: failed to read active index err %d\n", ret); + } + + int board_late_init(void) +-- +2.25.1 +
meta-arm-bsp/recipes-bsp/u-boot/u-boot_%.bbappend +2 -1
@@ -59,7 +59,8 @@ SRC_URI:append:corstone1000 = " \ file://0039-corstone1000-set-kernel_addr-based-on-boot_idx.patch \ file://0040-corstone1000-boot-index-from-active.patch \ file://0041-corstone1000-enable-PSCI-reset.patch \ - file://0042-Enable-EFI-set-get-time-services.patch \ + file://0042-Enable-EFI-set-get-time-services.patch \ + file://0043-corstone1000-fix-compilation-warnings-in-fwu_plat_get_bootidx.patch \ " #
Signature · 1 line
2.17.1
PATCH 6/8 arm-bsp/trusted-services: corstone1000: Fix PSA_RAW_KEY agreement test
In reply to [email protected]From: Emekcan Aras <[email protected]>
Adds missing compilation option to fix psa_raw_key_aggrement test for corstone1000.
--- ...0-add-compile-definitions-for-ECP_DP.patch | 29 +++++++++++++++++++ .../trusted-services/ts-arm-platforms.inc | 1 + 2 files changed, 30 insertions(+) create mode 100644 meta-arm-bsp/recipes-security/trusted-services/corstone1000/0005-plat-corstone1000-add-compile-definitions-for-ECP_DP.patch
meta-arm-bsp/recipes-security/trusted-services/corstone1000/0005-plat-corstone1000-add-compile-definitions-for-ECP_DP.patch new file +29 -0
@@ -0,0 +1,29 @@ +From 041d30bb9cc6857f5ef26ded154ff7126dafaa20 Mon Sep 17 00:00:00 2001 +From: Emekcan Aras <[email protected]> +Date: Fri, 16 Jun 2023 10:47:48 +0100 +Subject: [PATCH] plat: corstone1000: add compile definitions for + ECP_DP_SECP512R1 + +Corstone1000 runs PSA-API tests which requires this ECC algorithm. +Without setting this, corstone1000 fails psa-api-crypto-test no 243. + +Signed-off-by: Emekcan Aras <[email protected]> +Upstream-Status: Pending + +--- + platform/providers/arm/corstone1000/platform.cmake | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/platform/providers/arm/corstone1000/platform.cmake b/platform/providers/arm/corstone1000/platform.cmake +index dbdf1097..e7a295dd 100644 +--- a/platform/providers/arm/corstone1000/platform.cmake ++++ b/platform/providers/arm/corstone1000/platform.cmake +@@ -14,3 +14,5 @@ target_compile_definitions(${TGT} PRIVATE + SMM_VARIABLE_INDEX_STORAGE_UID=0x787 + SMM_GATEWAY_MAX_UEFI_VARIABLES=100 + ) ++ ++add_compile_definitions(MBEDTLS_ECP_DP_SECP521R1_ENABLED) +-- +2.17.1 +
meta-arm-bsp/recipes-security/trusted-services/ts-arm-platforms.inc +1 -0
@@ -6,6 +6,7 @@ SRC_URI:append:corstone1000 = " \ file://0002-Fixes-in-AEAD-for-psa-arch-test-54-and-58.patch;patchdir=../trusted-services \ file://0003-FMP-Support-in-Corstone1000.patch;patchdir=../trusted-services \ file://0004-GetNextVariableName-Fix.patch;patchdir=../trusted-services \ + file://0005-plat-corstone1000-add-compile-definitions-for-ECP_DP.patch;patchdir=../trusted-services \ "
Signature · 1 line
2.17.1
PATCH 7/8 arm-bsp/trusted-services: corstone1000: Fix Capsule Update
In reply to [email protected]From: Emekcan Aras <[email protected]>
Adds missing update service definitions for using stateless platform services and initializes the capsule udpate provider in se-proxy-sp for corstone1000.
--- ...0-Use-the-stateless-platform-service.patch | 141 ++++++++++++++++++ ...0-Initialize-capsule-update-provider.patch | 78 ++++++++++ .../trusted-services/ts-arm-platforms.inc | 2 + 3 files changed, 221 insertions(+) create mode 100644 meta-arm-bsp/recipes-security/trusted-services/corstone1000/0006-plat-corstone1000-Use-the-stateless-platform-service.patch create mode 100644 meta-arm-bsp/recipes-security/trusted-services/corstone1000/0007-plat-corstone1000-Initialize-capsule-update-provider.patch
meta-arm-bsp/recipes-security/trusted-services/corstone1000/0006-plat-corstone1000-Use-the-stateless-platform-service.patch new file +141 -0
@@ -0,0 +1,141 @@ +From a71e99045996c57a4f80509ae8b770aa4f73f6c0 Mon Sep 17 00:00:00 2001 +From: Emekcan Aras <[email protected]> +Date: Sun, 18 Jun 2023 14:38:42 +0100 +Subject: [PATCH] plat: corstone1000: Use the stateless platform service calls + Calls to psa_connect is not needed and psa_call can be called directly with a + pre defined handle. + +Signed-off-by: Satish Kumar <[email protected]> +Signed-off-by: Mohamed Omar Asaker <[email protected]> +Signed-off-by: Emekcan Aras <[email protected]> + +Upstream-Status: Inappropriate [Design is to revisted] +--- + .../provider/capsule_update_provider.c | 24 ++++--------------- + .../provider/corstone1000_fmp_service.c | 10 ++++---- + .../provider/corstone1000_fmp_service.h | 3 +-- + components/service/common/include/psa/sid.h | 7 ++++++ + 4 files changed, 17 insertions(+), 27 deletions(-) + +diff --git a/components/service/capsule_update/provider/capsule_update_provider.c b/components/service/capsule_update/provider/capsule_update_provider.c +index 991a2235..6809249f 100644 +--- a/components/service/capsule_update/provider/capsule_update_provider.c ++++ b/components/service/capsule_update/provider/capsule_update_provider.c +@@ -61,7 +61,6 @@ void capsule_update_provider_deinit(struct capsule_update_provider *context) + static rpc_status_t event_handler(uint32_t opcode, struct rpc_caller *caller) + { + uint32_t ioctl_id; +- psa_handle_t handle; + rpc_status_t rpc_status = TS_RPC_CALL_ACCEPTED; + + struct psa_invec in_vec[] = { +@@ -79,31 +78,18 @@ static rpc_status_t event_handler(uint32_t opcode, struct rpc_caller *caller) + case CAPSULE_UPDATE_REQUEST: + /* Openamp call with IOCTL for firmware update*/ + ioctl_id = IOCTL_CORSTONE1000_FWU_FLASH_IMAGES; +- handle = psa_connect(caller, TFM_SP_PLATFORM_IOCTL_SID, +- TFM_SP_PLATFORM_IOCTL_VERSION); +- if (handle <= 0) { +- EMSG("%s Invalid handle", __func__); +- rpc_status = TS_RPC_ERROR_INVALID_PARAMETER; +- return rpc_status; +- } +- psa_call(caller,handle, PSA_IPC_CALL, ++ psa_call(caller,TFM_PLATFORM_SERVICE_HANDLE, TFM_PLATFORM_API_ID_IOCTL, + in_vec,IOVEC_LEN(in_vec), NULL, 0); +- set_fmp_image_info(caller, handle); ++ set_fmp_image_info(caller); + break; + + case KERNEL_STARTED_EVENT: + ioctl_id = IOCTL_CORSTONE1000_FWU_HOST_ACK; + /*openamp call with IOCTL for kernel start*/ +- handle = psa_connect(caller, TFM_SP_PLATFORM_IOCTL_SID, +- TFM_SP_PLATFORM_IOCTL_VERSION); +- if (handle <= 0) { +- EMSG("%s Invalid handle", __func__); +- rpc_status = TS_RPC_ERROR_INVALID_PARAMETER; +- return rpc_status; +- } +- psa_call(caller,handle, PSA_IPC_CALL, ++ ++ psa_call(caller,TFM_PLATFORM_SERVICE_HANDLE, TFM_PLATFORM_API_ID_IOCTL, + in_vec,IOVEC_LEN(in_vec), NULL, 0); +- set_fmp_image_info(caller, handle); ++ set_fmp_image_info(caller); + break; + default: + EMSG("%s unsupported opcode", __func__); +diff --git a/components/service/capsule_update/provider/corstone1000_fmp_service.c b/components/service/capsule_update/provider/corstone1000_fmp_service.c +index 6a7a47a7..d811af9f 100644 +--- a/components/service/capsule_update/provider/corstone1000_fmp_service.c ++++ b/components/service/capsule_update/provider/corstone1000_fmp_service.c +@@ -238,8 +238,7 @@ static psa_status_t unpack_image_info(void *buffer, uint32_t size) + return PSA_SUCCESS; + } + +-static psa_status_t get_image_info(struct rpc_caller *caller, +- psa_handle_t platform_service_handle) ++static psa_status_t get_image_info(struct rpc_caller *caller) + { + psa_status_t status; + psa_handle_t handle; +@@ -255,7 +254,7 @@ static psa_status_t get_image_info(struct rpc_caller *caller, + + memset(image_info_buffer, 0, IMAGE_INFO_BUFFER_SIZE); + +- psa_call(caller, platform_service_handle, PSA_IPC_CALL, ++ psa_call(caller, TFM_PLATFORM_SERVICE_HANDLE, TFM_PLATFORM_API_ID_IOCTL, + in_vec, IOVEC_LEN(in_vec), out_vec, IOVEC_LEN(out_vec)); + + status = unpack_image_info(image_info_buffer, IMAGE_INFO_BUFFER_SIZE); +@@ -288,12 +287,11 @@ static psa_status_t set_image_info(struct rpc_caller *caller) + return PSA_SUCCESS; + } + +-void set_fmp_image_info(struct rpc_caller *caller, +- psa_handle_t platform_service_handle) ++void set_fmp_image_info(struct rpc_caller *caller) + { + psa_status_t status; + +- status = get_image_info(caller, platform_service_handle); ++ status = get_image_info(caller); + if (status != PSA_SUCCESS) { + return; + } +diff --git a/components/service/capsule_update/provider/corstone1000_fmp_service.h b/components/service/capsule_update/provider/corstone1000_fmp_service.h +index 95fba2a0..963223e8 100644 +--- a/components/service/capsule_update/provider/corstone1000_fmp_service.h ++++ b/components/service/capsule_update/provider/corstone1000_fmp_service.h +@@ -16,8 +16,7 @@ extern "C" { + + void provision_fmp_variables_metadata(struct rpc_caller *caller); + +-void set_fmp_image_info(struct rpc_caller *caller, +- psa_handle_t platform_service_handle); ++void set_fmp_image_info(struct rpc_caller *caller); + + #ifdef __cplusplus + } /* extern "C" */ +diff --git a/components/service/common/include/psa/sid.h b/components/service/common/include/psa/sid.h +index 5aaa659d..fc3a4fb0 100644 +--- a/components/service/common/include/psa/sid.h ++++ b/components/service/common/include/psa/sid.h +@@ -40,6 +40,13 @@ extern "C" { + #define TFM_CRYPTO_VERSION (1U) + #define TFM_CRYPTO_HANDLE (0x40000100U) + ++/******** TFM_PLATFORM_SERVICE *******/ ++#define TFM_PLATFORM_API_ID_IOCTL (1013) ++#define TFM_PLATFORM_SERVICE_HANDLE (0x40000105U) ++ ++/** ++ * \brief Define a progressive numerical value for each SID which can be used ++ * when dispatching the requests to the service + /******** TFM_SP_PLATFORM ********/ + #define TFM_SP_PLATFORM_SYSTEM_RESET_SID (0x00000040U) + #define TFM_SP_PLATFORM_SYSTEM_RESET_VERSION (1U) +-- +2.17.1 +
meta-arm-bsp/recipes-security/trusted-services/corstone1000/0007-plat-corstone1000-Initialize-capsule-update-provider.patch new file +78 -0
78 lines not on this page · raw message
meta-arm-bsp/recipes-security/trusted-services/ts-arm-platforms.inc +2 -0
@@ -7,6 +7,8 @@ SRC_URI:append:corstone1000 = " \ file://0003-FMP-Support-in-Corstone1000.patch;patchdir=../trusted-services \ file://0004-GetNextVariableName-Fix.patch;patchdir=../trusted-services \ file://0005-plat-corstone1000-add-compile-definitions-for-ECP_DP.patch;patchdir=../trusted-services \ + file://0006-plat-corstone1000-Use-the-stateless-platform-service.patch;patchdir=../trusted-services \ + file://0007-plat-corstone1000-Initialize-capsule-update-provider.patch;patchdir=../trusted-services \ "
Signature · 1 line
2.17.1
PATCH 8/8 arm-bsp/trusted-firmware-a: corstone1000: Fix Trusted-Firmware-A version for corstone1000
In reply to [email protected]From: Emekcan Aras <[email protected]>
TF-A version 2.8.6 hangs on boot for corstone1000 non-deterministically. This sets TF-A version to v2.8.0 which is a tested working version for corstone1000.
--- .../trusted-firmware-a/trusted-firmware-a-corstone1000.inc | 4 ++++ 1 file changed, 4 insertions(+)
meta-arm-bsp/recipes-bsp/trusted-firmware-a/trusted-firmware-a-corstone1000.inc +4 -0
@@ -9,6 +9,10 @@ SRC_URI:append = " \ file://0002-feat-corstone1000-bl2-loads-fip-based-on-metadata.patch \ " +#Sets TF-A version to 2.8.0 +SRCREV_tfa = "9881bb93a3bc0a3ea37e9f093e09ab4b360a9e48" +PV = "2.8.0" + TFA_DEBUG = "1" TFA_UBOOT ?= "1" TFA_MBEDTLS = "1"
Signature · 1 line
2.17.1