Enable LAVA test for B-U585I-IOT02A

Signed-off-by: Arthur She <arthur.she@linaro.org>
Change-Id: I91a7e63e565fa098b66bd6536853c63d5c7402ee
diff --git a/build_helper/build_helper_configs.py b/build_helper/build_helper_configs.py
index b8f2bb7..aeb4fde 100755
--- a/build_helper/build_helper_configs.py
+++ b/build_helper/build_helper_configs.py
@@ -106,7 +106,7 @@
                                           "%(_tbm_build_dir_)s/postbuild.sh;"
                                           "pushd %(_tbm_build_dir_)s;"
                                           "BIN_FILES=$(grep -o '\/.*\.bin' TFM_UPDATE.sh | sed 's/^/bin/');"
-                                          "tar jcf ./bin/b_u5851_iot02a-tfm.tar.bz2 regression.sh TFM_UPDATE.sh ${BIN_FILES};"
+                                          "tar jcf ./bin/b_u585i_iot02a-tfm.tar.bz2 regression.sh TFM_UPDATE.sh ${BIN_FILES};"
                                           "popd")],
                   "nxp/lpcxpresso55s69": [("echo 'LPCXpresso55S69 board post process\n';"
                                             "if [ -f \"%(_tbm_build_dir_)s/bin/bl2.hex\" ]; then FLASH_FILE='flash_bl2_JLink.py'; else FLASH_FILE='flash_JLink.py'; fi;"
@@ -790,14 +790,7 @@
                 "extra_params":     [""]
                 },
                 "common_params": _common_tfm_builder_cfg,
-                "invalid": _common_tfm_invalid_configs + [
-                    # all other tests are off when CRYPTO is ON
-                    ("stm/b_u585i_iot02a", "*", "*", True, "*",
-                     "*", "*", "*", "CRYPTO_ON"),
-                    # all other tests are ON when CRYPTO is OFF
-                    ("stm/stm32l562e_dk", "*", "*", False, "*",
-                     "*", "*", "*", "CRYPTO_OFF"),
-                ]
+                "invalid": _common_tfm_invalid_configs + []
                 }
 
 config_nucleo_l552ze_q = {"seed_params": {
diff --git a/lava_helper/jinja2_templates/b_u585i_iot02a.jinja2 b/lava_helper/jinja2_templates/b_u585i_iot02a.jinja2
new file mode 100644
index 0000000..f95c437
--- /dev/null
+++ b/lava_helper/jinja2_templates/b_u585i_iot02a.jinja2
@@ -0,0 +1,45 @@
+{#------------------------------------------------------------------------------
+# Copyright (c) 2020-2022, Arm Limited and Contributors. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+#-----------------------------------------------------------------------------#}
+{% extends 'jinja2_templates/base.jinja2' %}
+{% block actions %}
+actions:
+    - deploy:
+        timeout:
+          minutes: 12
+        to: flasher
+        images:
+          tarball:
+            url: {{ tarball_url }}
+
+    - boot:
+        method: minimal
+
+    - test:
+        monitors:
+        {%- for monitor in monitors %}
+        - name: "{{monitor.name}}"
+          start: "{{monitor.start}}"
+          end: "{{monitor.end}}"
+          pattern: "{{monitor.pattern}}"
+          fixupdict:
+              '{{monitor.fixup.pass}}': pass
+              '{{monitor.fixup.fail}}': fail
+              {%- if monitor.fixup.skip %}
+              '{{monitor.fixup.skip}}': skip
+              {%- endif %}
+        {% endfor %}
+{% endblock %}
+
+{% block metadata %}
+metadata:
+  build_no: {{ build_no }}
+  name: {{ name }}
+  platform: {{ platform }}
+  build_name: {{ build_name }}
+  device_type: {{ device_type }}
+  build_job_url: {{ build_job_url }}
+{% endblock %}
diff --git a/lava_helper/lava_helper_configs.py b/lava_helper/lava_helper_configs.py
index 8878828..5f5d315 100644
--- a/lava_helper/lava_helper_configs.py
+++ b/lava_helper/lava_helper_configs.py
@@ -248,6 +248,24 @@
     }
 }
 
+# STM32U5 B-U585I-IOT02A
+b_u585i_iot02a = {
+    "templ": "b_u585i_iot02a.jinja2",
+    "job_name": "b_u585i_iot02a",
+    "device_type": "b-u585i-iot02a",
+    "job_timeout": 24,
+    "action_timeout": 15,
+    "monitor_timeout": 15,
+    "poweroff_timeout": 5,
+    "platforms": {"stm/b_u585i_iot02a": ""},
+    "binaries": {
+        "tarball": "b_u585i_iot02a-tfm.tar.bz2",
+    },
+    "monitors": {
+        'reg_tests': [monitors_mcuboot_tests, monitors_s_reg_tests, monitors_ns_reg_tests],
+    }
+}
+
 # LPCxpresso55S69
 lpcxpresso55s69 = {
     "templ": "lpcxpresso55s69.jinja2",
@@ -296,6 +314,7 @@
     "musca_b1": musca_b1_bl2,
     "stm32l562e_dk": stm32l562e_dk,
     "lpcxpresso55s69": lpcxpresso55s69,
+    "b_u585i_iot02a": b_u585i_iot02a,
     "psoc64": psoc64,
 }