aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Bonnici <marc.bonnici@arm.com>2021-08-26 19:22:58 +0100
committerMarc Bonnici <marc.bonnici@arm.com>2021-10-07 12:34:59 +0100
commit462cd25424065ff7fe1b033447e9470d09e4066e (patch)
tree82549012a9c48d5e68b8b8a3e419254a2759e0f2
parentdac40ee1af503b90e3ab9518f20e7d57ce967ef3 (diff)
downloadtrusted-firmware-a-462cd25424065ff7fe1b033447e9470d09e4066e.tar.gz
spmc: Support FFA_ID_GET
Allow a partition to retrieve it's own partition ID. Change-Id: Ic244ee1df5520bbb9952b15339613f6ad0ad852a Signed-off-by: Marc Bonnici <marc.bonnici@arm.com>
-rw-r--r--services/std_svc/spm/spmc/spmc_main.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/services/std_svc/spm/spmc/spmc_main.c b/services/std_svc/spm/spmc/spmc_main.c
index ef27c440b0..132640b965 100644
--- a/services/std_svc/spm/spmc/spmc_main.c
+++ b/services/std_svc/spm/spmc/spmc_main.c
@@ -770,6 +770,7 @@ static uint64_t ffa_features_handler(uint32_t smc_fid,
case FFA_ERROR:
case FFA_SUCCESS_SMC32:
case FFA_SUCCESS_SMC64:
+ case FFA_ID_GET:
case FFA_FEATURES:
case FFA_VERSION:
case FFA_MSG_SEND_DIRECT_REQ_SMC64:
@@ -818,6 +819,20 @@ static uint64_t ffa_version_handler(uint32_t smc_fid,
FFA_VERSION_MINOR);
}
+static uint64_t ffa_id_get_handler(uint32_t smc_fid,
+ bool secure_origin,
+ uint64_t x1,
+ uint64_t x2,
+ uint64_t x3,
+ uint64_t x4,
+ void *cookie,
+ void *handle,
+ uint64_t flags)
+{
+ spmc_sp_context_t *ctx = spmc_get_current_ctx(flags);
+ SMC_RET3(handle, FFA_SUCCESS_SMC32, 0x0, ctx->sp_id);
+}
+
/*******************************************************************************
* SPMC Helper Functions
******************************************************************************/
@@ -905,6 +920,8 @@ uint64_t spmc_smc_handler(uint32_t smc_fid,
uint64_t flags)
{
switch (smc_fid) {
+ case FFA_ID_GET:
+ return ffa_id_get_handler(smc_fid, secure_origin, x1, x2, x3, x4, cookie, handle, flags);
case FFA_FEATURES:
return ffa_features_handler(smc_fid, secure_origin, x1, x2, x3, x4, cookie, handle, flags);
case FFA_VERSION: