diff options
author | Madhukar Pappireddy <madhukar.pappireddy@arm.com> | 2020-12-31 19:25:33 -0600 |
---|---|---|
committer | Madhukar Pappireddy <madhukar.pappireddy@arm.com> | 2021-04-30 09:31:53 -0500 |
commit | 172523b9ceadd0af9f6e8e4fb899cc7f354ff002 (patch) | |
tree | ef3d02c2953b208aa5e1c84a23bc58a117f27e9a /tftf/tests | |
parent | c5b60fce76bd56739c909fa0d5ac53d482171c88 (diff) | |
download | tf-a-tests-172523b9ceadd0af9f6e8e4fb899cc7f354ff002.tar.gz |
Cactus test for exercising SMMUv3 driver to perform stage2 translation
Signed-off-by: Madhukar Pappireddy <madhukar.pappireddy@arm.com>
Change-Id: I498cb63aed497ab469a38e486a7943dd634e5b36
Diffstat (limited to 'tftf/tests')
-rw-r--r-- | tftf/tests/runtime_services/secure_service/test_spm_smmu.c | 38 | ||||
-rw-r--r-- | tftf/tests/tests-spm.mk | 1 | ||||
-rw-r--r-- | tftf/tests/tests-spm.xml | 5 |
3 files changed, 44 insertions, 0 deletions
diff --git a/tftf/tests/runtime_services/secure_service/test_spm_smmu.c b/tftf/tests/runtime_services/secure_service/test_spm_smmu.c new file mode 100644 index 000000000..b041a976c --- /dev/null +++ b/tftf/tests/runtime_services/secure_service/test_spm_smmu.c @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2021, Arm Limited. All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#include <cactus_test_cmds.h> +#include <debug.h> +#include <ffa_endpoints.h> +#include <smccc.h> +#include <test_helpers.h> + +static const struct ffa_uuid expected_sp_uuids[] = { {PRIMARY_UUID} }; + +/************************************************************************** + * Send a command to SP1 initiate DMA service with the help of a peripheral + * device upstream of an SMMUv3 IP + **************************************************************************/ +test_result_t test_smmu_spm(void) +{ + smc_ret_values ret; + + /********************************************************************** + * Check SPMC has ffa_version and expected FFA endpoints are deployed. + **********************************************************************/ + CHECK_SPMC_TESTING_SETUP(1, 0, expected_sp_uuids); + + VERBOSE("Sending command to SP %x for initiating DMA transfer\n", + SP_ID(1)); + ret = cactus_send_dma_cmd(HYP_ID, SP_ID(1)); + + if (cactus_get_response(ret) != CACTUS_SUCCESS) { + return TEST_RESULT_FAIL; + } + + return TEST_RESULT_SUCCESS; +} + diff --git a/tftf/tests/tests-spm.mk b/tftf/tests/tests-spm.mk index 9364052b6..e62e03d94 100644 --- a/tftf/tests/tests-spm.mk +++ b/tftf/tests/tests-spm.mk @@ -15,4 +15,5 @@ TESTS_SOURCES += \ test_ffa_rxtx_map.c \ test_ffa_version.c \ test_spm_cpu_features.c \ + test_spm_smmu.c \ ) diff --git a/tftf/tests/tests-spm.xml b/tftf/tests/tests-spm.xml index 01ebceab2..32efc161b 100644 --- a/tftf/tests/tests-spm.xml +++ b/tftf/tests/tests-spm.xml @@ -84,4 +84,9 @@ function="test_ffa_ns_interrupt" /> </testsuite> + <testsuite name="SMMUv3 tests" + description="Initiate stage2 translation for streams from upstream peripherals" > + <testcase name="Check DMA command by SMMUv3TestEngine completes" + function="test_smmu_spm" /> + </testsuite> </testsuites> |