summaryrefslogtreecommitdiff
path: root/tftf
diff options
context:
space:
mode:
authorOlivier Deprez <olivier.deprez@arm.com>2020-05-26 09:11:49 +0000
committerTrustedFirmware Code Review <review@review.trustedfirmware.org>2020-05-26 09:11:49 +0000
commit5da6f402dcc85a9a281eb93dc00d5af2eeabf3b0 (patch)
tree536558dbcc3e81536a84c42010dff760b7418c08 /tftf
parentfa940145f77d1b9b625866b96108ba8eb8c62d46 (diff)
parent09d3ce922a82c76e5c231219fe16c719633cf048 (diff)
Merge changes from topic "spci_to_ffa"
* changes: cactus: update memory/device region nodes in manifest cactus: map memory regions, used as RX/TX buffers in SPM SPCI is now called PSA FF-A
Diffstat (limited to 'tftf')
-rw-r--r--tftf/tests/runtime_services/secure_service/ffa_helpers.c (renamed from tftf/tests/runtime_services/secure_service/spci_helpers.c)36
-rw-r--r--tftf/tests/runtime_services/secure_service/test_ffa_direct_messaging.c (renamed from tftf/tests/runtime_services/secure_service/test_spci_direct_messaging.c)58
-rw-r--r--tftf/tests/tests-spm.mk4
-rw-r--r--tftf/tests/tests-spm.xml4
4 files changed, 51 insertions, 51 deletions
diff --git a/tftf/tests/runtime_services/secure_service/spci_helpers.c b/tftf/tests/runtime_services/secure_service/ffa_helpers.c
index 1370a38..9d19fec 100644
--- a/tftf/tests/runtime_services/secure_service/spci_helpers.c
+++ b/tftf/tests/runtime_services/secure_service/ffa_helpers.c
@@ -6,11 +6,11 @@
#include <debug.h>
#include <smccc.h>
-#include <spci_helpers.h>
-#include <spci_svc.h>
+#include <ffa_helpers.h>
+#include <ffa_svc.h>
/*-----------------------------------------------------------------------------
- * SPCI_RUN
+ * FFA_RUN
*
* Parameters
* uint32 Function ID (w0): 0x8400006D
@@ -19,17 +19,17 @@
* -Bits[15:0]: ID of vCPU of SP/VM to run.
* Other Parameter registers w2-w7/x2-x7: Reserved (MBZ)
*
- * On failure, returns SPCI_ERROR in w0 and error code in w2:
+ * On failure, returns FFA_ERROR in w0 and error code in w2:
* -INVALID_PARAMETERS: Unrecognized endpoint or vCPU ID
- * -NOT_SUPPORTED: This function is not implemented at this SPCI instance
+ * -NOT_SUPPORTED: This function is not implemented at this FFA instance
* -DENIED: Callee is not in a state to handle this request
* -BUSY: vCPU is busy and caller must retry later
* -ABORTED: vCPU or VM ran into an unexpected error and has aborted
*/
-smc_ret_values spci_run(uint32_t dest_id, uint32_t vcpu_id)
+smc_ret_values ffa_run(uint32_t dest_id, uint32_t vcpu_id)
{
smc_args args = {
- SPCI_MSG_RUN,
+ FFA_MSG_RUN,
(dest_id << 16) | vcpu_id,
0, 0, 0, 0, 0, 0
};
@@ -38,7 +38,7 @@ smc_ret_values spci_run(uint32_t dest_id, uint32_t vcpu_id)
}
/*-----------------------------------------------------------------------------
- * SPCI_MSG_SEND_DIRECT_REQ
+ * FFA_MSG_SEND_DIRECT_REQ
*
* Parameters
* uint32 Function ID (w0): 0x8400006F / 0xC400006F
@@ -48,14 +48,14 @@ smc_ret_values spci_run(uint32_t dest_id, uint32_t vcpu_id)
* uint32/uint64 (w2/x2) - RFU MBZ
* w3-w7 - Implementation defined
*
- * On failure, returns SPCI_ERROR in w0 and error code in w2:
+ * On failure, returns FFA_ERROR in w0 and error code in w2:
* -INVALID_PARAMETERS: Invalid endpoint ID or non-zero reserved register
* -DENIED: Callee is not in a state to handle this request
- * -NOT_SUPPORTED: This function is not implemented at this SPCI instance
+ * -NOT_SUPPORTED: This function is not implemented at this FFA instance
* -BUSY: Message target is busy
* -ABORTED: Message target ran into an unexpected error and has aborted
*/
-static smc_ret_values __spci_msg_send_direct_req32_5(uint32_t source_id,
+static smc_ret_values __ffa_msg_send_direct_req32_5(uint32_t source_id,
uint32_t dest_id,
uint32_t arg0,
uint32_t arg1,
@@ -64,7 +64,7 @@ static smc_ret_values __spci_msg_send_direct_req32_5(uint32_t source_id,
uint32_t arg4)
{
smc_args args = {
- SPCI_MSG_SEND_DIRECT_REQ_SMC32,
+ FFA_MSG_SEND_DIRECT_REQ_SMC32,
(source_id << 16) | dest_id,
0,
arg0, arg1, arg2, arg3, arg4
@@ -74,14 +74,14 @@ static smc_ret_values __spci_msg_send_direct_req32_5(uint32_t source_id,
}
/* Direct message send helper accepting a single 32b message argument */
-smc_ret_values spci_msg_send_direct_req(uint32_t source_id, uint32_t dest_id,
+smc_ret_values ffa_msg_send_direct_req(uint32_t source_id, uint32_t dest_id,
uint32_t message)
{
- return __spci_msg_send_direct_req32_5(source_id, dest_id,
+ return __ffa_msg_send_direct_req32_5(source_id, dest_id,
message, 0, 0, 0, 0);
}
-static smc_ret_values __spci_msg_send_direct_req64_5(uint32_t source_id,
+static smc_ret_values __ffa_msg_send_direct_req64_5(uint32_t source_id,
uint32_t dest_id,
uint64_t arg0,
uint64_t arg1,
@@ -90,7 +90,7 @@ static smc_ret_values __spci_msg_send_direct_req64_5(uint32_t source_id,
uint64_t arg4)
{
smc_args args = {
- SPCI_MSG_SEND_DIRECT_REQ_SMC64,
+ FFA_MSG_SEND_DIRECT_REQ_SMC64,
(source_id << 16) | dest_id,
0,
arg0, arg1, arg2, arg3, arg4
@@ -100,9 +100,9 @@ static smc_ret_values __spci_msg_send_direct_req64_5(uint32_t source_id,
}
/* Direct message send helper accepting a single 64b message argument */
-smc_ret_values spci_msg_send_direct_req64(uint32_t source_id, uint32_t dest_id,
+smc_ret_values ffa_msg_send_direct_req64(uint32_t source_id, uint32_t dest_id,
uint64_t message)
{
- return __spci_msg_send_direct_req64_5(source_id, dest_id,
+ return __ffa_msg_send_direct_req64_5(source_id, dest_id,
message, 0, 0, 0, 0);
}
diff --git a/tftf/tests/runtime_services/secure_service/test_spci_direct_messaging.c b/tftf/tests/runtime_services/secure_service/test_ffa_direct_messaging.c
index e085226..f189054 100644
--- a/tftf/tests/runtime_services/secure_service/test_spci_direct_messaging.c
+++ b/tftf/tests/runtime_services/secure_service/test_ffa_direct_messaging.c
@@ -8,11 +8,11 @@
#include <cactus_def.h>
#include <platform.h>
#include <smccc.h>
-#include <spci_helpers.h>
-#include <spci_svc.h>
+#include <ffa_helpers.h>
+#include <ffa_svc.h>
#include <test_helpers.h>
-/* Hypervisor ID at physical SPCI instance */
+/* Hypervisor ID at physical FFA instance */
#define HYP_ID (0)
/* By convention, SP IDs (as opposed to VM IDs) have bit 15 set */
@@ -22,10 +22,10 @@
#define DIRECT_MSG_TEST_PATTERN2 (0xbbbb0000)
#define DIRECT_MSG_TEST_PATTERN3 (0xcccc0000)
-#define OPTEE_SPCI_GET_API_VERSION (0)
-#define OPTEE_SPCI_GET_OS_VERSION (1)
-#define OPTEE_SPCI_GET_OS_VERSION_MAJOR (3)
-#define OPTEE_SPCI_GET_OS_VERSION_MINOR (8)
+#define OPTEE_FFA_GET_API_VERSION (0)
+#define OPTEE_FFA_GET_OS_VERSION (1)
+#define OPTEE_FFA_GET_OS_VERSION_MAJOR (3)
+#define OPTEE_FFA_GET_OS_VERSION_MINOR (8)
static test_result_t send_receive_direct_msg(unsigned int sp_id,
unsigned int test_pattern)
@@ -33,15 +33,15 @@ static test_result_t send_receive_direct_msg(unsigned int sp_id,
smc_ret_values ret_values;
/* Send a message to SP through direct messaging */
- ret_values = spci_msg_send_direct_req(HYP_ID, SP_ID(sp_id),
+ ret_values = ffa_msg_send_direct_req(HYP_ID, SP_ID(sp_id),
test_pattern);
/*
- * Return responses may be SPCI_MSG_SEND_DIRECT_RESP or SPCI_INTERRUPT,
+ * Return responses may be FFA_MSG_SEND_DIRECT_RESP or FFA_INTERRUPT,
* but only expect the former. Expect SMC32 convention from SP.
*/
- if (ret_values.ret0 != SPCI_MSG_SEND_DIRECT_RESP_SMC32) {
- tftf_testcase_printf("spci_msg_send_direct_req returned %lx\n",
+ if (ret_values.ret0 != FFA_MSG_SEND_DIRECT_RESP_SMC32) {
+ tftf_testcase_printf("ffa_msg_send_direct_req returned %lx\n",
(u_register_t)ret_values.ret0);
return TEST_RESULT_FAIL;
}
@@ -75,40 +75,40 @@ static bool check_spmc_execution_level(void)
/*
* Send a first OP-TEE-defined protocol message through
- * SPCI direct message.
+ * FFA direct message.
*
*/
- ret_values = spci_msg_send_direct_req(HYP_ID, SP_ID(1),
- OPTEE_SPCI_GET_API_VERSION);
- if ((ret_values.ret3 == SPCI_VERSION_MAJOR) &&
- (ret_values.ret4 == SPCI_VERSION_MINOR)) {
+ ret_values = ffa_msg_send_direct_req(HYP_ID, SP_ID(1),
+ OPTEE_FFA_GET_API_VERSION);
+ if ((ret_values.ret3 == FFA_VERSION_MAJOR) &&
+ (ret_values.ret4 == FFA_VERSION_MINOR)) {
is_optee_spmc_criteria++;
}
/*
* Send a second OP-TEE-defined protocol message through
- * SPCI direct message.
+ * FFA direct message.
*
*/
- ret_values = spci_msg_send_direct_req(HYP_ID, SP_ID(1),
- OPTEE_SPCI_GET_OS_VERSION);
- if ((ret_values.ret3 == OPTEE_SPCI_GET_OS_VERSION_MAJOR) &&
- (ret_values.ret4 == OPTEE_SPCI_GET_OS_VERSION_MINOR)) {
+ ret_values = ffa_msg_send_direct_req(HYP_ID, SP_ID(1),
+ OPTEE_FFA_GET_OS_VERSION);
+ if ((ret_values.ret3 == OPTEE_FFA_GET_OS_VERSION_MAJOR) &&
+ (ret_values.ret4 == OPTEE_FFA_GET_OS_VERSION_MINOR)) {
is_optee_spmc_criteria++;
}
return (is_optee_spmc_criteria == 2);
}
-test_result_t test_spci_direct_messaging(void)
+test_result_t test_ffa_direct_messaging(void)
{
smc_ret_values ret_values;
test_result_t result;
/**********************************************************************
- * Verify that SPCI is there and that it has the correct version.
+ * Verify that FFA is there and that it has the correct version.
**********************************************************************/
- SKIP_TEST_IF_SPCI_VERSION_LESS_THAN(0, 9);
+ SKIP_TEST_IF_FFA_VERSION_LESS_THAN(1, 0);
/* Check if SPMC is OP-TEE at S-EL1 */
if (check_spmc_execution_level()) {
@@ -135,14 +135,14 @@ test_result_t test_spci_direct_messaging(void)
**********************************************************************/
/*
* NOTICE: for now, the SPM does not initially run each SP sequentially
- * on boot up so we explicitely run the SP once by invoking SPCI_RUN so
- * it reaches spci_msg_wait in the message loop function.
+ * on boot up so we explicitely run the SP once by invoking FFA_RUN so
+ * it reaches ffa_msg_wait in the message loop function.
*/
/* Request running SP2 on VCPU0 */
- ret_values = spci_run(2, 0);
- if (ret_values.ret0 != SPCI_MSG_WAIT) {
- tftf_testcase_printf("spci_run returned %lx\n",
+ ret_values = ffa_run(2, 0);
+ if (ret_values.ret0 != FFA_MSG_WAIT) {
+ tftf_testcase_printf("ffa_run returned %lx\n",
(u_register_t)ret_values.ret0);
return TEST_RESULT_FAIL;
}
diff --git a/tftf/tests/tests-spm.mk b/tftf/tests/tests-spm.mk
index 40c9b87..dab4c6a 100644
--- a/tftf/tests/tests-spm.mk
+++ b/tftf/tests/tests-spm.mk
@@ -6,6 +6,6 @@
TESTS_SOURCES += \
$(addprefix tftf/tests/runtime_services/secure_service/, \
- spci_helpers.c \
- test_spci_direct_messaging.c \
+ ffa_helpers.c \
+ test_ffa_direct_messaging.c \
)
diff --git a/tftf/tests/tests-spm.xml b/tftf/tests/tests-spm.xml
index beac7dd..09af639 100644
--- a/tftf/tests/tests-spm.xml
+++ b/tftf/tests/tests-spm.xml
@@ -11,8 +11,8 @@
<testsuite name="Secure Partition Manager"
description="Test SPM APIs">
- <testcase name="SPCI direct messaging API"
- function="test_spci_direct_messaging" />
+ <testcase name="PSA FF-A direct messaging API"
+ function="test_ffa_direct_messaging" />
</testsuite>