Build: Disable RAM FS by default
Changes the common configuration to disable the ITS and PS RAM FS by
default, even when running the regression tests. Testing with persistent
storage allows for greater coverage of scenarios such as initialisation
with existing storage and correct erasing of flash before overwriting.
The setting can still be overridden in the platform CMake config, or by
providing it on the command line if flash wear is a concern.
Change-Id: If950e13d5f89ff164b47ed8d6602cdef5d4d6b5e
Signed-off-by: Jamie Fox <jamie.fox@arm.com>
diff --git a/CommonConfig.cmake b/CommonConfig.cmake
index 62a6dc1..e1d8f1a 100644
--- a/CommonConfig.cmake
+++ b/CommonConfig.cmake
@@ -456,11 +456,7 @@
endif()
if (NOT DEFINED PS_RAM_FS)
- if (REGRESSION)
- set (PS_RAM_FS ON)
- else()
- set (PS_RAM_FS OFF)
- endif()
+ set (PS_RAM_FS OFF)
endif()
if (NOT DEFINED PS_TEST_NV_COUNTERS)
@@ -488,11 +484,7 @@
endif()
if (NOT DEFINED ITS_RAM_FS)
- if (REGRESSION)
- set (ITS_RAM_FS ON)
- else()
- set (ITS_RAM_FS OFF)
- endif()
+ set (ITS_RAM_FS OFF)
endif()
if (NOT DEFINED MBEDCRYPTO_DEBUG)
diff --git a/configs/ConfigRegressionProfileS.cmake b/configs/ConfigRegressionProfileS.cmake
index 824d886..af90b92 100644
--- a/configs/ConfigRegressionProfileS.cmake
+++ b/configs/ConfigRegressionProfileS.cmake
@@ -45,8 +45,6 @@
# Enable Internal Trusted Storage service
set(TFM_PARTITION_INTERNAL_TRUSTED_STORAGE ON)
-# Use the real Flash for Internal Trusted Storage
-set(ITS_RAM_FS OFF)
# Decrease the transient internal buffer size to 32 bytes
set(ITS_BUF_SIZE 32)
diff --git a/docs/design_documents/tfm_profile_small.rst b/docs/design_documents/tfm_profile_small.rst
index 67f6779..051dd3d 100644
--- a/docs/design_documents/tfm_profile_small.rst
+++ b/docs/design_documents/tfm_profile_small.rst
@@ -410,9 +410,6 @@
* - ``TFM_PARTITION_INTERNAL_TRUSTED_STORAGE``
- ``ON``
- Enable ITS SP
- * - ``ITS_RAM_FS``
- - ``OFF``
- - Stop using RAM to simulate Flash
* - ``ITS_BUF_SIZE``
- ``32``
- ITS internal transient buffer size
diff --git a/docs/reference/services/tfm_its_integration_guide.rst b/docs/reference/services/tfm_its_integration_guide.rst
index f6b2dec..230117e 100644
--- a/docs/reference/services/tfm_its_integration_guide.rst
+++ b/docs/reference/services/tfm_its_integration_guide.rst
@@ -277,18 +277,18 @@
enable/disable the validation mechanism to check the metadata store in flash
every time the flash data is read from flash. This validation is required
if the flash is not hardware protected against data corruption.
-- ``ITS_RAM_FS``- this flag allows to enable/disable the use of RAM
- instead of the flash to store the FS in internal trusted storage service. This
- flag is set by default in the regression tests, if it is not defined by the
- platform. The ITS regression tests reduce the life of the flash memory
- as they write/erase multiple times in the memory.
+- ``ITS_RAM_FS``- setting this flag to ``ON`` enables the use of RAM instead of
+ the persistent storage device to store the FS in the Internal Trusted Storage
+ service. This flag is ``OFF`` by default. The ITS regression tests write/erase
+ storage multiple time, so enabling this flag can increase the life of flash
+ memory when testing.
.. Note::
- If this flag is manually disabled when running the regression tests,
- then the storage flash area should also be erased before running the tests
- to ensure they run successfully. The type of storage flash area is platform
- specific (QSPI, eFlash, etc.) and it is described in corresponding
- flash_layout.h
+ If this flag is disabled when running the regression tests, then it is
+ recommended that the persistent storage area is erased before running the
+ tests to ensure that all tests can run to completion. The type of persistent
+ storage area is platform specific (eFlash, MRAM, etc.) and it is described
+ in corresponding flash_layout.h
--------------
diff --git a/docs/reference/services/tfm_ps_integration_guide.rst b/docs/reference/services/tfm_ps_integration_guide.rst
index 4da23a5..342011a 100644
--- a/docs/reference/services/tfm_ps_integration_guide.rst
+++ b/docs/reference/services/tfm_ps_integration_guide.rst
@@ -327,18 +327,18 @@
- ``PS_ROLLBACK_PROTECTION``- this flag allows to enable/disable
rollback protection in protected storage service. This flag takes effect only
if the target has non-volatile counters and ``PS_ENCRYPTION`` flag is on.
-- ``PS_RAM_FS``- this flag allows to enable/disable the use of RAM
- instead of the flash to store the FS in protected storage service. This flag
- is set by default in the regression tests, if it is not defined by the
- platform. The PS regression tests reduce the life of the flash memory
- as they write/erase multiple times in the memory.
+- ``PS_RAM_FS``- setting this flag to ``ON`` enables the use of RAM instead of
+ the persistent storage device to store the FS in the Protected Storage
+ service. This flag is ``OFF`` by default. The PS regression tests write/erase
+ storage multiple time, so enabling this flag can increase the life of flash
+ memory when testing.
.. Note::
- If this flag is manually disabled when running the regression tests,
- then the storage flash area should also be erased before running the tests
- to ensure they run successfully. The type of storage flash area is platform
- specific (QSPI, eFlash, etc.) and it is described in corresponding
- flash_layout.h
+ If this flag is disabled when running the regression tests, then it is
+ recommended that the persistent storage area is erased before running the
+ tests to ensure that all tests can run to completion. The type of persistent
+ storage area is platform specific (eFlash, MRAM, etc.) and it is described
+ in corresponding flash_layout.h
- ``PS_TEST_NV_COUNTERS``- this flag enables the virtual
implementation of the PS NV counters interface in
diff --git a/platform/ext/Mps2AN519.cmake b/platform/ext/Mps2AN519.cmake
index ef2e5ca..1e61d3a 100644
--- a/platform/ext/Mps2AN519.cmake
+++ b/platform/ext/Mps2AN519.cmake
@@ -205,8 +205,6 @@
# to be sure the PS service knows that when it starts the PS area does not contain any
# valid PS flash layout and it needs to create one. The same for ITS.
set(PS_CREATE_FLASH_LAYOUT ON)
- set(PS_RAM_FS OFF)
set(ITS_CREATE_FLASH_LAYOUT ON)
- set(ITS_RAM_FS OFF)
embedded_include_directories(PATH "${PLATFORM_DIR}/target/mps2/an519/cmsis_drivers" ABSOLUTE)
endif()
diff --git a/platform/ext/Mps2AN521.cmake b/platform/ext/Mps2AN521.cmake
index 9afdf0e..fa72061 100644
--- a/platform/ext/Mps2AN521.cmake
+++ b/platform/ext/Mps2AN521.cmake
@@ -206,8 +206,6 @@
# to be sure the PS service knows that when it starts the PS area does not contain any
# valid PS flash layout and it needs to create one. The same for ITS.
set(PS_CREATE_FLASH_LAYOUT ON)
- set(PS_RAM_FS OFF)
set(ITS_CREATE_FLASH_LAYOUT ON)
- set(ITS_RAM_FS OFF)
embedded_include_directories(PATH "${PLATFORM_DIR}/target/mps2/an521/cmsis_drivers" ABSOLUTE)
endif()
diff --git a/platform/ext/Mps2AN539.cmake b/platform/ext/Mps2AN539.cmake
index b0b64dc..eb4cb4f 100644
--- a/platform/ext/Mps2AN539.cmake
+++ b/platform/ext/Mps2AN539.cmake
@@ -209,9 +209,7 @@
# to be sure the PS service knows that when it starts the PS area does not contain any
# valid PS flash layout and it needs to create one. The same for ITS.
set(PS_CREATE_FLASH_LAYOUT ON)
- set(PS_RAM_FS OFF)
set(ITS_CREATE_FLASH_LAYOUT ON)
- set(ITS_RAM_FS OFF)
embedded_include_directories(PATH "${AN539_DIR}/cmsis_drivers" ABSOLUTE)
embedded_include_directories(PATH "${PLATFORM_DIR}/driver" ABSOLUTE)
endif()
diff --git a/platform/ext/Mps3AN524.cmake b/platform/ext/Mps3AN524.cmake
index 1a4cf17..1e5fad9 100644
--- a/platform/ext/Mps3AN524.cmake
+++ b/platform/ext/Mps3AN524.cmake
@@ -211,9 +211,7 @@
# to be sure the PS service knows that when it starts the PS area does not contain any
# valid PS flash layout and it needs to create one. The same for ITS.
set(PS_CREATE_FLASH_LAYOUT ON)
- set(PS_RAM_FS OFF)
set(ITS_CREATE_FLASH_LAYOUT ON)
- set(ITS_RAM_FS OFF)
embedded_include_directories(PATH "${AN524_DIR}/cmsis_drivers" ABSOLUTE)
embedded_include_directories(PATH "${PLATFORM_DIR}/driver" ABSOLUTE)
endif()
diff --git a/platform/ext/SSE-200_AWS.cmake b/platform/ext/SSE-200_AWS.cmake
index db51353..0c55730 100644
--- a/platform/ext/SSE-200_AWS.cmake
+++ b/platform/ext/SSE-200_AWS.cmake
@@ -208,8 +208,6 @@
# to be sure the PS service knows that when it starts the PS area does not contain any
# valid PS flash layout and it needs to create one. The same for ITS.
set(PS_CREATE_FLASH_LAYOUT ON)
- set(PS_RAM_FS OFF)
set(ITS_CREATE_FLASH_LAYOUT ON)
- set(ITS_RAM_FS OFF)
embedded_include_directories(PATH "${PLATFORM_DIR}/target/sse-200_aws/cmsis_drivers" ABSOLUTE)
endif()
diff --git a/platform/ext/fvp_sse300_mps2.cmake b/platform/ext/fvp_sse300_mps2.cmake
index 3c730c4..907f946 100644
--- a/platform/ext/fvp_sse300_mps2.cmake
+++ b/platform/ext/fvp_sse300_mps2.cmake
@@ -188,9 +188,7 @@
# to be sure the PS service knows that when it starts the PS area does not contain any
# valid PS flash layout and it needs to create one. The same for ITS.
set(PS_CREATE_FLASH_LAYOUT ON)
- set(PS_RAM_FS OFF)
set(ITS_CREATE_FLASH_LAYOUT ON)
- set(ITS_RAM_FS OFF)
embedded_include_directories(PATH "${FVP_SSE300_DIR}/cmsis_drivers" ABSOLUTE)
embedded_include_directories(PATH "${PLATFORM_DIR}/driver" ABSOLUTE)
endif()