From e4530cd3cfdc7b77a3cbe95a929ade4db363eb06 Mon Sep 17 00:00:00 2001 From: Arunachalam Ganapathy Date: Tue, 12 Oct 2021 11:32:26 +0100 Subject: spd: trusty: use FFA specific macros from ffa_svc This modifies FFA memory sharing ABIs in Trusty SPD to use FFA function IDs from ffa_svc.h. Removes FFA function IDs definition from Trusty SPD. Signed-off-by: Arunachalam Ganapathy Change-Id: I9d46f004286867e6b2a685aca2841cdb29b25053 --- services/spd/trusty/include/trusty/arm_ffa.h | 371 +-------------------------- services/spd/trusty/shared-mem-smcall.c | 106 ++++---- 2 files changed, 67 insertions(+), 410 deletions(-) diff --git a/services/spd/trusty/include/trusty/arm_ffa.h b/services/spd/trusty/include/trusty/arm_ffa.h index 9d1f96553..d7e0416a6 100644 --- a/services/spd/trusty/include/trusty/arm_ffa.h +++ b/services/spd/trusty/include/trusty/arm_ffa.h @@ -11,20 +11,20 @@ * (https://developer.arm.com/docs/den0077/a) needed for shared memory. */ +#include #include "smcall.h" #ifndef STATIC_ASSERT #define STATIC_ASSERT(e) _Static_assert(e, #e) #endif -#define FFA_CURRENT_VERSION_MAJOR (1U) -#define FFA_CURRENT_VERSION_MINOR (0U) +#define TRUSTY_FFA_CURRENT_VERSION_MAJOR (1U) +#define TRUSTY_FFA_CURRENT_VERSION_MINOR (0U) -#define FFA_VERSION_TO_MAJOR(version) ((version) >> 16) -#define FFA_VERSION_TO_MINOR(version) ((version) & (0xffff)) -#define FFA_VERSION(major, minor) (((major) << 16) | (minor)) -#define FFA_CURRENT_VERSION \ - FFA_VERSION(FFA_CURRENT_VERSION_MAJOR, FFA_CURRENT_VERSION_MINOR) +#define FFA_VERSION_TO_MAJOR(V) ((V) >> FFA_VERSION_MAJOR_SHIFT) +#define MAKE_TRUSTY_FFA_CURRENT_VERSION \ + MAKE_FFA_VERSION(TRUSTY_FFA_CURRENT_VERSION_MAJOR, \ + TRUSTY_FFA_CURRENT_VERSION_MINOR) #define SMC_ENTITY_SHARED_MEMORY 4 @@ -303,369 +303,24 @@ typedef uint32_t ffa_features2_t; typedef uint32_t ffa_features3_t; #define FFA_FEATURES3_MEM_RETRIEVE_REQ_REFCOUNT_MASK 0xffU -/** - * enum ffa_error - FF-A error code - * @FFA_ERROR_NOT_SUPPORTED: - * Operation is not supported by the current implementation. - * @FFA_ERROR_INVALID_PARAMETERS: - * Invalid parameters. Conditions function specific. - * @FFA_ERROR_NO_MEMORY: - * Not enough memory. - * @FFA_ERROR_DENIED: - * Operation not allowed. Conditions function specific. - * - * FF-A 1.0 EAC defines other error codes as well but the current implementation - * does not use them. - */ -enum ffa_error { - FFA_ERROR_NOT_SUPPORTED = -1, - FFA_ERROR_INVALID_PARAMETERS = -2, - FFA_ERROR_NO_MEMORY = -3, - FFA_ERROR_DENIED = -6, -}; - /** * SMC_FC32_FFA_MIN - First 32 bit SMC opcode reserved for FFA */ -#define SMC_FC32_FFA_MIN SMC_FASTCALL_NR_SHARED_MEMORY(0x60) +#define SMC_FC32_FFA_MIN FFA_FID(SMC_32, FFA_FNUM_ERROR) /** * SMC_FC32_FFA_MAX - Last 32 bit SMC opcode reserved for FFA + * For FFA version 1.0 */ -#define SMC_FC32_FFA_MAX SMC_FASTCALL_NR_SHARED_MEMORY(0x7F) +#define SMC_FC32_FFA_MAX FFA_FID(SMC_32, FFA_FNUM_MEM_FRAG_TX) /** * SMC_FC64_FFA_MIN - First 64 bit SMC opcode reserved for FFA */ -#define SMC_FC64_FFA_MIN SMC_FASTCALL64_NR_SHARED_MEMORY(0x60) +#define SMC_FC64_FFA_MIN FFA_FID(SMC_64, FFA_FNUM_ERROR) /** * SMC_FC64_FFA_MAX - Last 64 bit SMC opcode reserved for FFA + * For FFA version 1.0 */ -#define SMC_FC64_FFA_MAX SMC_FASTCALL64_NR_SHARED_MEMORY(0x7F) - -/** - * SMC_FC_FFA_ERROR - SMC error return opcode - * - * Register arguments: - * - * * w1: VMID in [31:16], vCPU in [15:0] - * * w2: Error code (&enum ffa_error) - */ -#define SMC_FC_FFA_ERROR SMC_FASTCALL_NR_SHARED_MEMORY(0x60) - -/** - * SMC_FC_FFA_SUCCESS - 32 bit SMC success return opcode - * - * Register arguments: - * - * * w1: VMID in [31:16], vCPU in [15:0] - * * w2-w7: Function specific - */ -#define SMC_FC_FFA_SUCCESS SMC_FASTCALL_NR_SHARED_MEMORY(0x61) - -/** - * SMC_FC64_FFA_SUCCESS - 64 bit SMC success return opcode - * - * Register arguments: - * - * * w1: VMID in [31:16], vCPU in [15:0] - * * w2/x2-w7/x7: Function specific - */ -#define SMC_FC64_FFA_SUCCESS SMC_FASTCALL64_NR_SHARED_MEMORY(0x61) - -/** - * SMC_FC_FFA_VERSION - SMC opcode to return supported FF-A version - * - * Register arguments: - * - * * w1: Major version bit[30:16] and minor version in bit[15:0] supported - * by caller. Bit[31] must be 0. - * - * Return: - * * w0: &SMC_FC_FFA_SUCCESS - * * w2: Major version bit[30:16], minor version in bit[15:0], bit[31] must - * be 0. - * - * or - * - * * w0: &SMC_FC_FFA_ERROR - * * w2: %FFA_ERROR_NOT_SUPPORTED if major version passed in is less than - * the minimum major version supported. - */ -#define SMC_FC_FFA_VERSION SMC_FASTCALL_NR_SHARED_MEMORY(0x63) - -/** - * SMC_FC_FFA_FEATURES - SMC opcode to check optional feature support - * - * Register arguments: - * - * * w1: FF-A function ID - * - * Return: - * * w0: &SMC_FC_FFA_SUCCESS - * * w2: &typedef ffa_features2_t - * * w3: &typedef ffa_features3_t - * - * or - * - * * w0: &SMC_FC_FFA_ERROR - * * w2: %FFA_ERROR_NOT_SUPPORTED if function is not implemented, or - * %FFA_ERROR_INVALID_PARAMETERS if function id is not valid. - */ -#define SMC_FC_FFA_FEATURES SMC_FASTCALL_NR_SHARED_MEMORY(0x64) - -/** - * SMC_FC_FFA_RXTX_MAP - 32 bit SMC opcode to map message buffers - * - * Register arguments: - * - * * w1: TX address - * * w2: RX address - * * w3: RX/TX page count in bit[5:0] - * - * Return: - * * w0: &SMC_FC_FFA_SUCCESS - */ -#define SMC_FC_FFA_RXTX_MAP SMC_FASTCALL_NR_SHARED_MEMORY(0x66) - -/** - * SMC_FC64_FFA_RXTX_MAP - 64 bit SMC opcode to map message buffers - * - * Register arguments: - * - * * x1: TX address - * * x2: RX address - * * x3: RX/TX page count in bit[5:0] - * - * Return: - * * w0: &SMC_FC_FFA_SUCCESS - */ -#define SMC_FC64_FFA_RXTX_MAP SMC_FASTCALL64_NR_SHARED_MEMORY(0x66) - -/** - * SMC_FC_FFA_RXTX_UNMAP - SMC opcode to unmap message buffers - * - * Register arguments: - * - * * w1: ID in [31:16] - * - * Return: - * * w0: &SMC_FC_FFA_SUCCESS - */ -#define SMC_FC_FFA_RXTX_UNMAP SMC_FASTCALL_NR_SHARED_MEMORY(0x67) - -/** - * SMC_FC_FFA_ID_GET - SMC opcode to get endpoint id of caller - * - * Return: - * * w0: &SMC_FC_FFA_SUCCESS - * * w2: ID in bit[15:0], bit[31:16] must be 0. - */ -#define SMC_FC_FFA_ID_GET SMC_FASTCALL_NR_SHARED_MEMORY(0x69) - -/** - * SMC_FC_FFA_MEM_DONATE - 32 bit SMC opcode to donate memory - * - * Not supported. - */ -#define SMC_FC_FFA_MEM_DONATE SMC_FASTCALL_NR_SHARED_MEMORY(0x71) - -/** - * SMC_FC_FFA_MEM_LEND - 32 bit SMC opcode to lend memory - * - * Register arguments: - * - * * w1: Total length - * * w2: Fragment length - * * w3: Address - * * w4: Page count - * - * Return: - * * w0: &SMC_FC_FFA_SUCCESS - * * w2/w3: Handle - * - * or - * - * * w0: &SMC_FC_FFA_MEM_FRAG_RX - * * w1-: See &SMC_FC_FFA_MEM_FRAG_RX - * - * or - * - * * w0: &SMC_FC_FFA_ERROR - * * w2: Error code (&enum ffa_error) - */ -#define SMC_FC_FFA_MEM_LEND SMC_FASTCALL_NR_SHARED_MEMORY(0x72) - -/** - * SMC_F64C_FFA_MEM_LEND - 64 bit SMC opcode to lend memory - * - * Register arguments: - * - * * w1: Total length - * * w2: Fragment length - * * x3: Address - * * w4: Page count - * - * Return: - * * w0: &SMC_FC_FFA_SUCCESS - * * w2/w3: Handle - * - * or - * - * * w0: &SMC_FC_FFA_MEM_FRAG_RX - * * w1-: See &SMC_FC_FFA_MEM_FRAG_RX - * - * or - * - * * w0: &SMC_FC_FFA_ERROR - * * w2: Error code (&enum ffa_error) - */ -#define SMC_FC64_FFA_MEM_LEND SMC_FASTCALL64_NR_SHARED_MEMORY(0x72) - -/** - * SMC_FC_FFA_MEM_SHARE - 32 bit SMC opcode to share memory - * - * Register arguments: - * - * * w1: Total length - * * w2: Fragment length - * * w3: Address - * * w4: Page count - * - * Return: - * * w0: &SMC_FC_FFA_SUCCESS - * * w2/w3: Handle - * - * or - * - * * w0: &SMC_FC_FFA_MEM_FRAG_RX - * * w1-: See &SMC_FC_FFA_MEM_FRAG_RX - * - * or - * - * * w0: &SMC_FC_FFA_ERROR - * * w2: Error code (&enum ffa_error) - */ -#define SMC_FC_FFA_MEM_SHARE SMC_FASTCALL_NR_SHARED_MEMORY(0x73) - -/** - * SMC_FC64_FFA_MEM_SHARE - 64 bit SMC opcode to share memory - * - * Register arguments: - * - * * w1: Total length - * * w2: Fragment length - * * x3: Address - * * w4: Page count - * - * Return: - * * w0: &SMC_FC_FFA_SUCCESS - * * w2/w3: Handle - * - * or - * - * * w0: &SMC_FC_FFA_MEM_FRAG_RX - * * w1-: See &SMC_FC_FFA_MEM_FRAG_RX - * - * or - * - * * w0: &SMC_FC_FFA_ERROR - * * w2: Error code (&enum ffa_error) - */ -#define SMC_FC64_FFA_MEM_SHARE SMC_FASTCALL64_NR_SHARED_MEMORY(0x73) - -/** - * SMC_FC_FFA_MEM_RETRIEVE_REQ - 32 bit SMC opcode to retrieve shared memory - * - * Register arguments: - * - * * w1: Total length - * * w2: Fragment length - * * w3: Address - * * w4: Page count - * - * Return: - * * w0: &SMC_FC_FFA_MEM_RETRIEVE_RESP - * * w1/x1-w5/x5: See &SMC_FC_FFA_MEM_RETRIEVE_RESP - */ -#define SMC_FC_FFA_MEM_RETRIEVE_REQ SMC_FASTCALL_NR_SHARED_MEMORY(0x74) - -/** - * SMC_FC64_FFA_MEM_RETRIEVE_REQ - 64 bit SMC opcode to retrieve shared memory - * - * Register arguments: - * - * * w1: Total length - * * w2: Fragment length - * * x3: Address - * * w4: Page count - * - * Return: - * * w0: &SMC_FC_FFA_MEM_RETRIEVE_RESP - * * w1/x1-w5/x5: See &SMC_FC_FFA_MEM_RETRIEVE_RESP - */ -#define SMC_FC64_FFA_MEM_RETRIEVE_REQ SMC_FASTCALL64_NR_SHARED_MEMORY(0x74) - -/** - * SMC_FC_FFA_MEM_RETRIEVE_RESP - Retrieve 32 bit SMC return opcode - * - * Register arguments: - * - * * w1: Total length - * * w2: Fragment length - */ -#define SMC_FC_FFA_MEM_RETRIEVE_RESP SMC_FASTCALL_NR_SHARED_MEMORY(0x75) - -/** - * SMC_FC_FFA_MEM_RELINQUISH - SMC opcode to relinquish shared memory - * - * Input in &struct ffa_mem_relinquish_descriptor format in message buffer. - * - * Return: - * * w0: &SMC_FC_FFA_SUCCESS - */ -#define SMC_FC_FFA_MEM_RELINQUISH SMC_FASTCALL_NR_SHARED_MEMORY(0x76) - -/** - * SMC_FC_FFA_MEM_RECLAIM - SMC opcode to reclaim shared memory - * - * Register arguments: - * - * * w1/w2: Handle - * * w3: Flags - * - * Return: - * * w0: &SMC_FC_FFA_SUCCESS - */ -#define SMC_FC_FFA_MEM_RECLAIM SMC_FASTCALL_NR_SHARED_MEMORY(0x77) - -/** - * SMC_FC_FFA_MEM_FRAG_RX - SMC opcode to request next fragment. - * - * Register arguments: - * - * * w1/w2: Handle - * * w3: Fragment offset. - * * w4: Endpoint id ID in [31:16], if client is hypervisor. - * - * Return: - * * w0: &SMC_FC_FFA_MEM_FRAG_TX - * * w1/x1-w5/x5: See &SMC_FC_FFA_MEM_FRAG_TX - */ -#define SMC_FC_FFA_MEM_FRAG_RX SMC_FASTCALL_NR_SHARED_MEMORY(0x7A) - -/** - * SMC_FC_FFA_MEM_FRAG_TX - SMC opcode to transmit next fragment - * - * Register arguments: - * - * * w1/w2: Handle - * * w3: Fragment length. - * * w4: Sender endpoint id ID in [31:16], if client is hypervisor. - * - * Return: - * * w0: &SMC_FC_FFA_MEM_FRAG_RX or &SMC_FC_FFA_SUCCESS. - * * w1/x1-w5/x5: See opcode in w0. - */ -#define SMC_FC_FFA_MEM_FRAG_TX SMC_FASTCALL_NR_SHARED_MEMORY(0x7B) +#define SMC_FC64_FFA_MAX FFA_FID(SMC_64, FFA_FNUM_MEM_FRAG_TX) diff --git a/services/spd/trusty/shared-mem-smcall.c b/services/spd/trusty/shared-mem-smcall.c index ce12cc893..71cde3673 100644 --- a/services/spd/trusty/shared-mem-smcall.c +++ b/services/spd/trusty/shared-mem-smcall.c @@ -350,7 +350,7 @@ static long trusty_ffa_fill_desc(struct trusty_shmem_client_state *client, uint32_t handle_low = (uint32_t)obj->desc.handle; uint32_t handle_high = obj->desc.handle >> 32; if (obj->desc_filled != obj->desc_size) { - SMC_RET8(smc_handle, SMC_FC_FFA_MEM_FRAG_RX, handle_low, + SMC_RET8(smc_handle, FFA_MEM_FRAG_RX, handle_low, handle_high, obj->desc_filled, (uint32_t)obj->desc.sender_id << 16, 0, 0, 0); } @@ -360,7 +360,7 @@ static long trusty_ffa_fill_desc(struct trusty_shmem_client_state *client, goto err_share_fail; } - SMC_RET8(smc_handle, SMC_FC_FFA_SUCCESS, 0, handle_low, handle_high, 0, + SMC_RET8(smc_handle, FFA_SUCCESS_SMC32, 0, handle_low, handle_high, 0, 0, 0, 0); err_share_fail: @@ -379,7 +379,7 @@ err_arg: * @address: Not supported, must be 0. * @page_count: Not supported, must be 0. * @smc_handle: Handle passed to smc call. Used to return - * SMC_FC_FFA_MEM_FRAG_RX or SMC_FC_FFA_SUCCESS. + * FFA_MEM_FRAG_RX or FFA_SUCCESS_SMC32. * * Implements a subset of the FF-A FFA_MEM_SHARE call needed to share memory * from non-secure os to secure os (with no stream endpoints). @@ -424,12 +424,12 @@ static long trusty_ffa_mem_share(struct trusty_shmem_client_state *client, /** * trusty_ffa_mem_frag_tx - FFA_MEM_FRAG_TX implementation. * @client: Client state. - * @handle_low: Handle_low value returned from SMC_FC_FFA_MEM_FRAG_RX. - * @handle_high: Handle_high value returned from SMC_FC_FFA_MEM_FRAG_RX. + * @handle_low: Handle_low value returned from FFA_MEM_FRAG_RX. + * @handle_high: Handle_high value returned from FFA_MEM_FRAG_RX. * @fragment_length: Length of fragments transmitted. * @sender_id: Vmid of sender in bits [31:16] * @smc_handle: Handle passed to smc call. Used to return - * SMC_FC_FFA_MEM_FRAG_RX or SMC_FC_FFA_SUCCESS. + * FFA_MEM_FRAG_RX or FFA_SUCCESS_SMC32. * * Return: @smc_handle on success, error code on failure. */ @@ -482,11 +482,11 @@ static long trusty_ffa_mem_frag_tx(struct trusty_shmem_client_state *client, * @address: Not supported, must be 0. * @page_count: Not supported, must be 0. * @smc_handle: Handle passed to smc call. Used to return - * SMC_FC_FFA_MEM_RETRIEVE_RESP. + * FFA_MEM_RETRIEVE_RESP. * * Implements a subset of the FF-A FFA_MEM_RETRIEVE_REQ call. * Used by secure os to retrieve memory already shared by non-secure os. - * If the data does not fit in a single SMC_FC_FFA_MEM_RETRIEVE_RESP message, + * If the data does not fit in a single FFA_MEM_RETRIEVE_RESP message, * the client must call FFA_MEM_FRAG_RX until the full response has been * received. * @@ -590,7 +590,7 @@ trusty_ffa_mem_retrieve_req(struct trusty_shmem_client_state *client, resp->memory_region_attributes &= ~FFA_MEM_ATTR_NONSECURE; } - SMC_RET8(smc_handle, SMC_FC_FFA_MEM_RETRIEVE_RESP, obj->desc_size, + SMC_RET8(smc_handle, FFA_MEM_RETRIEVE_RESP, obj->desc_size, copy_size, 0, 0, 0, 0, 0); } @@ -603,7 +603,7 @@ trusty_ffa_mem_retrieve_req(struct trusty_shmem_client_state *client, * @sender_id: Bit[31:16]: Endpoint id of sender if client is a * hypervisor. 0 otherwise. * @smc_handle: Handle passed to smc call. Used to return - * SMC_FC_FFA_MEM_FRAG_TX. + * FFA_MEM_FRAG_TX. * * Return: @smc_handle on success, error code on failure. */ @@ -655,7 +655,7 @@ static long trusty_ffa_mem_frag_rx(struct trusty_shmem_client_state *client, memcpy(client->rx_buf, src + fragment_offset, copy_size); - SMC_RET8(smc_handle, SMC_FC_FFA_MEM_FRAG_TX, handle_low, handle_high, + SMC_RET8(smc_handle, FFA_MEM_FRAG_TX, handle_low, handle_high, copy_size, sender_id, 0, 0, 0); } @@ -897,8 +897,8 @@ static int trusty_ffa_id_get(struct trusty_shmem_client_state *client, * @client: Client state. * @version_in: Version supported by client. * @smc_handle: Handle passed to smc call. Used to return version or error code - * directly as this call does not use the FFA_SUCCESS and FFA_ERROR - * opcodes that the other calls use. + * directly as this call does not use the FFA_SUCCESS_SMC32 and + * FFA_ERROR opcodes that the other calls use. * * Return: 0 on success, error code on failure. */ @@ -914,8 +914,10 @@ static long trusty_ffa_version(struct trusty_shmem_client_state *client, * version than ours, return the version we suppoort. Otherwise return * not-supported. */ - if (FFA_VERSION_TO_MAJOR(version_in) >= FFA_CURRENT_VERSION_MAJOR) { - SMC_RET8(smc_handle, FFA_CURRENT_VERSION, 0, 0, 0, 0, 0, 0, 0); + if (FFA_VERSION_TO_MAJOR(version_in) >= + TRUSTY_FFA_CURRENT_VERSION_MAJOR) { + SMC_RET8(smc_handle, MAKE_TRUSTY_FFA_CURRENT_VERSION, + 0, 0, 0, 0, 0, 0, 0); } err_not_suppoprted: @@ -941,24 +943,24 @@ static int trusty_ffa_features(struct trusty_shmem_client_state *client, return -EINVAL; } switch (func) { - case SMC_FC_FFA_ERROR: - case SMC_FC_FFA_SUCCESS: - case SMC_FC_FFA_VERSION: - case SMC_FC_FFA_FEATURES: - case SMC_FC_FFA_RXTX_UNMAP: - case SMC_FC_FFA_ID_GET: - case SMC_FC_FFA_MEM_RETRIEVE_RESP: - case SMC_FC_FFA_MEM_FRAG_RX: - case SMC_FC_FFA_MEM_FRAG_TX: + case FFA_ERROR: + case FFA_SUCCESS_SMC32: + case FFA_VERSION: + case FFA_FEATURES: + case FFA_RXTX_UNMAP: + case FFA_ID_GET: + case FFA_MEM_RETRIEVE_RESP: + case FFA_MEM_FRAG_RX: + case FFA_MEM_FRAG_TX: return 0; - case SMC_FC_FFA_RXTX_MAP: - case SMC_FC64_FFA_RXTX_MAP: + case FFA_RXTX_MAP_SMC32: + case FFA_RXTX_MAP_SMC64: *ret2 = FFA_FEATURES2_RXTX_MAP_BUF_SIZE_4K; return 0; - case SMC_FC_FFA_MEM_RETRIEVE_REQ: - case SMC_FC64_FFA_MEM_RETRIEVE_REQ: + case FFA_MEM_RETRIEVE_REQ_SMC32: + case FFA_MEM_RETRIEVE_REQ_SMC64: /* * Indicate that object can be retrieved up to 2^64 - 1 times * (on a 64 bit build). We track the number of times an object @@ -972,10 +974,10 @@ static int trusty_ffa_features(struct trusty_shmem_client_state *client, } return 0; - case SMC_FC_FFA_MEM_SHARE: - case SMC_FC64_FFA_MEM_SHARE: - case SMC_FC_FFA_MEM_RELINQUISH: - case SMC_FC_FFA_MEM_RECLAIM: + case FFA_MEM_SHARE_SMC32: + case FFA_MEM_SHARE_SMC64: + case FFA_MEM_RELINQUISH: + case FFA_MEM_RECLAIM: *ret2 = 0; return 0; @@ -997,13 +999,13 @@ static int to_spi_err(long ret) return FFA_ERROR_NO_MEMORY; case -EINVAL: case -ENOENT: - return FFA_ERROR_INVALID_PARAMETERS; + return FFA_ERROR_INVALID_PARAMETER; case -EACCES: return FFA_ERROR_DENIED; case -ENOTSUP: return FFA_ERROR_NOT_SUPPORTED; default: - return FFA_ERROR_INVALID_PARAMETERS; + return FFA_ERROR_INVALID_PARAMETER; } } @@ -1043,77 +1045,77 @@ uintptr_t spmd_ffa_smc_handler(uint32_t smc_fid, spin_lock(&trusty_shmem_obj_state.lock); switch (smc_fid) { - case SMC_FC_FFA_VERSION: + case FFA_VERSION: ret = trusty_ffa_version(client, w1, handle); break; - case SMC_FC_FFA_FEATURES: + case FFA_FEATURES: ret = trusty_ffa_features(client, w1, w2, &ret_reg2, &ret_reg3); break; - case SMC_FC_FFA_RXTX_MAP: + case FFA_RXTX_MAP_SMC32: ret = trusty_ffa_rxtx_map(client, w1, w2, w3); break; - case SMC_FC64_FFA_RXTX_MAP: + case FFA_RXTX_MAP_SMC64: ret = trusty_ffa_rxtx_map(client, x1, x2, w3); break; - case SMC_FC_FFA_RXTX_UNMAP: + case FFA_RXTX_UNMAP: ret = trusty_ffa_rxtx_unmap(client, w1); break; - case SMC_FC_FFA_ID_GET: + case FFA_ID_GET: ret = trusty_ffa_id_get(client, &ret_reg2); break; - case SMC_FC_FFA_MEM_LEND: + case FFA_MEM_LEND_SMC32: ret = trusty_ffa_mem_share(client, w1, w2, w3, w4, FFA_MTD_FLAG_TYPE_LEND_MEMORY, handle); break; - case SMC_FC64_FFA_MEM_LEND: + case FFA_MEM_LEND_SMC64: ret = trusty_ffa_mem_share(client, w1, w2, x3, w4, FFA_MTD_FLAG_TYPE_LEND_MEMORY, handle); break; - case SMC_FC_FFA_MEM_SHARE: + case FFA_MEM_SHARE_SMC32: ret = trusty_ffa_mem_share(client, w1, w2, w3, w4, FFA_MTD_FLAG_TYPE_SHARE_MEMORY, handle); break; - case SMC_FC64_FFA_MEM_SHARE: + case FFA_MEM_SHARE_SMC64: ret = trusty_ffa_mem_share(client, w1, w2, x3, w4, FFA_MTD_FLAG_TYPE_SHARE_MEMORY, handle); break; - case SMC_FC_FFA_MEM_RETRIEVE_REQ: + case FFA_MEM_RETRIEVE_REQ_SMC32: ret = trusty_ffa_mem_retrieve_req(client, w1, w2, w3, w4, handle); break; - case SMC_FC64_FFA_MEM_RETRIEVE_REQ: + case FFA_MEM_RETRIEVE_REQ_SMC64: ret = trusty_ffa_mem_retrieve_req(client, w1, w2, x3, w4, handle); break; - case SMC_FC_FFA_MEM_RELINQUISH: + case FFA_MEM_RELINQUISH: ret = trusty_ffa_mem_relinquish(client); break; - case SMC_FC_FFA_MEM_RECLAIM: + case FFA_MEM_RECLAIM: ret = trusty_ffa_mem_reclaim(client, w1, w2, w3); break; - case SMC_FC_FFA_MEM_FRAG_RX: + case FFA_MEM_FRAG_RX: ret = trusty_ffa_mem_frag_rx(client, w1, w2, w3, w4, handle); break; - case SMC_FC_FFA_MEM_FRAG_TX: + case FFA_MEM_FRAG_TX: ret = trusty_ffa_mem_frag_tx(client, w1, w2, w3, w4, handle); break; @@ -1131,10 +1133,10 @@ uintptr_t spmd_ffa_smc_handler(uint32_t smc_fid, return ret; } NOTICE("%s(0x%x) failed %ld\n", __func__, smc_fid, ret); - SMC_RET8(handle, SMC_FC_FFA_ERROR, 0, to_spi_err(ret), 0, 0, 0, + SMC_RET8(handle, FFA_ERROR, 0, to_spi_err(ret), 0, 0, 0, 0, 0); } else { - SMC_RET8(handle, SMC_FC_FFA_SUCCESS, 0, ret_reg2, ret_reg3, 0, + SMC_RET8(handle, FFA_SUCCESS_SMC32, 0, ret_reg2, ret_reg3, 0, 0, 0, 0); } } -- cgit v1.2.3