feat(ras): add RAS system registers access test

FEAT_RAS introduces EL1 system registers to query error records, those
CPU specific parts of the RAS extension can be accessed independently of
any FFH/KFH handling setup or any system specific RAS implementation.

Add a test to verify that those registers can be read, when the CPUID
field advertises the MPAM (CPU) extension.

Change-Id: I7429fc815e7e0ee0cd736603966969b2cfb5f469
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
diff --git a/tftf/tests/extensions/ras/test_ras.c b/tftf/tests/extensions/ras/test_ras.c
new file mode 100644
index 0000000..cd27f16
--- /dev/null
+++ b/tftf/tests/extensions/ras/test_ras.c
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2025, Arm Limited. All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+#include <test_helpers.h>
+#include <tftf_lib.h>
+#include <tftf.h>
+
+/*
+ * FEAT_RAS introduces EL1 system registers to query error records, those
+ * CPU specific parts of the RAS extension can be accessed independently of
+ * any FFH/KFH handling setup or any system specific RAS implementation.
+ * Reading these registers will trap to EL3 and crash when EL3 has not
+ * allowed access, which is controlled by the SCR_EL3.TERR bit.
+ */
+
+test_result_t test_ras_reg_access(void)
+{
+	SKIP_TEST_IF_AARCH32();
+
+#ifdef __aarch64__
+	SKIP_TEST_IF_RAS_NOT_SUPPORTED();
+
+	read_erridr_el1();
+
+	return TEST_RESULT_SUCCESS;
+#endif
+}