build_helper: Update tf-m-extras examples

Signed-off-by: Gergely Korcsák <gergely.korcsak@arm.com>
Change-Id: Ic5605417b35b09ed762d192c6e0982c0c74d3de2
diff --git a/build_helper/build_helper_config_maps.py b/build_helper/build_helper_config_maps.py
index fd586cf..74c44b8 100644
--- a/build_helper/build_helper_config_maps.py
+++ b/build_helper/build_helper_config_maps.py
@@ -108,20 +108,29 @@
     "PROF"         : ("-DTFM_EXTRA_CONFIG_PATH=%(codebase_root_dir)s/../tf-m-tools/profiling/profiling_cases/prof_psa_client_api/partitions/config_spe.cmake "),
 
     # tf-m-extras example support
-    "EXAMPLE_VAD"             : ("-DNS_EVALUATION_APP_PATH=%(codebase_root_dir)s/../tf-m-extras/examples/vad_an552/ns_side "
-                                "-DTFM_EXTRA_PARTITION_PATHS=%(codebase_root_dir)s/../tf-m-extras/partitions/vad_an552_sp/ "
-                                "-DTFM_EXTRA_MANIFEST_LIST_FILES=%(codebase_root_dir)s/../tf-m-extras/partitions/vad_an552_sp/extra_manifest_list.yaml "
-                                "-DPROJECT_CONFIG_HEADER_FILE=%(codebase_root_dir)s/../tf-m-extras/examples/vad_an552/ns_side/project_config.h "
-                                "-DTFM_PARTITION_FIRMWARE_UPDATE=ON -DMCUBOOT_DATA_SHARING=ON "
-                                "-DMCUBOOT_UPGRADE_STRATEGY=SWAP_USING_SCRATCH "
-                                "-DMCUBOOT_IMAGE_NUMBER=1 -DMCUBOOT_SIGNATURE_KEY_LEN=2048 "
-                                "-DCONFIG_TFM_ENABLE_MVE=ON -DCONFIG_TFM_SPM_BACKEND=IPC "
-                                "-DPLATFORM_HAS_FIRMWARE_UPDATE_SUPPORT=ON -DTFM_PARTITION_PLATFORM=ON "
-                                "-DTFM_PARTITION_CRYPTO=ON -DTFM_PARTITION_INTERNAL_TRUSTED_STORAGE=ON "
-                                "-DTFM_PARTITION_PROTECTED_STORAGE=ON  -DMCUBOOT_CONFIRM_IMAGE=ON "),
-    "EXAMPLE_DMA350_TRIGGER"  : ("-DNS_EVALUATION_APP_PATH=%(codebase_root_dir)s/../tf-m-extras/examples/corstone310_fvp_dma/triggering_example "),
-    "EXAMPLE_DMA350_CLCD"     : ("-DDEFAULT_NS_SCATTER=OFF -DPLATFORM_SVC_HANDLERS=ON "
-                                "-DNS_EVALUATION_APP_PATH=%(codebase_root_dir)s/../tf-m-extras/examples/corstone310_fvp_dma/clcd_example "),
-    "EXAMPLE_DMA350_S"        : "-DEXTRA_S_TEST_SUITE_PATH=%(codebase_root_dir)s/../tf-m-extras/examples/corstone310_fvp_dma/dma350_s",
-    "EXAMPLE_DMA350_NS"       : "-DEXTRA_NS_TEST_SUITE_PATH=%(codebase_root_dir)s/../tf-m-extras/examples/corstone310_fvp_dma/dma350_ns"
+    "EXTRAS_EXAMPLE_VAD"    : ("-DNS_EVALUATION_APP_PATH=%(codebase_root_dir)s/../tf-m-extras/examples/vad_an552/ns_side "
+                               "-DTFM_EXTRA_PARTITION_PATHS=%(codebase_root_dir)s/../tf-m-extras/partitions/vad_an552_sp/ "
+                               "-DTFM_EXTRA_MANIFEST_LIST_FILES=%(codebase_root_dir)s/../tf-m-extras/partitions/vad_an552_sp/extra_manifest_list.yaml "
+                               "-DPROJECT_CONFIG_HEADER_FILE=%(codebase_root_dir)s/../tf-m-extras/examples/vad_an552/ns_side/project_config.h "
+                               "-DTFM_PARTITION_FIRMWARE_UPDATE=ON -DMCUBOOT_DATA_SHARING=ON "
+                               "-DMCUBOOT_UPGRADE_STRATEGY=SWAP_USING_SCRATCH "
+                               "-DMCUBOOT_IMAGE_NUMBER=1 -DMCUBOOT_SIGNATURE_KEY_LEN=2048 "
+                               "-DCONFIG_TFM_ENABLE_MVE=ON -DCONFIG_TFM_SPM_BACKEND=IPC "
+                               "-DPLATFORM_HAS_FIRMWARE_UPDATE_SUPPORT=ON -DTFM_PARTITION_PLATFORM=ON "
+                               "-DTFM_PARTITION_CRYPTO=ON -DTFM_PARTITION_INTERNAL_TRUSTED_STORAGE=ON "
+                               "-DTFM_PARTITION_PROTECTED_STORAGE=ON  -DMCUBOOT_CONFIRM_IMAGE=ON "),
+
+    "EXTRAS_EXAMPLE_DMA350_TRIGGER" : "",
+    "EXTRAS_EXAMPLE_DMA350_CLCD"    : "-DDEFAULT_NS_SCATTER=OFF -DPLATFORM_SVC_HANDLERS=ON ",
+
+    "EXTRAS_EXAMPLE_DMA350_S"       : "-DEXTRA_S_TEST_SUITE_PATH=%(codebase_root_dir)s/../tf-m-extras/examples/corstone310_fvp_dma/dma350_s",
+    "EXTRAS_EXAMPLE_DMA350_NS"      : "-DEXTRA_NS_TEST_SUITE_PATH=%(codebase_root_dir)s/../tf-m-extras/examples/corstone310_fvp_dma/dma350_ns"
+}
+
+mapTfmExtrasExamplePaths = {
+    "EXTRAS_EXAMPLE_VAD"            : "examples/vad_an552/ns_side",
+    "EXTRAS_EXAMPLE_DMA350_TRIGGER" : "examples/corstone310_fvp_dma/triggering_example",
+    "EXTRAS_EXAMPLE_DMA350_CLCD"    : "examples/corstone310_fvp_dma/clcd_example",
+    "EXTRAS_EXAMPLE_DMA350_S"       : "examples/corstone310_fvp_dma/dma350_s",
+    "EXTRAS_EXAMPLE_DMA350_NS"      : "examples/corstone310_fvp_dma/dma350_ns"
 }
diff --git a/build_helper/build_helper_configs.py b/build_helper/build_helper_configs.py
index 51d4b09..6d25d40 100755
--- a/build_helper/build_helper_configs.py
+++ b/build_helper/build_helper_configs.py
@@ -607,7 +607,7 @@
                 "cmake_build_type": ["Release"],
                 "with_bl2":         [True],
                 "profile":          [""],
-                "extra_params":     ["EXAMPLE_VAD"]
+                "extra_params":     ["EXTRAS_EXAMPLE_VAD"]
                 },
                 "common_params": _common_tfm_builder_cfg,
                 "invalid": _common_tfm_invalid_configs + []
@@ -621,8 +621,8 @@
                 "test_psa_api":     ["OFF"],
                 "cmake_build_type": ["Release"],
                 "with_bl2":         [True],
-                "profile":          [""],
-                "extra_params":     ["EXAMPLE_DMA350_CLCD"]
+                "profile":          ["profile_medium"],
+                "extra_params":     ["EXTRAS_EXAMPLE_DMA350_CLCD"]
                 },
                 "common_params": _common_tfm_builder_cfg,
                 "invalid": _common_tfm_invalid_configs + []
@@ -632,12 +632,12 @@
                 "tfm_platform":     ["arm/mps3/corstone310/fvp"],
                 "compiler":         ["GCC_10_3"],
                 "isolation_level":  ["1"],
-                "test_regression":  ["OFF"],
+                "test_regression":  ["RegS"],
                 "test_psa_api":     ["OFF"],
                 "cmake_build_type": ["Release"],
                 "with_bl2":         [True],
                 "profile":          [""],
-                "extra_params":     ["EXAMPLE_DMA350_S"]
+                "extra_params":     ["EXTRAS_EXAMPLE_DMA350_S"]
                 },
                 "common_params": _common_tfm_builder_cfg,
                 "invalid": _common_tfm_invalid_configs + []
@@ -647,12 +647,12 @@
                 "tfm_platform":     ["arm/mps3/corstone310/fvp"],
                 "compiler":         ["GCC_10_3"],
                 "isolation_level":  ["1"],
-                "test_regression":  ["OFF"],
+                "test_regression":  ["RegS, RegNS"],
                 "test_psa_api":     ["OFF"],
                 "cmake_build_type": ["Release"],
                 "with_bl2":         [True],
                 "profile":          [""],
-                "extra_params":     ["EXAMPLE_DMA350_NS"]
+                "extra_params":     ["EXTRAS_EXAMPLE_DMA350_NS"]
                 },
                 "common_params": _common_tfm_builder_cfg,
                 "invalid": _common_tfm_invalid_configs + []
@@ -666,8 +666,8 @@
                 "test_psa_api":     ["OFF"],
                 "cmake_build_type": ["Release"],
                 "with_bl2":         [True],
-                "profile":          [""],
-                "extra_params":     ["EXAMPLE_DMA350_TRIGGER"]
+                "profile":          ["profile_medium"],
+                "extra_params":     ["EXTRAS_EXAMPLE_DMA350_TRIGGER"]
                 },
                 "common_params": _common_tfm_builder_cfg,
                 "invalid": _common_tfm_invalid_configs + []
diff --git a/tfm_ci_pylib/tfm_build_manager.py b/tfm_ci_pylib/tfm_build_manager.py
index bc8bdfd..431c57e 100644
--- a/tfm_ci_pylib/tfm_build_manager.py
+++ b/tfm_ci_pylib/tfm_build_manager.py
@@ -9,7 +9,7 @@
 
 __copyright__ = """
 /*
- * Copyright (c) 2018-2022, Arm Limited. All rights reserved.
+ * Copyright (c) 2018-2024, Arm Limited. All rights reserved.
  *
  * SPDX-License-Identifier: BSD-3-Clause
  *
@@ -416,6 +416,8 @@
         elif "PROF" in i.extra_params:
             overwrite_params["spe_root_dir"] = build_cfg["codebase_root_dir"] + "/../tf-m-tests/tests_reg/spe"
             overwrite_params["nspe_root_dir"] = build_cfg["codebase_root_dir"] + "/../tf-m-tests/tests_reg"
+        elif "EXTRAS_" in i.extra_params and "OFF" == i.test_regression:
+            overwrite_params["nspe_root_dir"] = build_cfg["codebase_root_dir"] + "/../tf-m-extras/" + mapTfmExtrasExamplePaths[i.extra_params]
 
         # Overwrite commands for building TF-M image
         build_cfg["spe_config_template"] %= overwrite_params