Add STM32L562E-DK board

Build TF-M firmware for STM32L562E-DK board

Signed-off-by: Arthur She <arthur.she@linaro.org>
Change-Id: I3324e42ba8ca72e1c13348444b4e80ae14579fab
diff --git a/build_helper/build_helper_configs.py b/build_helper/build_helper_configs.py
index 48c0689..6d29649 100755
--- a/build_helper/build_helper_configs.py
+++ b/build_helper/build_helper_configs.py
@@ -95,7 +95,14 @@
                                  "-Binary -offset 0xA020000 "
                                  "-fill 0xFF 0xA020000 0xA200000 "
                                  "-o %(_tbm_build_dir_)s/bin/"
-                                 "tfm.hex -Intel")]
+                                 "tfm.hex -Intel")],
+                   "stm/stm32l562e_dk": [("echo 'STM32L562E-DK board post process';"
+                                          "%(_tbm_build_dir_)s/postbuild.sh;"
+                                          "pushd %(_tbm_build_dir_)s;"
+                                          "sed 's/^echo/#echo/; s/.*\$BINPATH/echo $BINPATH/; s/ -v//' TFM_UPDATE.sh > fwlayout.sh;"
+                                          "chmod a+x fwlayout.sh;"
+                                          "./fwlayout.sh | sed s:%(_tbm_build_dir_)s/:: | tee ./bin/layout.txt;"
+                                          "awk '{print $1}' bin/layout.txt | xargs tar jcf ./bin/stm32l562e-dk-tfm.tar.bz2; popd")]
                    },
 
     # (Optional) If set will fail if those artefacts are missing post build
@@ -197,6 +204,10 @@
     ("arm/musca_s1", "*", "*", "3", "*", "*", "*",  "*", "*", "*", "*", "*"),
     ("cypress/psoc64", "*", "*", "3", "*", "*", "*",  "*", "*", "*", "*", "*"),
     ("arm/musca_b1/secure_enclave", "*", "*", "3", "*", "*", "*",  "*", "*", "*", "*", "*"),
+    # stm/stm32l562e_dk uses BL2
+    ("stm/stm32l562e_dk", "*", "*", "*", "*", "*", "*",  "*", False, "*", "*", "*"),
+    # stm/stm32l562e_dk does not support Debug build type
+    ("stm/stm32l562e_dk", "*", "*", "*", "*", "*", "Debug",  "*", "*", "*", "*", "*"),
     ]
 
 # Configure build manager to build several combinations
@@ -341,6 +352,25 @@
                 "invalid": _common_tfm_invalid_configs + []
                 }
 
+config_STM32L562E_DK = {"seed_params": {
+                "tfm_platform":     ["stm/stm32l562e_dk"],
+                "toolchain_file":   ["toolchain_GNUARM.cmake",
+                                     "toolchain_ARMCLANG.cmake"],
+                "psa_api":          [True, False],
+                "isolation_level":  ["1", "2", "3"],
+                "test_regression":  [True],
+                "test_psa_api":     ["OFF"],
+                "cmake_build_type": ["Release"],
+                "with_otp":         ["off"],
+                "with_bl2":         [True],
+                "with_ns":          [True],
+                "profile":          [""],
+                "partition_ps":     ["ON"],
+                },
+                "common_params": _common_tfm_builder_cfg,
+                "invalid": _common_tfm_invalid_configs + []
+                }
+
 config_AN519 = {"seed_params": {
                 "tfm_platform":     ["arm/mps2/an519"],
                 "toolchain_file":   ["toolchain_GNUARM.cmake",
@@ -384,7 +414,8 @@
                "tfm_platform":     ["arm/mps2/an521", "arm/mps2/an519",
                                     "arm/musca_b1/sse_200",
                                     "arm/mps3/an524", "cypress/psoc64",
-                                    "arm/musca_b1/secure_enclave"],
+                                    "arm/musca_b1/secure_enclave",
+                                    "stm/stm32l562e_dk"],
                "toolchain_file":   ["toolchain_GNUARM.cmake",
                                     "toolchain_ARMCLANG.cmake"],
                "psa_api":          [True, False],
@@ -640,7 +671,8 @@
                "tfm_platform":      ["arm/mps2/an521", "arm/mps2/an519",
                                      "arm/musca_b1/sse_200", "arm/musca_s1",
                                      "arm/mps3/an524", "cypress/psoc64",
-                                     "arm/musca_b1/secure_enclave"],
+                                     "arm/musca_b1/secure_enclave",
+                                     "stm/stm32l562e_dk"],
                 "toolchain_file":   ["toolchain_GNUARM.cmake",
                                      "toolchain_ARMCLANG.cmake"],
                 "psa_api":          [True, False],
@@ -928,6 +960,25 @@
                 "invalid": _common_tfm_invalid_configs + []
                 }
 
+config_pp_STM32L562E_DK = {"seed_params": {
+                "tfm_platform":     ["stm/stm32l562e_dk"],
+                "toolchain_file":   ["toolchain_GNUARM.cmake",
+                                     "toolchain_ARMCLANG.cmake"],
+                "psa_api":          [True],
+                "isolation_level":  ["1", "2", "3"],
+                "test_regression":  [True],
+                "test_psa_api":     ["OFF"],
+                "cmake_build_type": ["Release"],
+                "with_otp":         ["off"],
+                "with_bl2":         [True],
+                "with_ns":          [True],
+                "profile":          [""],
+                "partition_ps":     ["ON"],
+                },
+                "common_params": _common_tfm_builder_cfg,
+                "invalid": _common_tfm_invalid_configs + []
+                }
+
 # Configruation used for document building
 config_doxygen = {"common_params": {
                   "config_type": "tf-m_documents",
@@ -1020,6 +1071,7 @@
                     "psa_ff": config_PSA_FF,
                     "psa_ff_otp": config_PSA_FF_OTP,
                     "tfm_psoc64": config_PSOC64,
+                    "tfm_stm32l562e_dk": config_STM32L562E_DK,
 
                     #nightly test group
                     "nightly_test": config_nightly,
@@ -1033,6 +1085,7 @@
                     "pp_OTP": config_pp_OTP,
                     "pp_PSA_API": config_pp_PSA_API,
                     "pp_psoc64": config_pp_PSoC64,
+                    "pp_stm32l562e_dk": config_pp_STM32L562E_DK,
 
                     #code coverage test group
                     "coverage_an519": config_cov_an519,
diff --git a/jenkins/ci.jpl b/jenkins/ci.jpl
index 2fa7ed1..89a07d8 100644
--- a/jenkins/ci.jpl
+++ b/jenkins/ci.jpl
@@ -18,7 +18,8 @@
                "arm/mps3/an524":                "AN524",
                "arm/musca_b1/sse_200":          "MUSCA_B1",
                "arm/musca_b1/secure_enclave":   "MUSCA_B1_SE",
-               "arm/musca_s1":                  "MUSCA_S1"]
+               "arm/musca_s1":                  "MUSCA_S1",
+               "stm/stm32l562e_dk":             "stm32l562e_dk"]
 
 mapCompiler = ["toolchain_GNUARM.cmake":   "GNUARM",
                "toolchain_ARMCLANG.cmake": "ARMCLANG"]
diff --git a/script/tf-coverity/cov-makefile b/script/tf-coverity/cov-makefile
index 1ca296d..197b8d0 100644
--- a/script/tf-coverity/cov-makefile
+++ b/script/tf-coverity/cov-makefile
@@ -16,7 +16,8 @@
 target_platforms := cypress/psoc64 \
                     arm/mps2/an519 arm/mps2/an521 \
                     arm/mps3/an524 \
-                    arm/musca_b1/sse_200 arm/musca_s1
+                    arm/musca_b1/sse_200 arm/musca_s1 \
+                    stm/stm32l562e_dk
 
 tf_m := trusted-firmware-m
 
diff --git a/tfm_ci_pylib/tfm_build_manager.py b/tfm_ci_pylib/tfm_build_manager.py
index 1a341d6..094057c 100644
--- a/tfm_ci_pylib/tfm_build_manager.py
+++ b/tfm_ci_pylib/tfm_build_manager.py
@@ -39,7 +39,8 @@
                "arm/mps3/an524":                "AN524",
                "arm/musca_b1/sse_200":          "MUSCA_B1",
                "arm/musca_b1/secure_enclave":   "MUSCA_B1_SE",
-               "arm/musca_s1":                  "MUSCA_S1"}
+               "arm/musca_s1":                  "MUSCA_S1",
+               "stm/stm32l562e_dk":             "stm32l562e_dk"}
 
 mapCompiler = {"toolchain_GNUARM.cmake":   "GNUARM",
                "toolchain_ARMCLANG.cmake": "ARMCLANG"}