diff options
Diffstat (limited to 'services/std_svc/std_svc_setup.c')
-rw-r--r-- | services/std_svc/std_svc_setup.c | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/services/std_svc/std_svc_setup.c b/services/std_svc/std_svc_setup.c index 7787a2fa2..23f13ab82 100644 --- a/services/std_svc/std_svc_setup.c +++ b/services/std_svc/std_svc_setup.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2019, ARM Limited and Contributors. All rights reserved. + * Copyright (c) 2014-2021, ARM Limited and Contributors. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ @@ -15,7 +15,9 @@ #include <lib/runtime_instr.h> #include <services/sdei.h> #include <services/spm_mm_svc.h> +#include <services/spmd_svc.h> #include <services/std_svc.h> +#include <services/trng_svc.h> #include <smccc_helpers.h> #include <tools_share/uuid.h> @@ -51,11 +53,19 @@ static int32_t std_svc_setup(void) } #endif +#if defined(SPD_spmd) + if (spmd_setup() != 0) { + ret = 1; + } +#endif + #if SDEI_SUPPORT /* SDEI initialisation */ sdei_init(); #endif + trng_setup(); + return ret; } @@ -114,6 +124,17 @@ static uintptr_t std_svc_smc_handler(uint32_t smc_fid, } #endif +#if defined(SPD_spmd) + /* + * Dispatch FFA calls to the FFA SMC handler implemented by the SPM + * dispatcher and return its return value + */ + if (is_ffa_fid(smc_fid)) { + return spmd_smc_handler(smc_fid, x1, x2, x3, x4, cookie, + handle, flags); + } +#endif + #if SDEI_SUPPORT if (is_sdei_fid(smc_fid)) { return sdei_smc_handler(smc_fid, x1, x2, x3, x4, cookie, handle, @@ -121,6 +142,13 @@ static uintptr_t std_svc_smc_handler(uint32_t smc_fid, } #endif +#if TRNG_SUPPORT + if (is_trng_fid(smc_fid)) { + return trng_smc_handler(smc_fid, x1, x2, x3, x4, cookie, handle, + flags); + } +#endif + switch (smc_fid) { case ARM_STD_SVC_CALL_COUNT: /* |