All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/8] arm-bsp/corstone1000: Various fixes for upcoming release
@ 2023-06-22 13:08 emekcan.aras
  2023-06-22 13:08 ` [PATCH 1/8] arm-bsp/u-boot: corstone1000: Fix EFI multiple protocol install failure emekcan.aras
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: emekcan.aras @ 2023-06-22 13:08 UTC (permalink / raw)
  To: meta-arm, Ross.Burton, Jon.Mason; +Cc: nd, Emekcan Aras

From: Emekcan Aras <emekcan.aras@arm.com>

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.patch

-- 
2.17.1



^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 1/8] arm-bsp/u-boot: corstone1000: Fix EFI multiple protocol install failure
  2023-06-22 13:08 [PATCH 0/8] arm-bsp/corstone1000: Various fixes for upcoming release emekcan.aras
@ 2023-06-22 13:08 ` emekcan.aras
  2023-06-22 13:08 ` [PATCH 2/8] arm-bsp/u-boot: corstone1000: Enable EFI set/get time services emekcan.aras
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: emekcan.aras @ 2023-06-22 13:08 UTC (permalink / raw)
  To: meta-arm, Ross.Burton, Jon.Mason; +Cc: nd, Emekcan Aras, Gowtham Suresh Kumar

From: Emekcan Aras <emekcan.aras@arm.com>

From: Gowtham Suresh Kumar <gowtham.sureshkumar@arm.com>

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]
Signed-off-by: Emekcan Aras <emekcan.aras@arm.com>
Signed-off-by: Gowtham Suresh Kumar <gowtham.sureshkumar@arm.com>
---
 ...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%)

diff --git a/meta-arm-bsp/recipes-bsp/u-boot/u-boot/corstone1000/0034-efi_boottime-allow-to-reset-a-path-after-boot.patch b/meta-arm-bsp/recipes-bsp/u-boot/u-boot/corstone1000/0034-efi_boottime-allow-to-reset-a-path-after-boot.patch
deleted file mode 100644
index 5c053974..00000000
--- a/meta-arm-bsp/recipes-bsp/u-boot/u-boot/corstone1000/0034-efi_boottime-allow-to-reset-a-path-after-boot.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From eb8e224290149fd39ca4b3a774abef2e31237943 Mon Sep 17 00:00:00 2001
-From: Rui Miguel Silva <rui.silva@linaro.org>
-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 <rui.silva@linaro.org>
----
- 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
-
diff --git a/meta-arm-bsp/recipes-bsp/u-boot/u-boot/corstone1000/0035-fwu_metadata-make-sure-structures-are-packed.patch b/meta-arm-bsp/recipes-bsp/u-boot/u-boot/corstone1000/0034-fwu_metadata-make-sure-structures-are-packed.patch
similarity index 100%
rename from meta-arm-bsp/recipes-bsp/u-boot/u-boot/corstone1000/0035-fwu_metadata-make-sure-structures-are-packed.patch
rename to meta-arm-bsp/recipes-bsp/u-boot/u-boot/corstone1000/0034-fwu_metadata-make-sure-structures-are-packed.patch
diff --git a/meta-arm-bsp/recipes-bsp/u-boot/u-boot/corstone1000/0036-corstone1000-add-boot-index.patch b/meta-arm-bsp/recipes-bsp/u-boot/u-boot/corstone1000/0035-corstone1000-add-boot-index.patch
similarity index 100%
rename from meta-arm-bsp/recipes-bsp/u-boot/u-boot/corstone1000/0036-corstone1000-add-boot-index.patch
rename to meta-arm-bsp/recipes-bsp/u-boot/u-boot/corstone1000/0035-corstone1000-add-boot-index.patch
diff --git a/meta-arm-bsp/recipes-bsp/u-boot/u-boot/corstone1000/0037-corstone1000-adjust-boot-bank-and-kernel-location.patch b/meta-arm-bsp/recipes-bsp/u-boot/u-boot/corstone1000/0036-corstone1000-adjust-boot-bank-and-kernel-location.patch
similarity index 100%
rename from meta-arm-bsp/recipes-bsp/u-boot/u-boot/corstone1000/0037-corstone1000-adjust-boot-bank-and-kernel-location.patch
rename to meta-arm-bsp/recipes-bsp/u-boot/u-boot/corstone1000/0036-corstone1000-adjust-boot-bank-and-kernel-location.patch
diff --git a/meta-arm-bsp/recipes-bsp/u-boot/u-boot/corstone1000/0038-corstone1000-add-nvmxip-fwu-mdata-and-gpt-options.patch b/meta-arm-bsp/recipes-bsp/u-boot/u-boot/corstone1000/0037-corstone1000-add-nvmxip-fwu-mdata-and-gpt-options.patch
similarity index 100%
rename from meta-arm-bsp/recipes-bsp/u-boot/u-boot/corstone1000/0038-corstone1000-add-nvmxip-fwu-mdata-and-gpt-options.patch
rename to meta-arm-bsp/recipes-bsp/u-boot/u-boot/corstone1000/0037-corstone1000-add-nvmxip-fwu-mdata-and-gpt-options.patch
diff --git a/meta-arm-bsp/recipes-bsp/u-boot/u-boot/corstone1000/0039-nvmxip-move-header-to-include.patch b/meta-arm-bsp/recipes-bsp/u-boot/u-boot/corstone1000/0038-nvmxip-move-header-to-include.patch
similarity index 100%
rename from meta-arm-bsp/recipes-bsp/u-boot/u-boot/corstone1000/0039-nvmxip-move-header-to-include.patch
rename to meta-arm-bsp/recipes-bsp/u-boot/u-boot/corstone1000/0038-nvmxip-move-header-to-include.patch
diff --git a/meta-arm-bsp/recipes-bsp/u-boot/u-boot/corstone1000/0040-corstone1000-set-kernel_addr-based-on-boot_idx.patch b/meta-arm-bsp/recipes-bsp/u-boot/u-boot/corstone1000/0039-corstone1000-set-kernel_addr-based-on-boot_idx.patch
similarity index 100%
rename from meta-arm-bsp/recipes-bsp/u-boot/u-boot/corstone1000/0040-corstone1000-set-kernel_addr-based-on-boot_idx.patch
rename to meta-arm-bsp/recipes-bsp/u-boot/u-boot/corstone1000/0039-corstone1000-set-kernel_addr-based-on-boot_idx.patch
diff --git a/meta-arm-bsp/recipes-bsp/u-boot/u-boot/corstone1000/0041-corstone1000-boot-index-from-active.patch b/meta-arm-bsp/recipes-bsp/u-boot/u-boot/corstone1000/0040-corstone1000-boot-index-from-active.patch
similarity index 100%
rename from meta-arm-bsp/recipes-bsp/u-boot/u-boot/corstone1000/0041-corstone1000-boot-index-from-active.patch
rename to meta-arm-bsp/recipes-bsp/u-boot/u-boot/corstone1000/0040-corstone1000-boot-index-from-active.patch
diff --git a/meta-arm-bsp/recipes-bsp/u-boot/u-boot/corstone1000/0042-corstone1000-enable-PSCI-reset.patch b/meta-arm-bsp/recipes-bsp/u-boot/u-boot/corstone1000/0041-corstone1000-enable-PSCI-reset.patch
similarity index 100%
rename from meta-arm-bsp/recipes-bsp/u-boot/u-boot/corstone1000/0042-corstone1000-enable-PSCI-reset.patch
rename to meta-arm-bsp/recipes-bsp/u-boot/u-boot/corstone1000/0041-corstone1000-enable-PSCI-reset.patch
diff --git a/meta-arm-bsp/recipes-bsp/u-boot/u-boot_%.bbappend b/meta-arm-bsp/recipes-bsp/u-boot/u-boot_%.bbappend
index 8a8f8f02..c6e90383 100644
--- a/meta-arm-bsp/recipes-bsp/u-boot/u-boot_%.bbappend
+++ b/meta-arm-bsp/recipes-bsp/u-boot/u-boot_%.bbappend
@@ -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				  \ 
         "
 
 #
-- 
2.17.1



^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 2/8] arm-bsp/u-boot: corstone1000: Enable EFI set/get time services
  2023-06-22 13:08 [PATCH 0/8] arm-bsp/corstone1000: Various fixes for upcoming release emekcan.aras
  2023-06-22 13:08 ` [PATCH 1/8] arm-bsp/u-boot: corstone1000: Fix EFI multiple protocol install failure emekcan.aras
@ 2023-06-22 13:08 ` emekcan.aras
  2023-06-22 13:08 ` [PATCH 3/8] arm-bsp/trusted-services: corstone1000: GetNextVariableName Fix emekcan.aras
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: emekcan.aras @ 2023-06-22 13:08 UTC (permalink / raw)
  To: meta-arm, Ross.Burton, Jon.Mason; +Cc: nd, Emekcan Aras, Gowtham Suresh Kumar

From: Emekcan Aras <emekcan.aras@arm.com>

From: Gowtham Suresh Kumar <gowtham.sureshkumar@arm.com>

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.

Signed-off-by: Gowtham Suresh Kumar <gowtham.sureshkumar@arm.com>
---
 ...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

diff --git a/meta-arm-bsp/recipes-bsp/u-boot/u-boot/corstone1000/0042-Enable-EFI-set-get-time-services.patch b/meta-arm-bsp/recipes-bsp/u-boot/u-boot/corstone1000/0042-Enable-EFI-set-get-time-services.patch
new file mode 100644
index 00000000..8911abfe
--- /dev/null
+++ b/meta-arm-bsp/recipes-bsp/u-boot/u-boot/corstone1000/0042-Enable-EFI-set-get-time-services.patch
@@ -0,0 +1,32 @@
+From 9f326f0db8aa13fde93e2ed79055b920c8598a28 Mon Sep 17 00:00:00 2001
+From: Gowtham Suresh Kumar <gowtham.sureshkumar@arm.com>
+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 <gowtham.sureshkumar@arm.com>
+---
+ 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
+
diff --git a/meta-arm-bsp/recipes-bsp/u-boot/u-boot_%.bbappend b/meta-arm-bsp/recipes-bsp/u-boot/u-boot_%.bbappend
index c6e90383..79bc7bf5 100644
--- a/meta-arm-bsp/recipes-bsp/u-boot/u-boot_%.bbappend
+++ b/meta-arm-bsp/recipes-bsp/u-boot/u-boot_%.bbappend
@@ -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                                \ 
         "
 
 #
-- 
2.17.1



^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 3/8] arm-bsp/trusted-services: corstone1000: GetNextVariableName Fix
  2023-06-22 13:08 [PATCH 0/8] arm-bsp/corstone1000: Various fixes for upcoming release emekcan.aras
  2023-06-22 13:08 ` [PATCH 1/8] arm-bsp/u-boot: corstone1000: Fix EFI multiple protocol install failure emekcan.aras
  2023-06-22 13:08 ` [PATCH 2/8] arm-bsp/u-boot: corstone1000: Enable EFI set/get time services emekcan.aras
@ 2023-06-22 13:08 ` emekcan.aras
  2023-06-22 13:08 ` [PATCH 4/8] arm-bsp/optee-os:corstone1000: Drop SPMC non secure interrupt patches emekcan.aras
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: emekcan.aras @ 2023-06-22 13:08 UTC (permalink / raw)
  To: meta-arm, Ross.Burton, Jon.Mason; +Cc: nd, Emekcan Aras, Gowtham Suresh Kumar

From: Emekcan Aras <emekcan.aras@arm.com>

This patch is required to handle one of the corner cases of the
GetNextVariableName EFI service as specified in the UEFI spec.

Signed-off-by: Gowtham Suresh Kumar <gowtham.sureshkumar@arm.com>
---
 .../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

diff --git a/meta-arm-bsp/recipes-security/trusted-services/corstone1000/0004-GetNextVariableName-Fix.patch b/meta-arm-bsp/recipes-security/trusted-services/corstone1000/0004-GetNextVariableName-Fix.patch
new file mode 100644
index 00000000..ed4e6e27
--- /dev/null
+++ b/meta-arm-bsp/recipes-security/trusted-services/corstone1000/0004-GetNextVariableName-Fix.patch
@@ -0,0 +1,33 @@
+From 2aa665ad2cb13bc79b645db41686449a47593aab Mon Sep 17 00:00:00 2001
+From: Emekcan <emekcan.aras@arm.com>
+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 <emekcan.aras@arm.com>
+---
+ .../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
+
diff --git a/meta-arm-bsp/recipes-security/trusted-services/ts-arm-platforms.inc b/meta-arm-bsp/recipes-security/trusted-services/ts-arm-platforms.inc
index e601539a..8b7776c9 100644
--- a/meta-arm-bsp/recipes-security/trusted-services/ts-arm-platforms.inc
+++ b/meta-arm-bsp/recipes-security/trusted-services/ts-arm-platforms.inc
@@ -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     \
     "
 
 
-- 
2.17.1



^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 4/8] arm-bsp/optee-os:corstone1000: Drop SPMC non secure interrupt patches
  2023-06-22 13:08 [PATCH 0/8] arm-bsp/corstone1000: Various fixes for upcoming release emekcan.aras
                   ` (2 preceding siblings ...)
  2023-06-22 13:08 ` [PATCH 3/8] arm-bsp/trusted-services: corstone1000: GetNextVariableName Fix emekcan.aras
@ 2023-06-22 13:08 ` emekcan.aras
  2023-06-22 13:08 ` [PATCH 5/8] arm-bsp/u-boot: corstone1000: Fix u-boot compilation warnings emekcan.aras
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: emekcan.aras @ 2023-06-22 13:08 UTC (permalink / raw)
  To: meta-arm, Ross.Burton, Jon.Mason; +Cc: nd, Emekcan Aras, Gowtham Suresh Kumar

From: Emekcan Aras <emekcan.aras@arm.com>

From: Gowtham Suresh Kumar <gowtham.sureshkumar@arm.com>

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.

Signed-off-by: Gowtham Suresh Kumar <gowtham.sureshkumar@arm.com>
---
 .../recipes-security/optee/optee-os-corstone1000-common.inc     | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/meta-arm-bsp/recipes-security/optee/optee-os-corstone1000-common.inc b/meta-arm-bsp/recipes-security/optee/optee-os-corstone1000-common.inc
index 30f99666..1f028ffa 100644
--- a/meta-arm-bsp/recipes-security/optee/optee-os-corstone1000-common.inc
+++ b/meta-arm-bsp/recipes-security/optee/optee-os-corstone1000-common.inc
@@ -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"
-- 
2.17.1



^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 5/8] arm-bsp/u-boot: corstone1000: Fix u-boot compilation warnings
  2023-06-22 13:08 [PATCH 0/8] arm-bsp/corstone1000: Various fixes for upcoming release emekcan.aras
                   ` (3 preceding siblings ...)
  2023-06-22 13:08 ` [PATCH 4/8] arm-bsp/optee-os:corstone1000: Drop SPMC non secure interrupt patches emekcan.aras
@ 2023-06-22 13:08 ` emekcan.aras
  2023-06-22 13:08 ` [PATCH 6/8] arm-bsp/trusted-services: corstone1000: Fix PSA_RAW_KEY agreement test emekcan.aras
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: emekcan.aras @ 2023-06-22 13:08 UTC (permalink / raw)
  To: meta-arm, Ross.Burton, Jon.Mason; +Cc: nd, Emekcan Aras, Gowtham Suresh Kumar

From: Emekcan Aras <emekcan.aras@arm.com>

From: Gowtham Suresh Kumar <gowtham.sureshkumar@arm.com>

Signed-off-by: Gowtham Suresh Kumar <gowtham.sureshkumar@arm.com>
---
 ...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

diff --git a/meta-arm-bsp/recipes-bsp/u-boot/u-boot/corstone1000/0043-corstone1000-fix-compilation-warnings-in-fwu_plat_get_bootidx.patch b/meta-arm-bsp/recipes-bsp/u-boot/u-boot/corstone1000/0043-corstone1000-fix-compilation-warnings-in-fwu_plat_get_bootidx.patch
new file mode 100644
index 00000000..e574103e
--- /dev/null
+++ b/meta-arm-bsp/recipes-bsp/u-boot/u-boot/corstone1000/0043-corstone1000-fix-compilation-warnings-in-fwu_plat_get_bootidx.patch
@@ -0,0 +1,47 @@
+From dfebda98ce08d0cab411521ab3d9e832ed1b4608 Mon Sep 17 00:00:00 2001
+From: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
+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 <abdellatif.elkhlifi@arm.com>
+---
+ 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
+
diff --git a/meta-arm-bsp/recipes-bsp/u-boot/u-boot_%.bbappend b/meta-arm-bsp/recipes-bsp/u-boot/u-boot_%.bbappend
index 79bc7bf5..07ba7a18 100644
--- a/meta-arm-bsp/recipes-bsp/u-boot/u-boot_%.bbappend
+++ b/meta-arm-bsp/recipes-bsp/u-boot/u-boot_%.bbappend
@@ -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   \ 
         "
 
 #
-- 
2.17.1



^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 6/8] arm-bsp/trusted-services: corstone1000: Fix PSA_RAW_KEY agreement test
  2023-06-22 13:08 [PATCH 0/8] arm-bsp/corstone1000: Various fixes for upcoming release emekcan.aras
                   ` (4 preceding siblings ...)
  2023-06-22 13:08 ` [PATCH 5/8] arm-bsp/u-boot: corstone1000: Fix u-boot compilation warnings emekcan.aras
@ 2023-06-22 13:08 ` emekcan.aras
  2023-06-22 13:08 ` [PATCH 7/8] arm-bsp/trusted-services: corstone1000: Fix Capsule Update emekcan.aras
  2023-06-22 13:08 ` [PATCH 8/8] arm-bsp/trusted-firmware-a: corstone1000: Fix Trusted-Firmware-A version for corstone1000 emekcan.aras
  7 siblings, 0 replies; 9+ messages in thread
From: emekcan.aras @ 2023-06-22 13:08 UTC (permalink / raw)
  To: meta-arm, Ross.Burton, Jon.Mason; +Cc: nd, Emekcan Aras

From: Emekcan Aras <emekcan.aras@arm.com>

Adds missing compilation option to fix psa_raw_key_aggrement test for
corstone1000.

Signed-off-by: Emekcan Aras <emekcan.aras@arm.com>
---
 ...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

diff --git a/meta-arm-bsp/recipes-security/trusted-services/corstone1000/0005-plat-corstone1000-add-compile-definitions-for-ECP_DP.patch b/meta-arm-bsp/recipes-security/trusted-services/corstone1000/0005-plat-corstone1000-add-compile-definitions-for-ECP_DP.patch
new file mode 100644
index 00000000..5d7ab5f5
--- /dev/null
+++ b/meta-arm-bsp/recipes-security/trusted-services/corstone1000/0005-plat-corstone1000-add-compile-definitions-for-ECP_DP.patch
@@ -0,0 +1,29 @@
+From 041d30bb9cc6857f5ef26ded154ff7126dafaa20 Mon Sep 17 00:00:00 2001
+From: Emekcan Aras <emekcan.aras@arm.com>
+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 <emekcan.aras@arm.com>
+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
+
diff --git a/meta-arm-bsp/recipes-security/trusted-services/ts-arm-platforms.inc b/meta-arm-bsp/recipes-security/trusted-services/ts-arm-platforms.inc
index 8b7776c9..baf4dbdb 100644
--- a/meta-arm-bsp/recipes-security/trusted-services/ts-arm-platforms.inc
+++ b/meta-arm-bsp/recipes-security/trusted-services/ts-arm-platforms.inc
@@ -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 \
     "
 
 
-- 
2.17.1



^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 7/8] arm-bsp/trusted-services: corstone1000: Fix Capsule Update
  2023-06-22 13:08 [PATCH 0/8] arm-bsp/corstone1000: Various fixes for upcoming release emekcan.aras
                   ` (5 preceding siblings ...)
  2023-06-22 13:08 ` [PATCH 6/8] arm-bsp/trusted-services: corstone1000: Fix PSA_RAW_KEY agreement test emekcan.aras
@ 2023-06-22 13:08 ` emekcan.aras
  2023-06-22 13:08 ` [PATCH 8/8] arm-bsp/trusted-firmware-a: corstone1000: Fix Trusted-Firmware-A version for corstone1000 emekcan.aras
  7 siblings, 0 replies; 9+ messages in thread
From: emekcan.aras @ 2023-06-22 13:08 UTC (permalink / raw)
  To: meta-arm, Ross.Burton, Jon.Mason; +Cc: nd, Emekcan Aras

From: Emekcan Aras <emekcan.aras@arm.com>

Adds missing update service definitions for using stateless platform
services and initializes the capsule udpate provider in se-proxy-sp
for corstone1000.

Signed-off-by: Emekcan Aras <emekcan.aras@arm.com>
---
 ...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

diff --git a/meta-arm-bsp/recipes-security/trusted-services/corstone1000/0006-plat-corstone1000-Use-the-stateless-platform-service.patch b/meta-arm-bsp/recipes-security/trusted-services/corstone1000/0006-plat-corstone1000-Use-the-stateless-platform-service.patch
new file mode 100644
index 00000000..4e9d5c2e
--- /dev/null
+++ b/meta-arm-bsp/recipes-security/trusted-services/corstone1000/0006-plat-corstone1000-Use-the-stateless-platform-service.patch
@@ -0,0 +1,141 @@
+From a71e99045996c57a4f80509ae8b770aa4f73f6c0 Mon Sep 17 00:00:00 2001
+From: Emekcan Aras <emekcan.aras@arm.com>
+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 <satish.kumar01@arm.com>
+Signed-off-by: Mohamed Omar Asaker <mohamed.omarasaker@arm.com>
+Signed-off-by: Emekcan Aras <emekcan.aras@arm.com>
+
+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
+
diff --git a/meta-arm-bsp/recipes-security/trusted-services/corstone1000/0007-plat-corstone1000-Initialize-capsule-update-provider.patch b/meta-arm-bsp/recipes-security/trusted-services/corstone1000/0007-plat-corstone1000-Initialize-capsule-update-provider.patch
new file mode 100644
index 00000000..3e6f606c
--- /dev/null
+++ b/meta-arm-bsp/recipes-security/trusted-services/corstone1000/0007-plat-corstone1000-Initialize-capsule-update-provider.patch
@@ -0,0 +1,78 @@
+From b5b31064959665f4cc616733be3d989ae4356636 Mon Sep 17 00:00:00 2001
+From: Emekcan Aras <emekcan.aras@arm.com>
+Date: Sun, 18 Jun 2023 16:05:27 +0100
+Subject: [PATCH] plat: corstone1000: Initialize capsule update provider
+
+Initializes the capsule update service provider in se-proxy-sp.c deployment
+for corstone1000.
+
+Signed-off-by: Emekcan Aras <emekcan.aras@arm.com>
+Upstream-Status: Inappropriate [Design is to revisted]
+
+---
+ deployments/se-proxy/env/commonsp/se_proxy_sp.c |  3 +++
+ .../infra/corstone1000/service_proxy_factory.c  | 17 +++++++++++++++++
+ .../se-proxy/infra/service_proxy_factory.h      |  1 +
+ 3 files changed, 21 insertions(+)
+
+diff --git a/deployments/se-proxy/env/commonsp/se_proxy_sp.c b/deployments/se-proxy/env/commonsp/se_proxy_sp.c
+index 45fcb385..dc2a9d49 100644
+--- a/deployments/se-proxy/env/commonsp/se_proxy_sp.c
++++ b/deployments/se-proxy/env/commonsp/se_proxy_sp.c
+@@ -77,6 +77,9 @@ void __noreturn sp_main(struct ffa_init_info *init_info)
+ 	}
+ 	rpc_demux_attach(&rpc_demux, SE_PROXY_INTERFACE_ID_ATTEST, rpc_iface);
+ 
++	rpc_iface = capsule_update_proxy_create();
++	rpc_demux_attach(&rpc_demux, SE_PROXY_INTERFACE_ID_CAPSULE_UPDATE, rpc_iface);
++
+ 	/* End of boot phase */
+ 	result = sp_msg_wait(&req_msg);
+ 	if (result != SP_RESULT_OK) {
+diff --git a/deployments/se-proxy/infra/corstone1000/service_proxy_factory.c b/deployments/se-proxy/infra/corstone1000/service_proxy_factory.c
+index bacab1de..32d88c97 100644
+--- a/deployments/se-proxy/infra/corstone1000/service_proxy_factory.c
++++ b/deployments/se-proxy/infra/corstone1000/service_proxy_factory.c
+@@ -14,6 +14,7 @@
+ #include <service/crypto/factory/crypto_provider_factory.h>
+ #include <service/secure_storage/frontend/secure_storage_provider/secure_storage_provider.h>
+ #include <trace.h>
++#include <service/capsule_update/provider/capsule_update_provider.h>
+ 
+ /* backends */
+ #include <service/crypto/backend/psa_ipc/crypto_ipc_backend.h>
+@@ -94,3 +95,19 @@ struct rpc_interface *its_proxy_create(void)
+ 
+ 	return secure_storage_provider_init(&its_provider, backend);
+ }
++
++struct rpc_interface *capsule_update_proxy_create(void)
++{
++	static struct capsule_update_provider capsule_update_provider;
++	static struct rpc_caller *capsule_update_caller;
++
++	capsule_update_caller = psa_ipc_caller_init(&psa_ipc);
++
++	if (!capsule_update_caller)
++	return NULL;
++
++	capsule_update_provider.client.caller = capsule_update_caller;
++
++	return capsule_update_provider_init(&capsule_update_provider);
++}
++
+diff --git a/deployments/se-proxy/infra/service_proxy_factory.h b/deployments/se-proxy/infra/service_proxy_factory.h
+index 298d407a..02aa7fe2 100644
+--- a/deployments/se-proxy/infra/service_proxy_factory.h
++++ b/deployments/se-proxy/infra/service_proxy_factory.h
+@@ -17,6 +17,7 @@ struct rpc_interface *attest_proxy_create(void);
+ struct rpc_interface *crypto_proxy_create(void);
+ struct rpc_interface *ps_proxy_create(void);
+ struct rpc_interface *its_proxy_create(void);
++struct rpc_interface *capsule_update_proxy_create(void);
+ 
+ #ifdef __cplusplus
+ }
+-- 
+2.17.1
+
diff --git a/meta-arm-bsp/recipes-security/trusted-services/ts-arm-platforms.inc b/meta-arm-bsp/recipes-security/trusted-services/ts-arm-platforms.inc
index baf4dbdb..3535ddb6 100644
--- a/meta-arm-bsp/recipes-security/trusted-services/ts-arm-platforms.inc
+++ b/meta-arm-bsp/recipes-security/trusted-services/ts-arm-platforms.inc
@@ -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 \
     "
 
 
-- 
2.17.1



^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 8/8] arm-bsp/trusted-firmware-a: corstone1000: Fix Trusted-Firmware-A version for corstone1000
  2023-06-22 13:08 [PATCH 0/8] arm-bsp/corstone1000: Various fixes for upcoming release emekcan.aras
                   ` (6 preceding siblings ...)
  2023-06-22 13:08 ` [PATCH 7/8] arm-bsp/trusted-services: corstone1000: Fix Capsule Update emekcan.aras
@ 2023-06-22 13:08 ` emekcan.aras
  7 siblings, 0 replies; 9+ messages in thread
From: emekcan.aras @ 2023-06-22 13:08 UTC (permalink / raw)
  To: meta-arm, Ross.Burton, Jon.Mason; +Cc: nd, Emekcan Aras

From: Emekcan Aras <emekcan.aras@arm.com>

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.

Signed-off-by: Emekcan Aras <emekcan.aras@arm.com>
---
 .../trusted-firmware-a/trusted-firmware-a-corstone1000.inc    | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/meta-arm-bsp/recipes-bsp/trusted-firmware-a/trusted-firmware-a-corstone1000.inc b/meta-arm-bsp/recipes-bsp/trusted-firmware-a/trusted-firmware-a-corstone1000.inc
index 00810346..3a5be11f 100644
--- a/meta-arm-bsp/recipes-bsp/trusted-firmware-a/trusted-firmware-a-corstone1000.inc
+++ b/meta-arm-bsp/recipes-bsp/trusted-firmware-a/trusted-firmware-a-corstone1000.inc
@@ -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"
-- 
2.17.1



^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2023-06-22 13:08 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-22 13:08 [PATCH 0/8] arm-bsp/corstone1000: Various fixes for upcoming release emekcan.aras
2023-06-22 13:08 ` [PATCH 1/8] arm-bsp/u-boot: corstone1000: Fix EFI multiple protocol install failure emekcan.aras
2023-06-22 13:08 ` [PATCH 2/8] arm-bsp/u-boot: corstone1000: Enable EFI set/get time services emekcan.aras
2023-06-22 13:08 ` [PATCH 3/8] arm-bsp/trusted-services: corstone1000: GetNextVariableName Fix emekcan.aras
2023-06-22 13:08 ` [PATCH 4/8] arm-bsp/optee-os:corstone1000: Drop SPMC non secure interrupt patches emekcan.aras
2023-06-22 13:08 ` [PATCH 5/8] arm-bsp/u-boot: corstone1000: Fix u-boot compilation warnings emekcan.aras
2023-06-22 13:08 ` [PATCH 6/8] arm-bsp/trusted-services: corstone1000: Fix PSA_RAW_KEY agreement test emekcan.aras
2023-06-22 13:08 ` [PATCH 7/8] arm-bsp/trusted-services: corstone1000: Fix Capsule Update emekcan.aras
2023-06-22 13:08 ` [PATCH 8/8] arm-bsp/trusted-firmware-a: corstone1000: Fix Trusted-Firmware-A version for corstone1000 emekcan.aras

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.