Build: Add extra_params to support ST specific configs

ST requires to cover some specific configs on Open CI.
To make tfm_build_manager more flexible to support different configs,
add 'extra_params' which can be mapped to any specific configs.

Signed-off-by: Xinyu Zhang <xinyu.zhang@arm.com>
Change-Id: Ia64e002695c19056ee215919564c6493e1a152fd
diff --git a/tfm_ci_pylib/tfm_build_manager.py b/tfm_ci_pylib/tfm_build_manager.py
index b1826f4..8b7841d 100644
--- a/tfm_ci_pylib/tfm_build_manager.py
+++ b/tfm_ci_pylib/tfm_build_manager.py
@@ -69,6 +69,24 @@
                 "1": "SFP1",
                 "2": "SFP2"}
 
+mapExtraParams = {"":              "",
+                  "CRYPTO_OFF":   ("-DTEST_S_CRYPTO=OFF "
+                                   "-DTEST_NS_CRYPTO=OFF "),
+                  "NS_ATTEST_ON": ("-DTEST_S_CRYPTO=OFF "
+                                   "-DTEST_NS_CRYPTO=OFF "
+                                   "-DTEST_S_ITS=OFF "
+                                   "-DTEST_NS_ITS=OFF "
+                                   "-DTEST_S_PLATFORM=OFF "
+                                   "-DTEST_NS_PLATFORM=OFF "
+                                   "-DTEST_NS_ATTESTATION=ON "
+                                   "-DTEST_S_ATTESTATION=OFF "
+                                   "-DTEST_NS_QCBOR=OFF "
+                                   "-DTEST_S_QCBOR=OFF "
+                                   "-DTEST_NS_T_COSE=OFF "
+                                   "-DTEST_S_T_COSE=OFF "
+                                   "-DTEST_NS_PS=OFF "
+                                   "-DTEST_S_PS=OFF ")}
+
 class TFM_Build_Manager(structuredTask):
     """ Class that will load a configuration out of a json file, schedule
     the builds, and produce a report """
@@ -142,7 +160,8 @@
             "NSCE={}",
             "MMIO={}",
             "FP={}",
-            "LAZY={}"
+            "LAZY={}",
+            "EXTRA_PARAMS={}"
         ]
         print(
             "\n".join(argument_list)
@@ -163,7 +182,8 @@
                 config_details.nsce,
                 config_details.mmio,
                 config_details.fp,
-                config_details.lazy
+                config_details.lazy,
+                "N.A" if not config_details.extra_params else config_details.extra_params,
             )
             .strip()
         )
@@ -425,7 +445,8 @@
                             "nsce": i.nsce,
                             "mmio": i.mmio,
                             "fp": i.fp,
-                            "lazy": i.lazy}
+                            "lazy": i.lazy,
+                            "extra_params": mapExtraParams[i.extra_params]}
         if i.test_psa_api == "IPC":
             overwrite_params["test_psa_api"] += " -DINCLUDE_PANIC_TESTS=1"
             if i.tfm_platform == "arm/musca_b1/sse_200":
@@ -622,6 +643,8 @@
                 config_param.append(mapSFPOption[list(i)[14]]) #FP
             if list(i)[15] == "ON": # LAZY
                 config_param.append("SLAZY")
+            if list(i)[16]: # EXTRA_PARAMS
+                config_param.append(list(i)[16])
             i_str = "_".join(config_param)
             ret_cfg[i_str] = i
         return ret_cfg