Build: Move Storage asset defs to build variables
Removes the MAX_ASSET_SIZE and NUM_ASSETS storage definitions from
flash_layout.h and adds replacement build variables for them. This
allows for greater customisation at build time and reduces duplication
between platforms.
Change-Id: If5d20ee0cb8dede28513c10572da594c02b4ee89
Signed-off-by: Jamie Fox <jamie.fox@arm.com>
diff --git a/config/config_default.cmake b/config/config_default.cmake
index 340eff5..5c2f189 100644
--- a/config/config_default.cmake
+++ b/config/config_default.cmake
@@ -71,17 +71,21 @@
############################ Partitions ########################################
set(TFM_PARTITION_PROTECTED_STORAGE ON CACHE BOOL "Enable Protected Storage partition")
-set(PS_CREATE_FLASH_LAYOUT ON CACHE BOOL "Create flash fs if it doesn't exist for Protected Storage partition")
+set(PS_CREATE_FLASH_LAYOUT ON CACHE BOOL "Create flash FS if it doesn't exist for Protected Storage partition")
set(PS_ENCRYPTION ON CACHE BOOL "Enable encryption for Protected Storage partition")
set(PS_RAM_FS OFF CACHE BOOL "Enable emulated RAM FS for platforms that don't have flash for Protected Storage partition")
set(PS_ROLLBACK_PROTECTION ON CACHE BOOL "Enable rollback protection for Protected Storage partition")
set(PS_VALIDATE_METADATA_FROM_FLASH ON CACHE BOOL "Validate filesystem metadata every time it is read from flash")
-set(PS_CRYPTO_AEAD_ALG PSA_ALG_GCM CACHE STRING "The AEAD algorithm to use for authenticated encryption in protected storage")
+set(PS_MAX_ASSET_SIZE "2048" CACHE STRING "The maximum asset size to be stored in the Protected Storage area")
+set(PS_NUM_ASSETS "10" CACHE STRING "The maximum number of assets to be stored in the Protected Storage area")
+set(PS_CRYPTO_AEAD_ALG PSA_ALG_GCM CACHE STRING "The AEAD algorithm to use for authenticated encryption in Protected Storage")
set(TFM_PARTITION_INTERNAL_TRUSTED_STORAGE ON CACHE BOOL "Enable Internal Trusted Storage partition")
-set(ITS_CREATE_FLASH_LAYOUT ON CACHE BOOL "Create flash fs if it doesn't exist for Interal Trusted Storage partition")
-set(ITS_RAM_FS OFF CACHE BOOL "Enable emulated RAM FS for platforms that don't have flash for Interal Trusted Storage partition")
+set(ITS_CREATE_FLASH_LAYOUT ON CACHE BOOL "Create flash FS if it doesn't exist for Internal Trusted Storage partition")
+set(ITS_RAM_FS OFF CACHE BOOL "Enable emulated RAM FS for platforms that don't have flash for Internal Trusted Storage partition")
set(ITS_VALIDATE_METADATA_FROM_FLASH ON CACHE BOOL "Validate filesystem metadata every time it is read from flash")
+set(ITS_MAX_ASSET_SIZE "512" CACHE STRING "The maximum asset size to be stored in the Internal Trusted Storage area")
+set(ITS_NUM_ASSETS "10" CACHE STRING "The maximum number of assets to be stored in the Internal Trusted Storage area")
set(ITS_BUF_SIZE "" CACHE STRING "Size of the ITS internal data transfer buffer (defaults to ITS_MAX_ASSET_SIZE if not set)")
set(TFM_PARTITION_CRYPTO ON CACHE BOOL "Enable Crypto partition")