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/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