Build: Exchange RAM FS patches with build config

Remove patches enabling ITS_RAM_FS and PS_RAM_FS for ci testing.
Enable these options through build config.

Signed-off-by: Gabor Toth <gabor.toth@arm.com>
Change-Id: I1bbbdfc8febd52aab35c66a18dc8a03cbf4d36d2
(cherry picked from commit 150fab699ca9a2e681f1decad468ae38dfd769b2)
diff --git a/build_helper/platform_settings/0001-Musca-B1-Enable-emulated-RAM-FS-for-ITS-PS.patch b/build_helper/platform_settings/0001-Musca-B1-Enable-emulated-RAM-FS-for-ITS-PS.patch
deleted file mode 100644
index 07cbd50..0000000
--- a/build_helper/platform_settings/0001-Musca-B1-Enable-emulated-RAM-FS-for-ITS-PS.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-From 51a134bfa1a083556dd29bf2325d53363764f8e2 Mon Sep 17 00:00:00 2001
-From: Xinyu Zhang <xinyu.zhang@arm.com>
-Date: Wed, 14 Jun 2023 18:45:20 +0800
-Subject: [PATCH 1/2] Musca B1: Enable emulated RAM FS for ITS & PS
-
-Signed-off-by: Xinyu Zhang <xinyu.zhang@arm.com>
-Change-Id: I213e338d4116f296a3b49c0d15f12334022b2cdd
----
- platform/ext/target/arm/musca_b1/config_tfm_target.h | 4 ++++
- 1 file changed, 4 insertions(+)
-
-diff --git a/platform/ext/target/arm/musca_b1/config_tfm_target.h b/platform/ext/target/arm/musca_b1/config_tfm_target.h
-index 599db967d..2681f068d 100644
---- a/platform/ext/target/arm/musca_b1/config_tfm_target.h
-+++ b/platform/ext/target/arm/musca_b1/config_tfm_target.h
-@@ -11,4 +11,8 @@
- /* Use stored NV seed to provide entropy */
- #define CRYPTO_NV_SEED                         0
- 
-+#define ITS_RAM_FS                             1
-+
-+#define PS_RAM_FS                              1
-+
- #endif /* __CONFIG_TFM_TARGET_H__ */
--- 
-2.25.1
-
diff --git a/build_helper/platform_settings/0002-STM32-Enable-emulated-RAM-FS-for-ITS-PS.patch b/build_helper/platform_settings/0002-STM32-Enable-emulated-RAM-FS-for-ITS-PS.patch
deleted file mode 100644
index b8e0ccf..0000000
--- a/build_helper/platform_settings/0002-STM32-Enable-emulated-RAM-FS-for-ITS-PS.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-From 169f7d7a8f7ec5c70317bffda6157c582401dc3b Mon Sep 17 00:00:00 2001
-From: Xinyu Zhang <xinyu.zhang@arm.com>
-Date: Wed, 14 Jun 2023 18:46:18 +0800
-Subject: [PATCH 2/2] STM32: Enable emulated RAM FS for ITS & PS
-
-Signed-off-by: Xinyu Zhang <xinyu.zhang@arm.com>
-Change-Id: If39b9e07f559cc1adcd602229304e1d9f4a8bdf7
----
- platform/ext/target/stm/stm32l562e_dk/config_tfm_target.h | 4 ++++
- 1 file changed, 4 insertions(+)
-
-diff --git a/platform/ext/target/stm/stm32l562e_dk/config_tfm_target.h b/platform/ext/target/stm/stm32l562e_dk/config_tfm_target.h
-index 599db967d..2681f068d 100644
---- a/platform/ext/target/stm/stm32l562e_dk/config_tfm_target.h
-+++ b/platform/ext/target/stm/stm32l562e_dk/config_tfm_target.h
-@@ -11,4 +11,8 @@
- /* Use stored NV seed to provide entropy */
- #define CRYPTO_NV_SEED                         0
- 
-+#define ITS_RAM_FS                             1
-+
-+#define PS_RAM_FS                              1
-+
- #endif /* __CONFIG_TFM_TARGET_H__ */
--- 
-2.25.1
-
diff --git a/run-build.sh b/run-build.sh
index a8170cc..c0a8b99 100755
--- a/run-build.sh
+++ b/run-build.sh
@@ -1,6 +1,6 @@
 #!/bin/bash
 #-------------------------------------------------------------------------------
-# Copyright (c) 2020-2023, Arm Limited and Contributors. All rights reserved.
+# Copyright (c) 2020-2024, Arm Limited and Contributors. All rights reserved.
 #
 # SPDX-License-Identifier: BSD-3-Clause
 #
@@ -100,10 +100,6 @@
     cd -
 fi
 
-cd trusted-firmware-m
-git apply ../tf-m-ci-scripts/build_helper/platform_settings/*.patch
-cd -
-
 rm -rf ci_build
 mkdir ci_build
 cd ci_build
diff --git a/tfm_ci_pylib/tfm_build_manager.py b/tfm_ci_pylib/tfm_build_manager.py
index 1c59d95..3ec50a3 100644
--- a/tfm_ci_pylib/tfm_build_manager.py
+++ b/tfm_ci_pylib/tfm_build_manager.py
@@ -403,6 +403,11 @@
         if i.isolation_level == "3":
             overwrite_params["extra_params"] += " -DCMAKE_VERBOSE_MAKEFILE=ON"
 
+        if i.tfm_platform == "arm/musca_b1":
+            overwrite_params["extra_params"] += " -DPLATFORM_RAM_FS=ON"
+        if i.tfm_platform == "stm/stm32l562e_dk":
+            overwrite_params["extra_params"] += " -DPLATFORM_RAM_FS=ON"
+
         if i.test_psa_api == "IPC":
             overwrite_params["test_psa_api"] += " -DINCLUDE_PANIC_TESTS=1"
         if i.test_psa_api == "CRYPTO" and "musca" in i.tfm_platform: