Build: Refine the measured boot build options

Move measured boot build options into the common platform CMakeLists,
as these options are part of the common boot HAL, available to any
platform.

Unlink the measured boot options from TFM_PARTITION_MEASURED_BOOT to
make it possible to configure the boot options separately from the
runtime config. There are three configs for the bootloader:

- CONFIG_TFM_BOOT_STORE_MEASUREMENTS = OFF
    No measured boot.

- CONFIG_TFM_BOOT_STORE_MEASUREMENTS = ON
    - CONFIG_TFM_BOOT_STORE_ENCODED_MEASUREMENTS = OFF
        Boot measurements stored in unencoded format defined by TF-M
        boot HAL. Boot measurements available from BL1 and BL2.

    - CONFIG_TFM_BOOT_STORE_ENCODED_MEASUREMENTS = ON
        Boot measurements stored in MCUboot CBOR-encoded format. Boot
        measurements only available from MCUboot BL2.

Use TFM_MEASURED_BOOT_API as the C definition for unencoded TF-M
measurements, to correspond to MCUBOOT_MEASURED_BOOT for MCUboot
measurements.

Remove BL1 measured boot and not TFM_PARTITION_MEASURED_BOOT invalid
config, as other partitions could process the BL1 shared data in future.

Remove TFM_PARTITION_MEASURED_BOOT option from CS1000, since it does not
build the measured boot partition, the option was only added to avoid
invalid config.

Signed-off-by: Jamie Fox <jamie.fox@arm.com>
Change-Id: I7f2901b970233a9861d0883a845e90e3e64ceb6e
diff --git a/bl1/bl1_1/CMakeLists.txt b/bl1/bl1_1/CMakeLists.txt
index 92d8638..3b030d2 100644
--- a/bl1/bl1_1/CMakeLists.txt
+++ b/bl1/bl1_1/CMakeLists.txt
@@ -42,7 +42,7 @@
 target_compile_definitions(bl1_1
     PRIVATE
         $<$<BOOL:${TEST_BL1_1}>:TEST_BL1_1>
-        $<$<BOOL:${CONFIG_TFM_BOOT_STORE_MEASUREMENTS}>:CONFIG_TFM_BOOT_STORE_MEASUREMENTS>
+        $<$<AND:$<BOOL:${CONFIG_TFM_BOOT_STORE_MEASUREMENTS}>,$<NOT:$<BOOL:${CONFIG_TFM_BOOT_STORE_ENCODED_MEASUREMENTS}>>>:TFM_MEASURED_BOOT_API>
 )
 
 target_share_symbols(bl1_1 ${BL1_SHARED_SYMBOLS_PATH})
diff --git a/bl1/bl1_1/main.c b/bl1/bl1_1/main.c
index 8342109..6e3b622 100644
--- a/bl1/bl1_1/main.c
+++ b/bl1/bl1_1/main.c
@@ -25,7 +25,7 @@
 
 uint8_t computed_bl1_2_hash[BL1_2_HASH_SIZE];
 
-#ifdef CONFIG_TFM_BOOT_STORE_MEASUREMENTS
+#ifdef TFM_MEASURED_BOOT_API
 #if (BL1_2_HASH_SIZE == 32)
 #define BL1_2_HASH_ALG  PSA_ALG_SHA_256
 #elif (BL1_2_HASH_SIZE == 64)
@@ -53,7 +53,7 @@
         BL1_LOG("[WRN] Failed to store boot measurement of BL1_2\r\n");
     }
 }
-#endif /* CONFIG_TFM_BOOT_STORE_MEASUREMENTS */
+#endif /* TFM_MEASURED_BOOT_API */
 
 static fih_int validate_image_at_addr(uint8_t *image)
 {
@@ -133,9 +133,9 @@
         FIH_PANIC;
     }
 
-#ifdef CONFIG_TFM_BOOT_STORE_MEASUREMENTS
+#ifdef TFM_MEASURED_BOOT_API
     collect_boot_measurement();
-#endif /* CONFIG_TFM_BOOT_STORE_MEASUREMENTS */
+#endif /* TFM_MEASURED_BOOT_API */
 
     BL1_LOG("[INF] Jumping to BL1_2\r\n");
     /* Jump to BL1_2 */
diff --git a/bl1/bl1_2/CMakeLists.txt b/bl1/bl1_2/CMakeLists.txt
index 2142df8..262590e 100644
--- a/bl1/bl1_2/CMakeLists.txt
+++ b/bl1/bl1_2/CMakeLists.txt
@@ -47,7 +47,7 @@
         $<$<BOOL:${TFM_BL1_MEMORY_MAPPED_FLASH}>:TFM_BL1_MEMORY_MAPPED_FLASH>
         $<$<BOOL:${TEST_BL1_2}>:TEST_BL1_2>
         $<$<BOOL:${TFM_BL1_PQ_CRYPTO}>:TFM_BL1_PQ_CRYPTO>
-        $<$<BOOL:${CONFIG_TFM_BOOT_STORE_MEASUREMENTS}>:CONFIG_TFM_BOOT_STORE_MEASUREMENTS>
+        $<$<AND:$<BOOL:${CONFIG_TFM_BOOT_STORE_MEASUREMENTS}>,$<NOT:$<BOOL:${CONFIG_TFM_BOOT_STORE_ENCODED_MEASUREMENTS}>>>:TFM_MEASURED_BOOT_API>
 )
 
 target_link_shared_code(bl1_2
diff --git a/bl1/bl1_2/main.c b/bl1/bl1_2/main.c
index 14d94f9..4217d38 100644
--- a/bl1/bl1_2/main.c
+++ b/bl1/bl1_2/main.c
@@ -26,11 +26,11 @@
 __asm("  .global __ARM_use_no_argv\n");
 #endif
 
-#if defined(CONFIG_TFM_BOOT_STORE_MEASUREMENTS) || !defined(TFM_BL1_PQ_CRYPTO)
+#if defined(TFM_MEASURED_BOOT_API) || !defined(TFM_BL1_PQ_CRYPTO)
 static uint8_t computed_bl2_hash[BL2_HASH_SIZE];
 #endif
 
-#ifdef CONFIG_TFM_BOOT_STORE_MEASUREMENTS
+#ifdef TFM_MEASURED_BOOT_API
 #if (BL2_HASH_SIZE == 32)
 #define BL2_HASH_ALG  PSA_ALG_SHA_256
 #elif (BL2_HASH_SIZE == 64)
@@ -69,7 +69,7 @@
         BL1_LOG("[WRN] Failed to store boot measurement of BL2\r\n");
     }
 }
-#endif /* CONFIG_TFM_BOOT_STORE_MEASUREMENTS */
+#endif /* TFM_MEASURED_BOOT_API */
 
 #ifndef TFM_BL1_PQ_CRYPTO
 static fih_int image_hash_check(struct bl1_2_image_t *img)
@@ -116,7 +116,7 @@
     fih_int fih_rc = FIH_FAILURE;
 
     /* Calculate the image hash for measured boot and/or a hash-locked image */
-#if defined(CONFIG_TFM_BOOT_STORE_MEASUREMENTS) || !defined(TFM_BL1_PQ_CRYPTO)
+#if defined(TFM_MEASURED_BOOT_API) || !defined(TFM_BL1_PQ_CRYPTO)
     FIH_CALL(bl1_sha256_compute, fih_rc, (uint8_t *)&img->protected_values,
                                          sizeof(img->protected_values),
                                          computed_bl2_hash);
@@ -299,12 +299,12 @@
         FIH_PANIC;
     }
 
-#ifdef CONFIG_TFM_BOOT_STORE_MEASUREMENTS
+#ifdef TFM_MEASURED_BOOT_API
     /* At this point there is a valid and decrypted BL2 image in the RAM at
      * address BL2_IMAGE_START.
      */
     collect_boot_measurement((const struct bl1_2_image_t *)BL2_IMAGE_START);
-#endif /* CONFIG_TFM_BOOT_STORE_MEASUREMENTS */
+#endif /* TFM_MEASURED_BOOT_API */
 
     BL1_LOG("[INF] Jumping to BL2\r\n");
     boot_platform_quit((struct boot_arm_vector_table *)BL2_CODE_START);
diff --git a/bl2/CMakeLists.txt b/bl2/CMakeLists.txt
index 2005714..92e696b 100644
--- a/bl2/CMakeLists.txt
+++ b/bl2/CMakeLists.txt
@@ -56,7 +56,7 @@
         $<$<BOOL:${PLATFORM_PSA_ADAC_SECURE_DEBUG}>:PLATFORM_PSA_ADAC_SECURE_DEBUG>
         $<$<BOOL:${TEST_BL2}>:TEST_BL2>
         $<$<BOOL:${TFM_PARTITION_FIRMWARE_UPDATE}>:TFM_PARTITION_FIRMWARE_UPDATE>
-        $<$<BOOL:${CONFIG_TFM_BOOT_STORE_MEASUREMENTS}>:CONFIG_TFM_BOOT_STORE_MEASUREMENTS>
+        $<$<AND:$<BOOL:${CONFIG_TFM_BOOT_STORE_MEASUREMENTS}>,$<NOT:$<BOOL:${CONFIG_TFM_BOOT_STORE_ENCODED_MEASUREMENTS}>>>:TFM_MEASURED_BOOT_API>
 )
 
 add_convert_to_bin_target(bl2)
diff --git a/bl2/src/shared_data.c b/bl2/src/shared_data.c
index e3738b0..9922ea5 100644
--- a/bl2/src/shared_data.c
+++ b/bl2/src/shared_data.c
@@ -12,7 +12,7 @@
 #include "sysflash/sysflash.h"
 #include "mcuboot_config/mcuboot_config.h"
 
-#if defined(CONFIG_TFM_BOOT_STORE_MEASUREMENTS) && !defined(MCUBOOT_MEASURED_BOOT)
+#ifdef TFM_MEASURED_BOOT_API
 #include "boot_hal.h"
 #include "boot_measurement.h"
 #include "bootutil_priv.h"
@@ -25,7 +25,7 @@
 #include  "bootutil/crypto/sha256.h"
 #define SIG_BUF_SIZE (MCUBOOT_SIGN_RSA_LEN / 8)
 #endif
-#endif /* CONFIG_TFM_BOOT_STORE_MEASUREMENTS && !MCUBOOT_MEASURED_BOOT */
+#endif /* TFM_MEASURED_BOOT_API */
 
 /* Firmware Update specific macros */
 #define TLV_MAJOR_FWU   0x2
@@ -44,7 +44,7 @@
 #endif /* TFM_PARTITION_FIRMWARE_UPDATE */
 
 
-#if defined(CONFIG_TFM_BOOT_STORE_MEASUREMENTS) && !defined(MCUBOOT_MEASURED_BOOT)
+#ifdef TFM_MEASURED_BOOT_API
 /**
  * Collect boot measurement and available associated metadata from the
  * TLV area of an image.
@@ -147,7 +147,7 @@
 
     return 0;
 }
-#endif /* CONFIG_TFM_BOOT_STORE_MEASUREMENTS && !MCUBOOT_MEASURED_BOOT */
+#endif /* TFM_MEASURED_BOOT_API */
 
 /**
  * Add application specific data to the shared memory area between the
@@ -169,7 +169,7 @@
     struct image_version image_ver;
     uint16_t fwu_minor;
 #endif
-#if defined(CONFIG_TFM_BOOT_STORE_MEASUREMENTS) && !defined(MCUBOOT_MEASURED_BOOT)
+#ifdef TFM_MEASURED_BOOT_API
     enum boot_measurement_slot_t slot_id;
     uint8_t image_hash[MCUBOOT_HASH_SIZE];
     struct boot_measurement_metadata metadata = {
@@ -179,7 +179,7 @@
         .sw_type = "",
         .sw_version = { 0 },
     };
-#endif /* CONFIG_TFM_BOOT_STORE_MEASUREMENTS && !MCUBOOT_MEASURED_BOOT */
+#endif /* TFM_MEASURED_BOOT_API */
 
     if (hdr == NULL || fap == NULL) {
         return -1;
@@ -219,7 +219,7 @@
     }
 #endif /* TFM_PARTITION_FIRMWARE_UPDATE */
 
-#if defined(CONFIG_TFM_BOOT_STORE_MEASUREMENTS) && !defined(MCUBOOT_MEASURED_BOOT)
+#ifdef TFM_MEASURED_BOOT_API
     /* Determine the index of the measurement slot. */
     slot_id = BOOT_MEASUREMENT_SLOT_RT_0 + mcuboot_image_id;
 
@@ -264,7 +264,7 @@
     if (rc) {
         return rc;
     }
-#endif /* CONFIG_TFM_BOOT_STORE_MEASUREMENTS && !MCUBOOT_MEASURED_BOOT */
+#endif /* TFM_MEASURED_BOOT_API */
 
     return 0;
 }
diff --git a/config/check_config.cmake b/config/check_config.cmake
index 2110340..22cdf45 100644
--- a/config/check_config.cmake
+++ b/config/check_config.cmake
@@ -45,10 +45,6 @@
 tfm_invalid_config(TEST_PSA_API STREQUAL "STORAGE" AND NOT TFM_PARTITION_INTERNAL_TRUSTED_STORAGE)
 tfm_invalid_config(TEST_PSA_API STREQUAL "STORAGE" AND NOT TFM_PARTITION_PROTECTED_STORAGE)
 
-########################## BL1 #################################################
-
-tfm_invalid_config((BL1 AND PLATFORM_DEFAULT_BL1 AND CONFIG_TFM_BOOT_STORE_MEASUREMENTS) AND NOT TFM_PARTITION_MEASURED_BOOT)
-
 ########################## BL2 #################################################
 
 get_property(MCUBOOT_STRATEGY_LIST CACHE MCUBOOT_UPGRADE_STRATEGY PROPERTY STRINGS)
diff --git a/platform/CMakeLists.txt b/platform/CMakeLists.txt
index ad5be27..6c5c7d1 100755
--- a/platform/CMakeLists.txt
+++ b/platform/CMakeLists.txt
@@ -203,6 +203,7 @@
         PRIVATE
             bl2_hal
             mcuboot_config
+            $<$<AND:$<BOOL:${CONFIG_TFM_BOOT_STORE_MEASUREMENTS}>,$<NOT:$<BOOL:${CONFIG_TFM_BOOT_STORE_ENCODED_MEASUREMENTS}>>>:tfm_boot_status>
     )
 
     target_compile_definitions(platform_bl2
@@ -218,6 +219,7 @@
             $<$<BOOL:${TFM_DUMMY_PROVISIONING}>:TFM_DUMMY_PROVISIONING>
             $<$<BOOL:${PLATFORM_DEFAULT_NV_COUNTERS}>:PLATFORM_DEFAULT_NV_COUNTERS>
             $<$<BOOL:${PLATFORM_DEFAULT_OTP_WRITEABLE}>:OTP_WRITEABLE>
+            $<$<AND:$<BOOL:${CONFIG_TFM_BOOT_STORE_MEASUREMENTS}>,$<NOT:$<BOOL:${CONFIG_TFM_BOOT_STORE_ENCODED_MEASUREMENTS}>>>:TFM_MEASURED_BOOT_API>
     )
 
     target_compile_options(platform_bl2
@@ -255,6 +257,7 @@
             $<$<BOOL:${PLATFORM_DEFAULT_OTP_WRITEABLE}>:OTP_WRITEABLE>
             $<$<BOOL:${TFM_BL1_MEMORY_MAPPED_FLASH}>:TFM_BL1_MEMORY_MAPPED_FLASH>
             $<$<BOOL:${TFM_BL1_2_IN_OTP}>:TFM_BL1_2_IN_OTP>
+            $<$<AND:$<BOOL:${CONFIG_TFM_BOOT_STORE_MEASUREMENTS}>,$<NOT:$<BOOL:${CONFIG_TFM_BOOT_STORE_ENCODED_MEASUREMENTS}>>>:TFM_MEASURED_BOOT_API>
     )
 
     target_sources(platform_bl1_1
@@ -305,6 +308,7 @@
             $<$<BOOL:${PLATFORM_DEFAULT_OTP_WRITEABLE}>:OTP_WRITEABLE>
             $<$<BOOL:${TFM_BL1_MEMORY_MAPPED_FLASH}>:TFM_BL1_MEMORY_MAPPED_FLASH>
             $<$<BOOL:${TFM_BL1_2_IN_OTP}>:TFM_BL1_2_IN_OTP>
+            $<$<AND:$<BOOL:${CONFIG_TFM_BOOT_STORE_MEASUREMENTS}>,$<NOT:$<BOOL:${CONFIG_TFM_BOOT_STORE_ENCODED_MEASUREMENTS}>>>:TFM_MEASURED_BOOT_API>
     )
 
     target_sources(platform_bl1_2
diff --git a/platform/ext/common/boot_hal_bl1_1.c b/platform/ext/common/boot_hal_bl1_1.c
index 4bc40ef..e5fd405 100644
--- a/platform/ext/common/boot_hal_bl1_1.c
+++ b/platform/ext/common/boot_hal_bl1_1.c
@@ -17,11 +17,11 @@
 #include "tfm_plat_otp.h"
 #include "fih.h"
 
-#ifdef MEASURED_BOOT_API
+#ifdef TFM_MEASURED_BOOT_API
 #include "region_defs.h"
 #include "tfm_boot_status.h"
 #include "boot_measurement.h"
-#endif /* MEASURED_BOOT_API */
+#endif /* TFM_MEASURED_BOOT_API */
 
 #ifndef TFM_BL1_MEMORY_MAPPED_FLASH
 /* Flash device name must be specified by target */
@@ -169,7 +169,7 @@
     return 0;
 }
 
-#ifdef MEASURED_BOOT_API
+#ifdef TFM_MEASURED_BOOT_API
 static int boot_add_data_to_shared_area(uint8_t        major_type,
                                         uint16_t       minor_type,
                                         size_t         size,
@@ -270,4 +270,4 @@
 
     return rc;
 }
-#endif /* MEASURED_BOOT_API */
+#endif /* TFM_MEASURED_BOOT_API */
diff --git a/platform/ext/common/boot_hal_bl1_2.c b/platform/ext/common/boot_hal_bl1_2.c
index f36814e..1fe3510 100644
--- a/platform/ext/common/boot_hal_bl1_2.c
+++ b/platform/ext/common/boot_hal_bl1_2.c
@@ -16,11 +16,11 @@
 #include "uart_stdout.h"
 #include "fih.h"
 
-#ifdef MEASURED_BOOT_API
+#ifdef TFM_MEASURED_BOOT_API
 #include "region_defs.h"
 #include "tfm_boot_status.h"
 #include "boot_measurement.h"
-#endif /* MEASURED_BOOT_API */
+#endif /* TFM_MEASURED_BOOT_API */
 
 #ifndef TFM_BL1_MEMORY_MAPPED_FLASH
 /* Flash device name must be specified by target */
@@ -200,7 +200,7 @@
     return 0;
 }
 
-#ifdef MEASURED_BOOT_API
+#ifdef TFM_MEASURED_BOOT_API
 static int boot_add_data_to_shared_area(uint8_t        major_type,
                                         uint16_t       minor_type,
                                         size_t         size,
@@ -301,4 +301,4 @@
 
     return rc;
 }
-#endif /* MEASURED_BOOT_API */
+#endif /* TFM_MEASURED_BOOT_API */
diff --git a/platform/ext/common/boot_hal_bl2.c b/platform/ext/common/boot_hal_bl2.c
index ceadb74..d0f111c 100644
--- a/platform/ext/common/boot_hal_bl2.c
+++ b/platform/ext/common/boot_hal_bl2.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2019-2022, Arm Limited. All rights reserved.
+ * Copyright (c) 2019-2023, Arm Limited. All rights reserved.
  *
  * SPDX-License-Identifier: BSD-3-Clause
  *
@@ -17,11 +17,11 @@
 #include "fih.h"
 #endif /* CRYPTO_HW_ACCELERATOR */
 
-#ifdef MEASURED_BOOT_API
+#ifdef TFM_MEASURED_BOOT_API
 #include "region_defs.h"
 #include "tfm_boot_status.h"
 #include "boot_measurement.h"
-#endif /* MEASURED_BOOT_API */
+#endif /* TFM_MEASURED_BOOT_API */
 
 /* Flash device names must be specified by target */
 #ifdef FLASH_DEV_NAME
@@ -245,7 +245,7 @@
     return 0;
 }
 
-#ifdef MEASURED_BOOT_API
+#ifdef TFM_MEASURED_BOOT_API
 static int boot_add_data_to_shared_area(uint8_t        major_type,
                                         uint16_t       minor_type,
                                         size_t         size,
@@ -346,4 +346,4 @@
 
     return rc;
 }
-#endif /* MEASURED_BOOT_API */
+#endif /* TFM_MEASURED_BOOT_API */
diff --git a/platform/ext/target/arm/corstone1000/CMakeLists.txt b/platform/ext/target/arm/corstone1000/CMakeLists.txt
index 39ee783..e6cf15b 100644
--- a/platform/ext/target/arm/corstone1000/CMakeLists.txt
+++ b/platform/ext/target/arm/corstone1000/CMakeLists.txt
@@ -174,7 +174,6 @@
 target_compile_definitions(platform_bl1_1
     PUBLIC
         $<$<BOOL:${PLATFORM_IS_FVP}>:PLATFORM_IS_FVP>
-        $<$<AND:$<BOOL:${CONFIG_TFM_BOOT_STORE_MEASUREMENTS}>,$<BOOL:${TFM_PARTITION_MEASURED_BOOT}>>:MEASURED_BOOT_API>
         $<$<BOOL:${PLATFORM_DEFAULT_OTP_WRITEABLE}>:OTP_WRITEABLE>
         $<$<BOOL:${CRYPTO_HW_ACCELERATOR}>:CRYPTO_HW_ACCELERATOR>
         $<$<BOOL:${CRYPTO_HW_ACCELERATOR_OTP_PROVISIONING}>:CRYPTO_HW_ACCELERATOR_OTP_PROVISIONING>
@@ -214,7 +213,6 @@
 target_compile_definitions(platform_bl1_2
     PUBLIC
         $<$<BOOL:${PLATFORM_IS_FVP}>:PLATFORM_IS_FVP>
-        $<$<AND:$<BOOL:${CONFIG_TFM_BOOT_STORE_MEASUREMENTS}>,$<BOOL:${TFM_PARTITION_MEASURED_BOOT}>>:MEASURED_BOOT_API>
         $<$<BOOL:${PLATFORM_DEFAULT_OTP_WRITEABLE}>:OTP_WRITEABLE>
         $<$<BOOL:${CRYPTO_HW_ACCELERATOR}>:CRYPTO_HW_ACCELERATOR>
         $<$<BOOL:${CRYPTO_HW_ACCELERATOR_OTP_PROVISIONING}>:CRYPTO_HW_ACCELERATOR_OTP_PROVISIONING>
@@ -395,4 +393,3 @@
                     --bundle_output_file bl1_provisioning_bundle.bin
     COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/bl1_provisioning_bundle.bin $<TARGET_FILE_DIR:bl1_1>
 )
-
diff --git a/platform/ext/target/arm/corstone1000/bl1/CMakeLists.txt b/platform/ext/target/arm/corstone1000/bl1/CMakeLists.txt
index 0493e7c..09238f1 100644
--- a/platform/ext/target/arm/corstone1000/bl1/CMakeLists.txt
+++ b/platform/ext/target/arm/corstone1000/bl1/CMakeLists.txt
@@ -311,7 +311,7 @@
         ../partition
 )
 
-if (CONFIG_TFM_BOOT_STORE_MEASUREMENTS)
+if (CONFIG_TFM_BOOT_STORE_MEASUREMENTS AND CONFIG_TFM_BOOT_STORE_ENCODED_MEASUREMENTS)
     set(MCUBOOT_MEASURED_BOOT ON)
 endif()
 
diff --git a/platform/ext/target/arm/corstone1000/config.cmake b/platform/ext/target/arm/corstone1000/config.cmake
index 5b1e969..d09bb3f 100644
--- a/platform/ext/target/arm/corstone1000/config.cmake
+++ b/platform/ext/target/arm/corstone1000/config.cmake
@@ -63,7 +63,6 @@
 set(TFM_PARTITION_CRYPTO                ON          CACHE BOOL      "Enable Crypto partition")
 set(TFM_PARTITION_INITIAL_ATTESTATION   ON          CACHE BOOL      "Enable Initial Attestation partition")
 set(TFM_PARTITION_INTERNAL_TRUSTED_STORAGE ON       CACHE BOOL      "Enable Internal Trusted Storage partition")
-set(TFM_PARTITION_MEASURED_BOOT         ON          CACHE BOOL      "Enable Measured boot partition")
 
 
 if (${CMAKE_BUILD_TYPE} STREQUAL Debug OR ${CMAKE_BUILD_TYPE} STREQUAL RelWithDebInfo)
diff --git a/platform/ext/target/arm/rss/common/CMakeLists.txt b/platform/ext/target/arm/rss/common/CMakeLists.txt
index fa69042..5b1d858 100644
--- a/platform/ext/target/arm/rss/common/CMakeLists.txt
+++ b/platform/ext/target/arm/rss/common/CMakeLists.txt
@@ -303,16 +303,6 @@
         $<$<BOOL:${PLATFORM_HAS_BOOT_DMA}>:${COMPILER_CMSE_FLAG}>
 )
 
-target_link_libraries(platform_bl2
-    PRIVATE
-        $<$<AND:$<BOOL:${CONFIG_TFM_BOOT_STORE_MEASUREMENTS}>,$<BOOL:${TFM_PARTITION_MEASURED_BOOT}>>:tfm_boot_status>
-)
-
-target_compile_definitions(platform_bl2
-    PUBLIC
-        $<$<AND:$<BOOL:${CONFIG_TFM_BOOT_STORE_MEASUREMENTS}>,$<BOOL:${TFM_PARTITION_MEASURED_BOOT}>>:MEASURED_BOOT_API>
-)
-
 #========================= Platform bl1_1 =======================================#
 
 target_sources(platform_bl1_1
@@ -353,7 +343,6 @@
 
 target_compile_definitions(platform_bl1_1_interface
     INTERFACE
-        $<$<AND:$<BOOL:${CONFIG_TFM_BOOT_STORE_MEASUREMENTS}>,$<BOOL:${TFM_PARTITION_MEASURED_BOOT}>>:MEASURED_BOOT_API>
         RSS_AMOUNT=${RSS_AMOUNT}
         KMU_CONFIG_EXTERNAL_SECURE_WORD_COPY
         $<$<BOOL:${RSS_ENCRYPTED_OTP_KEYS}>:RSS_ENCRYPTED_OTP_KEYS>
@@ -393,7 +382,6 @@
 
 target_compile_definitions(platform_bl1_2
     PUBLIC
-        $<$<AND:$<BOOL:${CONFIG_TFM_BOOT_STORE_MEASUREMENTS}>,$<BOOL:${TFM_PARTITION_MEASURED_BOOT}>>:MEASURED_BOOT_API>
         $<$<BOOL:${RSS_AMOUNT}>:RSS_AMOUNT=${RSS_AMOUNT}>
 )