aboutsummaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorAchin Gupta <achin.gupta@arm.com>2019-10-11 15:49:00 +0100
committerMax Shvetsov <maksims.svecovs@arm.com>2020-02-10 14:09:21 +0000
commit2a7b403de55705de7354cf4077064ef857c31ce2 (patch)
treee63dd15a316e22dbf69701d34b0fa63632f33c14 /services
parentbdd2596d42f1e96f0135be23d2bd936cc7eb30e5 (diff)
downloadplatform_external_arm-trusted-firmware-2a7b403de55705de7354cf4077064ef857c31ce2.tar.gz
platform_external_arm-trusted-firmware-2a7b403de55705de7354cf4077064ef857c31ce2.tar.bz2
platform_external_arm-trusted-firmware-2a7b403de55705de7354cf4077064ef857c31ce2.zip
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> Signed-off-by: Artsem Artsemenka <artsem.artsemenka@arm.com> Change-Id: I2183adf826d08ff3fee9aee75f021021162b6477
Diffstat (limited to 'services')
-rw-r--r--services/std_svc/std_svc_setup.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/services/std_svc/std_svc_setup.c b/services/std_svc/std_svc_setup.c
index 7787a2fa2..895fd292f 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-2020, ARM Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -15,6 +15,7 @@
#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 <smccc_helpers.h>
#include <tools_share/uuid.h>
@@ -51,6 +52,12 @@ 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();
@@ -114,6 +121,17 @@ static uintptr_t std_svc_smc_handler(uint32_t smc_fid,
}
#endif
+#if defined(SPD_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,