diff options
author | Achin Gupta <achin.gupta@arm.com> | 2019-10-11 15:49:00 +0100 |
---|---|---|
committer | Achin Gupta <achin.gupta@arm.com> | 2019-10-28 14:23:35 +0000 |
commit | af3fef474909018e1f6ed3631606af128f350d5d (patch) | |
tree | 5be4d5c7aa25fbdea2264c9847c2d112124c5e34 | |
parent | 383b7c526e4304f110239e4ba945f479484f417a (diff) | |
download | trusted-firmware-a-af3fef474909018e1f6ed3631606af128f350d5d.tar.gz |
SPMD: hook SPMD into standard services framework
This patch adds support to initialise the SPM dispatcher as a standard secure
service. It also registers a handler for SPCI SMCs exported by the SPM
dispatcher.
Signed-off-by: Achin Gupta <achin.gupta@arm.com>
-rw-r--r-- | services/std_svc/std_svc_setup.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/services/std_svc/std_svc_setup.c b/services/std_svc/std_svc_setup.c index 1d80fa3433..d38204ef36 100644 --- a/services/std_svc/std_svc_setup.c +++ b/services/std_svc/std_svc_setup.c @@ -14,7 +14,11 @@ #include <lib/psci/psci.h> #include <lib/runtime_instr.h> #include <services/sdei.h> +#if ENABLE_SPMD +#include <services/spmd_svc.h> +#else #include <services/spm_svc.h> +#endif #include <services/std_svc.h> #include <smccc_helpers.h> #include <tools_share/uuid.h> @@ -51,6 +55,12 @@ static int32_t std_svc_setup(void) } #endif +#if ENABLE_SPMD + if (spmd_setup() != 0) { + ret = 1; + } +#endif + #if SDEI_SUPPORT /* SDEI initialisation */ sdei_init(); @@ -114,6 +124,17 @@ static uintptr_t std_svc_smc_handler(uint32_t smc_fid, } #endif +#if ENABLE_SPMD + /* + * Dispatch SPCI calls to the SPCI SMC handler implemented by the SPM + * dispatcher and return its return value + */ + if (is_spci_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, |