ci(n1sdp): add PSCI runtime instrumentation tests

Add fragments to enable building FIP images with TFTF on N1SDP. There's
no support for this at the moment. With this in place, add fragments and
a test configuration to enable the "Runtime Instrumentation" test suite
to be run.

Signed-off-by: Harrison Mutai <harrison.mutai@arm.com>
Change-Id: I43afb806777de6e128ebe9686708c78cce26673a
diff --git a/group/tf-psci-lava-instr/n1sdp-runtime-instrumentation,n1sdp-runtime-instrumentation:n1sdp-fip.tftf-firmware b/group/tf-psci-lava-instr/n1sdp-runtime-instrumentation,n1sdp-runtime-instrumentation:n1sdp-fip.tftf-firmware
new file mode 100644
index 0000000..5515958
--- /dev/null
+++ b/group/tf-psci-lava-instr/n1sdp-runtime-instrumentation,n1sdp-runtime-instrumentation:n1sdp-fip.tftf-firmware
@@ -0,0 +1,6 @@
+#
+# Copyright (c) 2023 Arm Limited. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+
diff --git a/run_config/n1sdp-fip.tftf b/run_config/n1sdp-fip.tftf
new file mode 100644
index 0000000..82bd7f1
--- /dev/null
+++ b/run_config/n1sdp-fip.tftf
@@ -0,0 +1,16 @@
+#!/usr/bin/env bash
+#
+# Copyright (c) 2023 Arm Limited. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+
+post_tf_build() {
+        # Create FIP for BL2, BL31, and BL33
+        build_fip BL31="$bl31" BL2="$bl2" BL33="$archive/tftf.bin"
+}
+
+generate_lava_job(){
+        target="n1sdp" payload_type="tftf" gen_yaml_template
+        gen_n1sdp_yaml
+}
diff --git a/run_config/n1sdp-fip.uefi b/run_config/n1sdp-fip.uefi
index 4849238..ce9d6c5 100644
--- a/run_config/n1sdp-fip.uefi
+++ b/run_config/n1sdp-fip.uefi
@@ -12,3 +12,8 @@
         # Create FIP for BL2, BL31, and BL33
         build_fip BL31="$bl31" BL2="$bl2" BL33="$archive/uefi.bin"
 }
+
+generate_lava_job(){
+        target="n1sdp" payload_type="linux" gen_yaml_template
+        gen_n1sdp_yaml
+}
diff --git a/script/lava-templates/n1sdp-tftf.yaml b/script/lava-templates/n1sdp-tftf.yaml
new file mode 100644
index 0000000..ca83ed8
--- /dev/null
+++ b/script/lava-templates/n1sdp-tftf.yaml
@@ -0,0 +1,62 @@
+device_type: n1sdp
+job_name: tf-n1sdp
+timeouts:
+  # Global timeout value for the whole job.
+  job:
+    minutes: 30
+  actions:
+    lava-test-monitor:
+      seconds: 120
+  connections:
+    lava-test-monitor:
+      seconds: 300
+
+priority: ${LAVA_PRIORITY:-medium}
+visibility: public
+actions:
+
+- deploy:
+    namespace: recovery
+    timeout:
+      minutes: 10
+    to: flasher
+    images:
+      recovery_image:
+        url: $recovery_img_url
+        compression: zip
+
+- boot:
+    namespace: recovery
+    timeout:
+      minutes: 3
+    method: minimal
+    parameters:
+      kernel-start-message: ''
+    prompts: ['Cmd>']
+
+- boot:
+    namespace: uart1
+    method: new_connection
+    connection: uart1
+
+- test:
+    namespace: uart1
+    connection-namespace: uart1
+    timeout:
+      minutes: 10
+    monitors:
+    - name: TFTF
+      # LAVA looks for a testsuite start string...
+      start: 'Booting trusted firmware test framework'
+      # ...and a testsuite end string.
+      end: 'Exiting tests.'
+
+      # For each test case, LAVA looks for a string which includes the testcase
+      # name and result.
+      pattern: "(?s)> Executing '(?P<test_case_id>.+?(?='))'(.*)  TEST COMPLETE\\\s+(?P<result>(Skipped|Passed|Failed|Crashed))"
+
+      fixupdict:
+        Passed: pass
+        Failed: fail
+        Crashed: fail
+        Skipped: skip
diff --git a/tf_config/n1sdp-runtime-instrumentation b/tf_config/n1sdp-runtime-instrumentation
new file mode 100644
index 0000000..3a7486c
--- /dev/null
+++ b/tf_config/n1sdp-runtime-instrumentation
@@ -0,0 +1,4 @@
+CROSS_COMPILE=aarch64-none-elf-
+ENABLE_RUNTIME_INSTRUMENTATION=1
+PLAT=n1sdp
+SCP_BL2=/dev/null
diff --git a/tftf_config/n1sdp-runtime-instrumentation b/tftf_config/n1sdp-runtime-instrumentation
new file mode 100644
index 0000000..8afbfe4
--- /dev/null
+++ b/tftf_config/n1sdp-runtime-instrumentation
@@ -0,0 +1,3 @@
+CROSS_COMPILE=aarch64-none-elf-
+PLAT=n1sdp
+TESTS=runtime-instrumentation