Skip to contentSkip to conversation

arm-bsp/trusted-firmware-m:corstone1000: update to 2.0

PATCH Applied [email protected] 2 participants 5 messages Mar 13, 2024 – Mar 18, 2024 Arm STM32

lore
Share & tools
lore
#0 lore raw

cover arm-bsp/trusted-firmware-m:corstone1000: update to 2.0

From: Ali Can Ozaslan <[email protected]>

This change upgrades the trusted-firmware-m version to 2.0 for Corstone-1000. Due to the changes in TF-M 2.0, psa services requires a seperate client_id.
GNU Arm compiler version is bumped in tusted-firmware-m.

Ali Can Ozaslan (3):
arm-bsp/trusted-firmware-m: corstone1000: update to 2.0 arm-bsp/trusted-services: corstone1000: Client Id adjustments after

    TF-M 2.0

arm/trusted-firmware-m: Change GNU Arm compiler version for TF-M 2.0

 .../conf/machine/include/corstone1000.inc     |   2 +-
 .../corstone1000/images/ExternalFlash.png     | Bin 40835 -> 54896 bytes
 ...ware-m-disable-address-warnings-into.patch |  26 ++
 ...e1000-Increase-BL2-size-in-flash-lay.patch |  27 --
 ...orstone1000-Update-MPU-configuration.patch | 274 ++++++++++++++++++
 ...-Corstone1000-Increase-BL2_DATA_SIZE.patch |  31 --
 ...m-corstone1000-Cover-S_DATA-with-MPU.patch |  76 +++++
 ...e1000-Calculate-the-new-CRC32-value-.patch |  69 -----
 ...e1000-Fix-issues-due-to-adjustment-M.patch |  76 +++++
 ...ed-firmware-m-disable-fatal-warnings.patch |  24 --
 ...ne1000-align-capsule-update-structs.patch} |   0
 ...orstone1000-add-unique-firmware-GUID.patch |  35 ---
 ...1000-fix-synchronization-issue-on-o.patch} |   0
 ...m-Corstone1000-Enable-Signed-Capsule.patch | 102 -------
 ...rstone1000-skip-the-first-nv-counter.patch |  33 +++
 ...tone1000-increase-ITS-max-asset-size.patch |  29 --
 .../trusted-firmware-m-1.8.1-src.inc          |  46 ---
 .../trusted-firmware-m-corstone1000.inc       |  26 +-
 ...trusted-firmware-m-scripts-native_1.8.1.bb |   2 -
 .../trusted-firmware-m_1.8.1.bb               |   2 -
 ...0009-plat-corstone1000-fmp-client-id.patch |  45 +++
 .../trusted-services/ts-arm-platforms.inc     |   1 +
 .../wic/corstone1000-flash-firmware.wks.in    |   6 +-
 .../trusted-firmware-m/trusted-firmware-m.inc |   6 +-
 24 files changed, 550 insertions(+), 388 deletions(-)
 create mode 100644 meta-arm-bsp/recipes-bsp/trusted-firmware-m/files/0002-arm-trusted-firmware-m-disable-address-warnings-into.patch
 delete mode 100644 meta-arm-bsp/recipes-bsp/trusted-firmware-m/files/corstone1000/0001-Platform-corstone1000-Increase-BL2-size-in-flash-lay.patch
 create mode 100644 meta-arm-bsp/recipes-bsp/trusted-firmware-m/files/corstone1000/0001-platform-corstone1000-Update-MPU-configuration.patch
 delete mode 100644 meta-arm-bsp/recipes-bsp/trusted-firmware-m/files/corstone1000/0002-Platform-Corstone1000-Increase-BL2_DATA_SIZE.patch
 create mode 100644 meta-arm-bsp/recipes-bsp/trusted-firmware-m/files/corstone1000/0002-platform-corstone1000-Cover-S_DATA-with-MPU.patch
 delete mode 100644 meta-arm-bsp/recipes-bsp/trusted-firmware-m/files/corstone1000/0003-Platform-Corstone1000-Calculate-the-new-CRC32-value-.patch
 create mode 100644 meta-arm-bsp/recipes-bsp/trusted-firmware-m/files/corstone1000/0003-Platform-corstone1000-Fix-issues-due-to-adjustment-M.patch
 delete mode 100644 meta-arm-bsp/recipes-bsp/trusted-firmware-m/files/corstone1000/0004-arm-trusted-firmware-m-disable-fatal-warnings.patch
 rename meta-arm-bsp/recipes-bsp/trusted-firmware-m/files/corstone1000/{0008-platform-corstone1000-align-capsule-update-structs.patch => 0004-platform-corstone1000-align-capsule-update-structs.patch} (100%)
 delete mode 100644 meta-arm-bsp/recipes-bsp/trusted-firmware-m/files/corstone1000/0005-Platform-corstone1000-add-unique-firmware-GUID.patch
 rename meta-arm-bsp/recipes-bsp/trusted-firmware-m/files/corstone1000/{0009-platform-corstone1000-fix-synchronization-issue-on-o.patch => 0005-platform-corstone1000-fix-synchronization-issue-on-o.patch} (100%)
 delete mode 100644 meta-arm-bsp/recipes-bsp/trusted-firmware-m/files/corstone1000/0006-Platform-Corstone1000-Enable-Signed-Capsule.patch
 create mode 100644 meta-arm-bsp/recipes-bsp/trusted-firmware-m/files/corstone1000/0006-Platform-Corstone1000-skip-the-first-nv-counter.patch
 delete mode 100644 meta-arm-bsp/recipes-bsp/trusted-firmware-m/files/corstone1000/0007-platform-corstone1000-increase-ITS-max-asset-size.patch
 delete mode 100644 meta-arm-bsp/recipes-bsp/trusted-firmware-m/trusted-firmware-m-1.8.1-src.inc
 delete mode 100644 meta-arm-bsp/recipes-bsp/trusted-firmware-m/trusted-firmware-m-scripts-native_1.8.1.bb
 delete mode 100644 meta-arm-bsp/recipes-bsp/trusted-firmware-m/trusted-firmware-m_1.8.1.bb
 create mode 100644 meta-arm-bsp/recipes-security/trusted-services/corstone1000/0009-plat-corstone1000-fmp-client-id.patch
Signature · 1 line
2.34.1
#1 lore raw

PATCH 1/3 arm-bsp/trusted-firmware-m: corstone1000: update to 2.0

From: Ali Can Ozaslan <[email protected]>

This change upgrades the trusted-firmware-m version to 2.0 for Corstone-1000.

Emekcan Aras <[email protected]>

---
 .../conf/machine/include/corstone1000.inc     |   2 +-
 .../corstone1000/images/ExternalFlash.png     | Bin 40835 -> 54896 bytes
 ...ware-m-disable-address-warnings-into.patch |  26 ++
 ...e1000-Increase-BL2-size-in-flash-lay.patch |  27 --
 ...orstone1000-Update-MPU-configuration.patch | 274 ++++++++++++++++++
 ...-Corstone1000-Increase-BL2_DATA_SIZE.patch |  31 --
 ...m-corstone1000-Cover-S_DATA-with-MPU.patch |  76 +++++
 ...e1000-Calculate-the-new-CRC32-value-.patch |  69 -----
 ...e1000-Fix-issues-due-to-adjustment-M.patch |  76 +++++
 ...ed-firmware-m-disable-fatal-warnings.patch |  24 --
 ...ne1000-align-capsule-update-structs.patch} |   0
 ...orstone1000-add-unique-firmware-GUID.patch |  35 ---
 ...1000-fix-synchronization-issue-on-o.patch} |   0
 ...m-Corstone1000-Enable-Signed-Capsule.patch | 102 -------
 ...rstone1000-skip-the-first-nv-counter.patch |  33 +++
 ...tone1000-increase-ITS-max-asset-size.patch |  29 --
 .../trusted-firmware-m-1.8.1-src.inc          |  46 ---
 .../trusted-firmware-m-corstone1000.inc       |  26 +-
 ...trusted-firmware-m-scripts-native_1.8.1.bb |   2 -
 .../trusted-firmware-m_1.8.1.bb               |   2 -
 .../wic/corstone1000-flash-firmware.wks.in    |   6 +-
 21 files changed, 501 insertions(+), 385 deletions(-)
 create mode 100644 meta-arm-bsp/recipes-bsp/trusted-firmware-m/files/0002-arm-trusted-firmware-m-disable-address-warnings-into.patch
 delete mode 100644 meta-arm-bsp/recipes-bsp/trusted-firmware-m/files/corstone1000/0001-Platform-corstone1000-Increase-BL2-size-in-flash-lay.patch
 create mode 100644 meta-arm-bsp/recipes-bsp/trusted-firmware-m/files/corstone1000/0001-platform-corstone1000-Update-MPU-configuration.patch
 delete mode 100644 meta-arm-bsp/recipes-bsp/trusted-firmware-m/files/corstone1000/0002-Platform-Corstone1000-Increase-BL2_DATA_SIZE.patch
 create mode 100644 meta-arm-bsp/recipes-bsp/trusted-firmware-m/files/corstone1000/0002-platform-corstone1000-Cover-S_DATA-with-MPU.patch
 delete mode 100644 meta-arm-bsp/recipes-bsp/trusted-firmware-m/files/corstone1000/0003-Platform-Corstone1000-Calculate-the-new-CRC32-value-.patch
 create mode 100644 meta-arm-bsp/recipes-bsp/trusted-firmware-m/files/corstone1000/0003-Platform-corstone1000-Fix-issues-due-to-adjustment-M.patch
 delete mode 100644 meta-arm-bsp/recipes-bsp/trusted-firmware-m/files/corstone1000/0004-arm-trusted-firmware-m-disable-fatal-warnings.patch
 rename meta-arm-bsp/recipes-bsp/trusted-firmware-m/files/corstone1000/{0008-platform-corstone1000-align-capsule-update-structs.patch => 0004-platform-corstone1000-align-capsule-update-structs.patch} (100%)
 delete mode 100644 meta-arm-bsp/recipes-bsp/trusted-firmware-m/files/corstone1000/0005-Platform-corstone1000-add-unique-firmware-GUID.patch
 rename meta-arm-bsp/recipes-bsp/trusted-firmware-m/files/corstone1000/{0009-platform-corstone1000-fix-synchronization-issue-on-o.patch => 0005-platform-corstone1000-fix-synchronization-issue-on-o.patch} (100%)
 delete mode 100644 meta-arm-bsp/recipes-bsp/trusted-firmware-m/files/corstone1000/0006-Platform-Corstone1000-Enable-Signed-Capsule.patch
 create mode 100644 meta-arm-bsp/recipes-bsp/trusted-firmware-m/files/corstone1000/0006-Platform-Corstone1000-skip-the-first-nv-counter.patch
 delete mode 100644 meta-arm-bsp/recipes-bsp/trusted-firmware-m/files/corstone1000/0007-platform-corstone1000-increase-ITS-max-asset-size.patch
 delete mode 100644 meta-arm-bsp/recipes-bsp/trusted-firmware-m/trusted-firmware-m-1.8.1-src.inc
 delete mode 100644 meta-arm-bsp/recipes-bsp/trusted-firmware-m/trusted-firmware-m-scripts-native_1.8.1.bb
 delete mode 100644 meta-arm-bsp/recipes-bsp/trusted-firmware-m/trusted-firmware-m_1.8.1.bb
meta-arm-bsp/conf/machine/include/corstone1000.inc +1 -1
index a25a214e..a82d0076 100644
@@ -3,7 +3,7 @@ require conf/machine/include/arm/armv8a/tune-cortexa35.inc
 MACHINEOVERRIDES =. "corstone1000:"
 
 # TF-M
-PREFERRED_VERSION_trusted-firmware-m ?= "1.8.%"
+PREFERRED_VERSION_trusted-firmware-m ?= "2.0.%"
 
 # TF-A
 TFA_PLATFORM = "corstone1000"
meta-arm-bsp/documentation/corstone1000/images/ExternalFlash.png binary +0 -0
index 399f87568fa16af62a12aeebfad913d38a7577df..578f0389969ecebbd284d78e062a0df1af4067fe 100644
GIT binary patch
meta-arm-bsp/recipes-bsp/trusted-firmware-m/files/0002-arm-trusted-firmware-m-disable-address-warnings-into.patch new file +26 -0
new file mode 100644
index 00000000..1f19f55c
@@ -0,0 +1,26 @@
+From 961d2e3718e9e6d652cadf5b4d3597cfe822dd04 Mon Sep 17 00:00:00 2001
+From: Ali Can Ozaslan <[email protected]>
+Date: Wed, 24 Jan 2024 16:10:08 +0000
+Subject: [PATCH] arm/trusted-firmware-m: disable address warnings into an
+ error
+
+Signed-off-by: Emekcan Aras <[email protected]>
+Signed-off-by: Ali Can Ozaslan <[email protected]>
+Upstream-Status: Inappropriate
+
+---
+ toolchain_GNUARM.cmake | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/toolchain_GNUARM.cmake b/toolchain_GNUARM.cmake
+index b6ae50ec3..4c2f5b3d7 100644
+--- a/toolchain_GNUARM.cmake
++++ b/toolchain_GNUARM.cmake
+@@ -111,6 +111,7 @@ add_compile_options(
+     -Wno-format
+     -Wno-return-type
+     -Wno-unused-but-set-variable
++    -Wno-error=address
+     -c
+     -fdata-sections
+     -ffunction-sections
meta-arm-bsp/recipes-bsp/trusted-firmware-m/files/corstone1000/0001-Platform-corstone1000-Increase-BL2-size-in-flash-lay.patch deleted +0 -27
deleted file mode 100644
index 4f00ea28..00000000
@@ -1,27 +0,0 @@
-From 60598f3b44237bd5038e33400e749ec1e7e8fbda Mon Sep 17 00:00:00 2001
-From: Emekcan Aras <[email protected]>
-Date: Mon, 15 May 2023 10:42:23 +0100
-Subject: [PATCH] Platform: corstone1000: Increase BL2 size in flash layout
-
-Increases BL2 size to align with the flash page size in corstone1000.
-
-Signed-off-by: Emekcan Aras <[email protected]>
-Upstream-Status: Submitted [https://review.trustedfirmware.org/c/TF-M/trusted-firmware-m/+/24103]
-
----
- platform/ext/target/arm/corstone1000/partition/flash_layout.h | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/platform/ext/target/arm/corstone1000/partition/flash_layout.h b/platform/ext/target/arm/corstone1000/partition/flash_layout.h
-index 41b4c6323f..bfe8c4fb3c 100644
---- a/platform/ext/target/arm/corstone1000/partition/flash_layout.h
-+++ b/platform/ext/target/arm/corstone1000/partition/flash_layout.h
-@@ -89,7 +89,7 @@
- #endif
- 
- /* Static Configurations of the Flash */
--#define SE_BL2_PARTITION_SIZE           (0x18800)    /* 98 KB */
-+#define SE_BL2_PARTITION_SIZE           (0x19000)    /* 98 KB */
- #define SE_BL2_BANK_0_OFFSET            (0x9000)  /* 72nd LBA */
- #define SE_BL2_BANK_1_OFFSET            (0x1002000)  /* 32784th LBA */
- 
meta-arm-bsp/recipes-bsp/trusted-firmware-m/files/corstone1000/0001-platform-corstone1000-Update-MPU-configuration.patch new file +274 -0

274 lines not on this page · raw message

meta-arm-bsp/recipes-bsp/trusted-firmware-m/files/corstone1000/0002-Platform-Corstone1000-Increase-BL2_DATA_SIZE.patch deleted +0 -31
deleted file mode 100644
index 6bbd66fd..00000000
@@ -1,31 +0,0 @@
-From b05fb661b3afc3ed8e3d4817df2798e9d4877b39 Mon Sep 17 00:00:00 2001
-From: Emekcan Aras <[email protected]>
-Date: Mon, 15 May 2023 10:46:18 +0100
-Subject: [PATCH] Platform: Corstone1000: Increase BL2_DATA_SIZE
-
-Increases BL2_DATA_SIZE to accommodate the changes in
-metadata_write/read.
-
-Signed-off-by: Emekcan Aras <[email protected]>
-Upstream-Status: Submitted [https://review.trustedfirmware.org/c/TF-M/trusted-firmware-m/+/24103]
-
----
- platform/ext/target/arm/corstone1000/partition/region_defs.h | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
-
-diff --git a/platform/ext/target/arm/corstone1000/partition/region_defs.h b/platform/ext/target/arm/corstone1000/partition/region_defs.h
-index abfac39b62..e7f0bad2ba 100644
---- a/platform/ext/target/arm/corstone1000/partition/region_defs.h
-+++ b/platform/ext/target/arm/corstone1000/partition/region_defs.h
-@@ -90,9 +90,10 @@
- #define BL2_CODE_SIZE     (IMAGE_BL2_CODE_SIZE)
- #define BL2_CODE_LIMIT    (BL2_CODE_START + BL2_CODE_SIZE - 1)
- 
-+#define BL2_DATA_ADDITIONAL 448 /* To increase the BL2_DATA_SIZE more than the default value */
- #define BL2_DATA_START    (BOOT_TFM_SHARED_DATA_BASE + \
-                            BOOT_TFM_SHARED_DATA_SIZE)
--#define BL2_DATA_SIZE     (BL2_CODE_START - BL2_HEADER_SIZE - BL2_DATA_START)
-+#define BL2_DATA_SIZE     (BL2_CODE_START - BL2_HEADER_SIZE - BL2_DATA_START + BL2_DATA_ADDITIONAL)
- #define BL2_DATA_LIMIT    (BL2_DATA_START + BL2_DATA_SIZE - 1)
- 
- /* SE BL1 regions */
meta-arm-bsp/recipes-bsp/trusted-firmware-m/files/corstone1000/0002-platform-corstone1000-Cover-S_DATA-with-MPU.patch new file +76 -0

76 lines not on this page · raw message

meta-arm-bsp/recipes-bsp/trusted-firmware-m/files/corstone1000/0003-Platform-Corstone1000-Calculate-the-new-CRC32-value-.patch deleted +0 -69

69 lines not on this page · raw message

meta-arm-bsp/recipes-bsp/trusted-firmware-m/files/corstone1000/0003-Platform-corstone1000-Fix-issues-due-to-adjustment-M.patch new file +76 -0

76 lines not on this page · raw message

meta-arm-bsp/recipes-bsp/trusted-firmware-m/files/corstone1000/0004-arm-trusted-firmware-m-disable-fatal-warnings.patch deleted +0 -24
deleted file mode 100644
index 07db4f6d..00000000
@@ -1,24 +0,0 @@
-From 04ce07d289e8cec75223349e9ebf7e69126fc04d Mon Sep 17 00:00:00 2001
-From: Jon Mason <[email protected]>
-Date: Wed, 18 Jan 2023 15:13:37 -0500
-Subject: [PATCH] arm/trusted-firmware-m: disable fatal warnings
-
-Signed-off-by: Jon Mason <[email protected]>
-Upstream-Status: Inappropriate
-
----
- toolchain_GNUARM.cmake | 1 -
- 1 file changed, 1 deletion(-)
-
-diff --git a/toolchain_GNUARM.cmake b/toolchain_GNUARM.cmake
-index 7989718515..a5939323d6 100644
---- a/toolchain_GNUARM.cmake
-+++ b/toolchain_GNUARM.cmake
-@@ -71,7 +71,6 @@ macro(tfm_toolchain_reset_linker_flags)
-         --entry=Reset_Handler
-         -specs=nano.specs
-         LINKER:-check-sections
--        LINKER:-fatal-warnings
-         LINKER:--gc-sections
-         LINKER:--no-wchar-size-warning
-         ${MEMORY_USAGE_FLAG}
meta-arm-bsp/recipes-bsp/trusted-firmware-m/files/corstone1000/0004-platform-corstone1000-align-capsule-update-structs.patch renamed from meta-arm-bsp/recipes-bsp/trusted-firmware-m/files/corstone1000/0008-platform-corstone1000-align-capsule-update-structs.patch +0 -0
similarity index 100%
rename from meta-arm-bsp/recipes-bsp/trusted-firmware-m/files/corstone1000/0008-platform-corstone1000-align-capsule-update-structs.patch
rename to meta-arm-bsp/recipes-bsp/trusted-firmware-m/files/corstone1000/0004-platform-corstone1000-align-capsule-update-structs.patch
meta-arm-bsp/recipes-bsp/trusted-firmware-m/files/corstone1000/0005-Platform-corstone1000-add-unique-firmware-GUID.patch deleted +0 -35
deleted file mode 100644
index e4eba624..00000000
@@ -1,35 +0,0 @@
-From 3004fda909079ebebd62c495a4e49e64d6c8a85f Mon Sep 17 00:00:00 2001
-From: Anusmita Dutta Mazumder <[email protected]>
-Date: Tue, 8 Aug 2023 10:58:01 +0000
-Subject: [PATCH] Platform corstone1000 add unique firmware GUID
-
-Add unique Corstone-1000 firmware GUID
-
-Signed-off-by: Anusmita Dutta Mazumder <[email protected]>
-Upstream-Status: Submitted [https://review.trustedfirmware.org/c/TF-M/trusted-firmware-m/+/24132/3]
----
- .../target/arm/corstone1000/fw_update_agent/fwu_agent.c   | 8 ++++----
- 1 file changed, 4 insertions(+), 4 deletions(-)
-
-diff --git a/platform/ext/target/arm/corstone1000/fw_update_agent/fwu_agent.c b/platform/ext/target/arm/corstone1000/fw_update_agent/fwu_agent.c
-index f564f2902c..9c31aeee9d 100644
---- a/platform/ext/target/arm/corstone1000/fw_update_agent/fwu_agent.c
-+++ b/platform/ext/target/arm/corstone1000/fw_update_agent/fwu_agent.c
-@@ -113,10 +113,10 @@ enum fwu_agent_state_t {
- };
- 
- struct efi_guid full_capsule_image_guid = {
--    .time_low = 0xe2bb9c06,
--    .time_mid = 0x70e9,
--    .time_hi_and_version = 0x4b14,
--    .clock_seq_and_node = {0x97, 0xa3, 0x5a, 0x79, 0x13, 0x17, 0x6e, 0x3f}
-+    .time_low = 0x989f3a4e,
-+    .time_mid = 0x46e0,
-+    .time_hi_and_version = 0x4cd0,
-+    .clock_seq_and_node = {0x98, 0x77, 0xa2, 0x5c, 0x70, 0xc0, 0x13, 0x29}
- };
- 
- 
--- 
-2.38.1
-
meta-arm-bsp/recipes-bsp/trusted-firmware-m/files/corstone1000/0005-platform-corstone1000-fix-synchronization-issue-on-o.patch renamed from meta-arm-bsp/recipes-bsp/trusted-firmware-m/files/corstone1000/0009-platform-corstone1000-fix-synchronization-issue-on-o.patch +0 -0
similarity index 100%
rename from meta-arm-bsp/recipes-bsp/trusted-firmware-m/files/corstone1000/0009-platform-corstone1000-fix-synchronization-issue-on-o.patch
rename to meta-arm-bsp/recipes-bsp/trusted-firmware-m/files/corstone1000/0005-platform-corstone1000-fix-synchronization-issue-on-o.patch
meta-arm-bsp/recipes-bsp/trusted-firmware-m/files/corstone1000/0006-Platform-Corstone1000-Enable-Signed-Capsule.patch deleted +0 -102

102 lines not on this page · raw message

meta-arm-bsp/recipes-bsp/trusted-firmware-m/files/corstone1000/0006-Platform-Corstone1000-skip-the-first-nv-counter.patch new file +33 -0
new file mode 100644
index 00000000..4c486e69
@@ -0,0 +1,33 @@
+From 001e5bea183bc78352ac3ba6283d9d7912bb6ea5 Mon Sep 17 00:00:00 2001
+From: Emekcan Aras <[email protected]>
+Date: Wed, 21 Feb 2024 07:44:25 +0000
+Subject: [PATCH] Platform: Corstone1000: skip the first nv counter
+
+It skips doing a sanity check the BL2 nv counter after the capsule
+update since the tfm bl1 does not sync metadata and nv counters in OTP during
+the boot anymore.
+
+Signed-off-by: Emekcan Aras <[email protected]>
+Upstream-Status: Pending
+
+---
+ .../ext/target/arm/corstone1000/fw_update_agent/fwu_agent.c     | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/platform/ext/target/arm/corstone1000/fw_update_agent/fwu_agent.c b/platform/ext/target/arm/corstone1000/fw_update_agent/fwu_agent.c
+index 2e6de255b..2e6cf8047 100644
+--- a/platform/ext/target/arm/corstone1000/fw_update_agent/fwu_agent.c
++++ b/platform/ext/target/arm/corstone1000/fw_update_agent/fwu_agent.c
+@@ -1125,7 +1125,7 @@ static enum fwu_agent_error_t update_nv_counters(
+ 
+     FWU_LOG_MSG("%s: enter\n\r", __func__);
+ 
+-    for (int i = 0; i <= FWU_MAX_NV_COUNTER_INDEX; i++) {
++    for (int i = 1; i <= FWU_MAX_NV_COUNTER_INDEX; i++) {
+ 
+         switch (i) {
+             case FWU_BL2_NV_COUNTER:
+-- 
+2.25.1
+
+
meta-arm-bsp/recipes-bsp/trusted-firmware-m/files/corstone1000/0007-platform-corstone1000-increase-ITS-max-asset-size.patch deleted +0 -29
deleted file mode 100644
index 97cd14da..00000000
@@ -1,29 +0,0 @@
-From ef97f7083279565dab45a550139935d741f159a9 Mon Sep 17 00:00:00 2001
-From: Emekcan Aras <[email protected]>
-Date: Fri, 29 Sep 2023 09:57:19 +0100
-Subject: [PATCH] platform: corstone1000: Increase ITS max asset size
-​
-Increases the max asset size for ITS to enable parsec services & tests
-​
-Upstream-Status: Pending
-Signed-off-by: Emekcan Aras <[email protected]>
-Signed-off-by: Vikas Katariya <[email protected]>
----
- platform/ext/target/arm/corstone1000/config_tfm_target.h | 5 +++++
- 1 files changed, 5 insertions(+)
-​
-diff --git a/platform/ext/target/arm/corstone1000/config_tfm_target.h b/platform/ext/target/arm/corstone1000/config_tfm_target.h
-index e968366639..3f6e8477e5 100644
---- a/platform/ext/target/arm/corstone1000/config_tfm_target.h
-+++ b/platform/ext/target/arm/corstone1000/config_tfm_target.h
-@@ -24,4 +24,9 @@
- #undef PS_NUM_ASSETS
- #define PS_NUM_ASSETS        20
-
-+/* The maximum size of asset to be stored in the Internal Trusted Storage area. */
-+#undef ITS_MAX_ASSET_SIZE
-+#define ITS_MAX_ASSET_SIZE        2048
-+
-+
- #endif /* __CONFIG_TFM_TARGET_H__ */
--- 
\ No newline at end of file
meta-arm-bsp/recipes-bsp/trusted-firmware-m/trusted-firmware-m-1.8.1-src.inc deleted +0 -46

46 lines not on this page · raw message

meta-arm-bsp/recipes-bsp/trusted-firmware-m/trusted-firmware-m-corstone1000.inc +12 -14
index 19ad2897..716d3f1c 100644
@@ -9,13 +9,14 @@ TFM_DEBUG = "1"
 ## Default is the MPS3 board
 TFM_PLATFORM_IS_FVP ?= "FALSE"
 EXTRA_OECMAKE += "-DPLATFORM_IS_FVP=${TFM_PLATFORM_IS_FVP}"
-EXTRA_OECMAKE += "-DCC312_LEGACY_DRIVER_API_ENABLED=ON"
+EXTRA_OECMAKE += "-DCC312_LEGACY_DRIVER_API_ENABLED=OFF"
 
 # libmetal v2023.04.0
 LICENSE += "& BSD-3-Clause"
 LIC_FILES_CHKSUM += "file://../libmetal/LICENSE.md;md5=f4d5df0f12dcea1b1a0124219c0dbab4"
 SRC_URI += "git://github.com/OpenAMP/libmetal.git;protocol=https;branch=main;name=libmetal;destsuffix=git/libmetal \
             file://0001-cmake-modify-path-to-libmetal-version-file.patch;patchdir=../libmetal \
+            file://0002-arm-trusted-firmware-m-disable-address-warnings-into.patch \
            "
 SRCREV_libmetal = "28fa2351d6a8121ce6c1c2ac5ee43ce08d38dbae"
 EXTRA_OECMAKE += "-DLIBMETAL_SRC_PATH=${S}/../libmetal -DLIBMETAL_BIN_PATH=${B}/libmetal-build"
@@ -32,15 +33,12 @@ EXTRA_OECMAKE += "-DLIBOPENAMP_SRC_PATH=${S}/../openamp -DLIBOPENAMP_BIN_PATH=${
 
 FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
 SRC_URI:append:corstone1000 = " \
-    file://0001-Platform-corstone1000-Increase-BL2-size-in-flash-lay.patch \
-    file://0002-Platform-Corstone1000-Increase-BL2_DATA_SIZE.patch \
-    file://0003-Platform-Corstone1000-Calculate-the-new-CRC32-value-.patch \
-    file://0004-arm-trusted-firmware-m-disable-fatal-warnings.patch \
-    file://0005-Platform-corstone1000-add-unique-firmware-GUID.patch \
-    file://0006-Platform-Corstone1000-Enable-Signed-Capsule.patch \
-    file://0007-platform-corstone1000-increase-ITS-max-asset-size.patch \
-    file://0008-platform-corstone1000-align-capsule-update-structs.patch \
-    file://0009-platform-corstone1000-fix-synchronization-issue-on-o.patch \
+    file://0001-platform-corstone1000-Update-MPU-configuration.patch \
+    file://0002-platform-corstone1000-Cover-S_DATA-with-MPU.patch \
+    file://0003-Platform-corstone1000-Fix-issues-due-to-adjustment-M.patch \
+    file://0004-platform-corstone1000-align-capsule-update-structs.patch \
+    file://0005-platform-corstone1000-fix-synchronization-issue-on-o.patch \
+    file://0006-Platform-Corstone1000-skip-the-first-nv-counter.patch \
     "
 
 # TF-M ships patches for external dependencies that needs to be applied
@@ -54,10 +52,10 @@ apply_tfm_patches() {
 do_patch[postfuncs] += "apply_tfm_patches"
 
 do_install() {
-  install -D -p -m 0644 ${B}/install/outputs/tfm_s_signed.bin ${D}/firmware/tfm_s_signed.bin
-  install -D -p -m 0644 ${B}/install/outputs/bl2_signed.bin ${D}/firmware/bl2_signed.bin
-  install -D -p -m 0644 ${B}/install/outputs/bl1_1.bin ${D}/firmware/bl1_1.bin
-  install -D -p -m 0644 ${B}/install/outputs/bl1_provisioning_bundle.bin ${D}/firmware/bl1_provisioning_bundle.bin
+  install -D -p -m 0644 ${B}/bin/tfm_s_signed.bin ${D}/firmware/tfm_s_signed.bin
+  install -D -p -m 0644 ${B}/bin/bl2_signed.bin ${D}/firmware/bl2_signed.bin
+  install -D -p -m 0644 ${B}/bin/bl1_1.bin ${D}/firmware/bl1_1.bin
+  install -D -p -m 0644 ${B}/bin/bl1_provisioning_bundle.bin ${D}/firmware/bl1_provisioning_bundle.bin
 }
 
 create_bl1_image(){
meta-arm-bsp/recipes-bsp/trusted-firmware-m/trusted-firmware-m-scripts-native_1.8.1.bb deleted +0 -2
deleted file mode 100644
index d50d886f..00000000
@@ -1,2 +0,0 @@
-require recipes-bsp/trusted-firmware-m/trusted-firmware-m-${PV}-src.inc
-require recipes-bsp/trusted-firmware-m/trusted-firmware-m-scripts-native.inc
meta-arm-bsp/recipes-bsp/trusted-firmware-m/trusted-firmware-m_1.8.1.bb deleted +0 -2
deleted file mode 100644
index 3464f49d..00000000
@@ -1,2 +0,0 @@
-require recipes-bsp/trusted-firmware-m/trusted-firmware-m-${PV}-src.inc
-require recipes-bsp/trusted-firmware-m/trusted-firmware-m.inc
meta-arm-bsp/wic/corstone1000-flash-firmware.wks.in +3 -3
index 88559dee..6919afd0 100644
@@ -17,7 +17,7 @@ part --source empty --size 4k --align 4 --offset 32k --part-name="private_metada
 
 part --source rawcopy --size 100k --sourceparams="file=bl2_signed.bin" --offset 36k --align 4 --part-name="bl2_primary" --uuid 9A3A8FBF-55EF-439C-80C9-A3F728033929 --part-type 64BD8ADB-02C0-4819-8688-03AB4CAB0ED9
 
-part --source rawcopy --size 376k --sourceparams="file=tfm_s_signed.bin" --align 4 --part-name="tfm_primary" --uuid 07F9616C-1233-439C-ACBA-72D75421BF70 --part-type D763C27F-07F6-4FF0-B2F3-060CB465CD4E
+part --source rawcopy --size 368k --sourceparams="file=tfm_s_signed.bin" --align 4 --part-name="tfm_primary" --uuid 07F9616C-1233-439C-ACBA-72D75421BF70 --part-type D763C27F-07F6-4FF0-B2F3-060CB465CD4E
 
 # Rawcopy of the FIP binary
 part --source rawcopy --size 2 --sourceparams="file=signed_fip-corstone1000.bin" --align 4 --part-name="FIP_A" --uuid B9C7AC9D-40FF-4675-956B-EEF4DE9DF1C5 --part-type B5EB19BD-CF56-45E8-ABA7-7ADB228FFEA7
@@ -26,8 +26,8 @@ part --source rawcopy --size 2 --sourceparams="file=signed_fip-corstone1000.bin"
 part --source rawcopy --size 12 --sourceparams="file=Image.gz-initramfs-${MACHINE}.bin" --align 4 --part-name="kernel_primary" --uuid BF7A6142-0662-47FD-9434-6A8811980816 --part-type 8197561D-6124-46FC-921E-141CC5745B05
 
 
-part --source empty --size 100k --offset 16492k --align 4 --part-name="bl2_secondary" --uuid 3F0C49A4-48B7-4D1E-AF59-3E4A3CE1BA9F --part-type 64BD8ADB-02C0-4819-8688-03AB4CAB0ED9
-part --source empty --size 376k --align 4 --part-name="tfm_secondary" --uuid 009A6A12-64A6-4F0F-9882-57CD79A34A3D --part-type D763C27F-07F6-4FF0-B2F3-060CB465CD4E
+part --source empty --size 100k --offset 16488k --align 4 --part-name="bl2_secondary" --uuid 3F0C49A4-48B7-4D1E-AF59-3E4A3CE1BA9F --part-type 64BD8ADB-02C0-4819-8688-03AB4CAB0ED9
+part --source empty --size 368k --align 4 --part-name="tfm_secondary" --uuid 009A6A12-64A6-4F0F-9882-57CD79A34A3D --part-type D763C27F-07F6-4FF0-B2F3-060CB465CD4E
 part --source empty --size 2 --align 4 --part-name="FIP_B" --uuid 9424E370-7BC9-43BB-8C23-71EE645E1273 --part-type B5EB19BD-CF56-45E8-ABA7-7ADB228FFEA7
 part --source empty --size 12 --align 4 --part-name="kernel_secondary" --uuid A2698A91-F9B1-4629-9188-94E4520808F8 --part-type 8197561D-6124-46FC-921E-141CC5745B05
 
Signature · 1 line
2.34.1
#2 lore raw

PATCH 2/3 arm-bsp/trusted-services: corstone1000: Client Id adjustments after TF-M 2.0

In reply to [email protected]

From: Ali Can Ozaslan <[email protected]>

Corstone-1000 uses trusted-firmware-m as secure enclave software component. Due to the changes in TF-M 2.0, psa services requires a seperate client_id now. This commit adds smm-gateway-sp client id to the FMP services since FMP structure accessed by u-boot via smm-gateway-sp.

---
 ...0009-plat-corstone1000-fmp-client-id.patch | 45 +++++++++++++++++++
 .../trusted-services/ts-arm-platforms.inc     |  1 +
 2 files changed, 46 insertions(+)
 create mode 100644 meta-arm-bsp/recipes-security/trusted-services/corstone1000/0009-plat-corstone1000-fmp-client-id.patch
meta-arm-bsp/recipes-security/trusted-services/corstone1000/0009-plat-corstone1000-fmp-client-id.patch new file +45 -0
new file mode 100644
index 00000000..2fb91f62
@@ -0,0 +1,45 @@
+From 52d962239207bd06827c18d0ed21abdc2002337f Mon Sep 17 00:00:00 2001
+From: emeara01 <[email protected]>
+Date: Thu, 7 Mar 2024 10:24:42 +0000
+Subject: [PATCH] plat: corstone1000: add client_id for FMP service
+
+Corstone1000 uses trusted-firmware-m as secure enclave software component. Due
+to the changes in TF-M 2.0, psa services requires a seperate client_id now.
+This commit adds smm-gateway-sp client id to the FMP services since FMP structure
+accessed by u-boot via smm-gateway-sp.
+
+Signed-off-by: emeara01 <[email protected]>
+Upstream-Status: Inappropriate [Design is to revisted]
+---
+ .../capsule_update/provider/corstone1000_fmp_service.c     | 5 ++++---
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/components/service/capsule_update/provider/corstone1000_fmp_service.c b/components/service/capsule_update/provider/corstone1000_fmp_service.c
+index d811af9f..354d025f 100644
+--- a/components/service/capsule_update/provider/corstone1000_fmp_service.c
++++ b/components/service/capsule_update/provider/corstone1000_fmp_service.c
+@@ -33,6 +33,7 @@
+ 	 EFI_VARIABLE_APPEND_WRITE)
+ 
+ #define FMP_VARIABLES_COUNT	6
++#define SMM_GW_SP_ID		0x8003
+ 
+ static struct variable_metadata fmp_variables_metadata[FMP_VARIABLES_COUNT] = {
+     {
+@@ -91,7 +92,7 @@ static psa_status_t protected_storage_set(struct rpc_caller *caller,
+ 		{ .base = psa_ptr_to_u32(&create_flags), .len = sizeof(create_flags) },
+ 	};
+ 
+-	psa_status = psa_call(caller, TFM_PROTECTED_STORAGE_SERVICE_HANDLE, TFM_PS_ITS_SET,
++	psa_status = psa_call_client_id(caller, TFM_PROTECTED_STORAGE_SERVICE_HANDLE, SMM_GW_SP_ID,TFM_PS_ITS_SET,
+ 			      in_vec, IOVEC_LEN(in_vec), NULL, 0);
+ 	if (psa_status < 0)
+ 		EMSG("ipc_set: psa_call failed: %d", psa_status);
+@@ -114,7 +115,7 @@ static psa_status_t protected_storage_get(struct rpc_caller *caller,
+ 		{ .base = psa_ptr_to_u32(p_data), .len = data_size },
+ 	};
+ 
+-	psa_status = psa_call(caller, TFM_PROTECTED_STORAGE_SERVICE_HANDLE,
++	psa_status = psa_call_client_id(caller, TFM_PROTECTED_STORAGE_SERVICE_HANDLE, SMM_GW_SP_ID,
+ 			      TFM_PS_ITS_GET, in_vec, IOVEC_LEN(in_vec),
+ 			      out_vec, IOVEC_LEN(out_vec));
meta-arm-bsp/recipes-security/trusted-services/ts-arm-platforms.inc +1 -0
index 3c7e94e6..80a58056 100644
@@ -10,6 +10,7 @@ SRC_URI:append:corstone1000  = " \
     file://0006-plat-corstone1000-Use-the-stateless-platform-service.patch \
     file://0007-plat-corstone1000-Initialize-capsule-update-provider.patch \
     file://0008-platform-corstone1000-fix-synchronization-issue.patch \
+    file://0009-plat-corstone1000-fmp-client-id.patch \
     "
 
 
Signature · 1 line
2.34.1
#3 lore raw

PATCH 3/3 arm/trusted-firmware-m: Change GNU Arm compiler version for TF-M 2.0

In reply to [email protected]

From: Ali Can Ozaslan <[email protected]>

GNU Arm compiler version greater and equal than *11.3.Rel1* has a linker issue in syscall for TF-M 1.8.0. Let's bump to TF-M 2.0 which contains the fix for the issue.

---
 .../recipes-bsp/trusted-firmware-m/trusted-firmware-m.inc   | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
meta-arm/recipes-bsp/trusted-firmware-m/trusted-firmware-m.inc +3 -3
index 1747c654..772366d9 100644
@@ -22,13 +22,13 @@ INHIBIT_DEFAULT_DEPS = "1"
 
 PACKAGE_ARCH = "${MACHINE_ARCH}"
 
-# At present, TF-M needs GCC >10 but <11.3 so use 11.2:
-# https://git.trustedfirmware.org/TF-M/trusted-firmware-m.git/tree/docs/getting_started/tfm_getting_started.rst?h=TF-Mv1.8.0#n214
+# At present, TF-M Select other GNU Arm compiler versions instead of 11.2:
+# https://git.trustedfirmware.org/TF-M/trusted-firmware-m.git/tree/docs/getting_started/tfm_getting_started.rst#n214
 #
 # See tools/requirements.txt for Python dependencies
 DEPENDS += "cmake-native \
             ninja-native \
-            gcc-arm-none-eabi-11.2-native \
+            gcc-arm-none-eabi-native \
             python3-cbor2-native \
             python3-click-native \
             python3-cryptography-native \
Signature · 1 line
2.34.1
Applied
#4 lore raw
In reply to [email protected]
Quoted 8 lines · On Wed, 13 Mar 2024 20:13:22 +0000, [email protected] wrote:

From: Ali Can Ozaslan <[email protected]>

This change upgrades the trusted-firmware-m version to 2.0 for Corstone-1000. Due to the changes in TF-M 2.0, psa services requires a seperate client_id.
GNU Arm compiler version is bumped in tusted-firmware-m.

[...]

Applied, thanks!

[1/3] arm-bsp/trusted-firmware-m: corstone1000: update to 2.0

      commit: a8f47e9504a8319c635f0585d75df1737266c81b
[2/3] arm-bsp/trusted-services: corstone1000: Client Id adjustments after TF-M 2.0
      commit: de57703654dc082fc75beac4060b941823619334
[3/3] arm/trusted-firmware-m: Change GNU Arm compiler version for TF-M 2.0
      commit: ab6e5f47889803d4f8bd05bfe71fa20e0b7cd208

Best regards,

Signature · 1 line
Jon Mason <[email protected]>