tc2: add DPE build and test config for TC2 platform

Change-Id: Ibcdecb9196e52ca5c8dfdc3dc923992b72f11692
Signed-off-by: David Vincze <david.vincze@arm.com>
diff --git a/group/tf-l3-boot-tests-misc/fvp-tc2-tbb-dpe:fvp-linux.tc-fip.tc-tc2-debug b/group/tf-l3-boot-tests-misc/fvp-tc2-tbb-dpe:fvp-linux.tc-fip.tc-tc2-debug
new file mode 100644
index 0000000..19363ec
--- /dev/null
+++ b/group/tf-l3-boot-tests-misc/fvp-tc2-tbb-dpe:fvp-linux.tc-fip.tc-tc2-debug
@@ -0,0 +1,5 @@
+#
+# Copyright (c) 2024 Arm Limited. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
diff --git a/run_config/fvp-linux.tc b/run_config/fvp-linux.tc
index 6415588..3b22381 100644
--- a/run_config/fvp-linux.tc
+++ b/run_config/fvp-linux.tc
@@ -39,6 +39,28 @@
 	fi
 }
 
+pre_tf_build() {
+	local qcbor_release_archive="qcbor-v1_2.tar.gz"
+	local qcbor_folder="qcbor"
+
+	if [ "$(get_tf_opt DICE_PROTECTION_ENVIRONMENT)" = 1 ]; then
+		pushd "$workspace"
+
+		if [ ! -d "qcbor" ]; then
+			saveas="${qcbor_release_archive}" \
+				url="https://github.com/laurencelundblade/QCBOR/archive/refs/tags/v1.2.tar.gz" \
+				fetch_file
+			mkdir $qcbor_folder
+			tar -xzf "${qcbor_release_archive}" --directory=$qcbor_folder --strip-component=1
+		fi
+
+		echo "Set QCBOR_DIR to $workspace/qcbor"
+		set_hook_var "QCBOR_DIR" "$workspace/qcbor"
+
+		popd "$workspace"
+	fi
+}
+
 generate_lava_job_template() {
 	# Hold scp terminal_s0
 	uart="0" port="5002" file="hold_uart.exp" track_expect
diff --git a/tf_config/fvp-tc2-tbb-dpe b/tf_config/fvp-tc2-tbb-dpe
new file mode 100644
index 0000000..83acc73
--- /dev/null
+++ b/tf_config/fvp-tc2-tbb-dpe
@@ -0,0 +1,15 @@
+ARM_ARCH_MINOR=7
+ARM_GPT_SUPPORT=1
+ARM_ROTPK_LOCATION=devel_rsa
+BRANCH_PROTECTION=1
+CROSS_COMPILE=aarch64-none-elf-
+CTX_INCLUDE_PAUTH_REGS=1
+DICE_PROTECTION_ENVIRONMENT=1
+ENABLE_SVE_FOR_SWD=1
+GENERATE_COT=1
+MEASURED_BOOT=1
+PLAT=tc
+ROT_KEY=plat/arm/board/common/rotpk/arm_rotprivk_rsa.pem
+SCP_BL2=/dev/null
+TARGET_PLATFORM=2
+TRUSTED_BOARD_BOOT=1