aboutsummaryrefslogtreecommitdiff
path: root/tftf
diff options
context:
space:
mode:
authoranzhou <anzhou@nvidia.com>2020-06-16 20:56:07 +0800
committerVarun Wadekar <vwadekar@nvidia.com>2020-10-23 18:49:03 -0700
commit42f4d19069f4520d661a4e2907c2f287930eab51 (patch)
tree2a24db64d75770670eed36b3ef18aee230cc3226 /tftf
parentbe5fade008fa4868d26462b0476cb320534435f2 (diff)
downloadtf-a-tests-42f4d19069f4520d661a4e2907c2f287930eab51.tar.gz
Tegra194: support GET_SMMU_PER testing
This patch introduces a test to get return value from SMC SiP function TEGRA_SIP_GET_SMMU_PER. This is a common function for all Tegra platforms. This patch enables the test for Tegra194 platforms. Signed-off-by: anzhou <anzhou@nvidia.com> Change-Id: I14d82aecdbccc02ce3965b52230500bf487a0cc3
Diffstat (limited to 'tftf')
-rw-r--r--tftf/tests/plat/nvidia/common/test_sip.c27
-rw-r--r--tftf/tests/tests-tegra194.xml1
2 files changed, 28 insertions, 0 deletions
diff --git a/tftf/tests/plat/nvidia/common/test_sip.c b/tftf/tests/plat/nvidia/common/test_sip.c
index 0fb86faa..48d4186d 100644
--- a/tftf/tests/plat/nvidia/common/test_sip.c
+++ b/tftf/tests/plat/nvidia/common/test_sip.c
@@ -6,6 +6,7 @@
#include <arch_helpers.h>
#include <debug.h>
+#include <smccc.h>
#include <tftf_lib.h>
#include <xlat_tables_v2.h>
@@ -15,6 +16,7 @@
* Common Tegra SiP SMCs
******************************************************************************/
#define TEGRA_SIP_NEW_VIDEOMEM_REGION 0x82000003ULL
+#define TEGRA_SIP_GET_SMMU_PER 0xC200FF00ULL
/*
* @Test_Aim@ Test to issue VideoMem SiP SMC function IDs.
@@ -194,3 +196,28 @@ test_result_t test_sip_videomem_incorrect_inputs(void)
return TEST_RESULT_SUCCESS;
}
+
+/**
+ * @Test_Aim@ Test to read the SMMU_PER register contents and print the
+ * values.
+ */
+test_result_t test_get_smmu_per(void)
+{
+ smc_args tegra_sip_smc = { TEGRA_SIP_GET_SMMU_PER, 0ULL, 0ULL, 0ULL, 0ULL };
+ smc_ret_values ret;
+
+ tftf_testcase_printf("Tegra SIP GET SMMU PER test\n");
+
+ ret = tftf_smc(&tegra_sip_smc);
+
+ if (ret.ret0 != SMC_OK) {
+ tftf_testcase_printf("GET_SMMU_PER test Fail, got %ld\n", (long int)ret.ret0);
+ return TEST_RESULT_FAIL;
+ }
+
+ tftf_testcase_printf("GET_SMMU_PER per[0] = %lu\n", ret.ret1);
+ tftf_testcase_printf("GET_SMMU_PER per[1] = %lu\n", ret.ret2);
+ tftf_testcase_printf("GET_SMMU_PER per[2] = %lu\n", ret.ret3);
+
+ return TEST_RESULT_SUCCESS;
+}
diff --git a/tftf/tests/tests-tegra194.xml b/tftf/tests/tests-tegra194.xml
index 2c3fb02c..173d3642 100644
--- a/tftf/tests/tests-tegra194.xml
+++ b/tftf/tests/tests-tegra194.xml
@@ -10,6 +10,7 @@
<testsuite name="Tegra SiP tests" description="SiP tests for Tegra platforms">
<testcase name="Video Memory Configuration test" function="test_sip_videomem_incorrect_inputs" />
<testcase name="Video Memory Resize test" function="test_sip_videomem_resize" />
+ <testcase name="Read SMMU_PER register contents test" function="test_get_smmu_per" />
</testsuite>
<testsuite name="Tegra194 platform tests" description="Tests for Tegra194 platforms">
<testcase name="RAS corrected error test" function="test_ras_corrected" />