aboutsummaryrefslogtreecommitdiff
path: root/services/std_svc
diff options
context:
space:
mode:
authorOlivier Deprez <olivier.deprez@arm.com>2020-04-16 16:59:21 +0200
committerMax Shvetsov <maksims.svecovs@arm.com>2020-08-20 18:06:06 +0100
commitc2901419b54ae5334b666bc8f4fc35c36246daac (patch)
treef3fbae3383ff1db44fde120125af6e58f87cf4ee /services/std_svc
parenta334c4e6915d111ba48da60f898d4922c01a16b3 (diff)
downloadtrusted-firmware-a-c2901419b54ae5334b666bc8f4fc35c36246daac.tar.gz
SPMD: introduce SPMC to SPMD messages
FF-A interface to handle SPMC to SPMD direct messages requests. Signed-off-by: Olivier Deprez <olivier.deprez@arm.com> Signed-off-by: Max Shvetsov <maksims.svecovs@arm.com> Change-Id: Ia707a308c55561a31dcfa86e554ea1c9e23f862a
Diffstat (limited to 'services/std_svc')
-rw-r--r--services/std_svc/spmd/spmd_main.c13
-rw-r--r--services/std_svc/spmd/spmd_private.h11
2 files changed, 18 insertions, 6 deletions
diff --git a/services/std_svc/spmd/spmd_main.c b/services/std_svc/spmd/spmd_main.c
index 93a0203c5e..cdbb9ca6e4 100644
--- a/services/std_svc/spmd/spmd_main.c
+++ b/services/std_svc/spmd/spmd_main.c
@@ -322,8 +322,8 @@ static uint64_t spmd_smc_forward(uint32_t smc_fid,
uint64_t x4,
void *handle)
{
- uint32_t secure_state_in = (secure_origin) ? SECURE : NON_SECURE;
- uint32_t secure_state_out = (!secure_origin) ? SECURE : NON_SECURE;
+ unsigned int secure_state_in = (secure_origin) ? SECURE : NON_SECURE;
+ unsigned int secure_state_out = (!secure_origin) ? SECURE : NON_SECURE;
/* Save incoming security state */
cm_el1_sysregs_context_save(secure_state_in);
@@ -355,6 +355,15 @@ static uint64_t spmd_ffa_error_return(void *handle, int error_code)
FFA_PARAM_MBZ, FFA_PARAM_MBZ);
}
+/******************************************************************************
+ * spmd_is_spmc_message
+ *****************************************************************************/
+static bool spmd_is_spmc_message(unsigned int ep)
+{
+ return ((ffa_endpoint_destination(ep) == SPMD_DIRECT_MSG_ENDPOINT_ID)
+ && (ffa_endpoint_source(ep) == spmc_attrs.spmc_id));
+}
+
/*******************************************************************************
* This function handles all SMCs in the range reserved for FFA. Each call is
* either forwarded to the other security state or handled by the SPM dispatcher
diff --git a/services/std_svc/spmd/spmd_private.h b/services/std_svc/spmd/spmd_private.h
index e13a5f021c..7d5f47662e 100644
--- a/services/std_svc/spmd/spmd_private.h
+++ b/services/std_svc/spmd/spmd_private.h
@@ -55,11 +55,14 @@ typedef struct spmd_spm_core_context {
/*
* Reserve ID for NS physical FFA Endpoint.
*/
-#define FFA_NS_ENDPOINT_ID U(0)
+#define FFA_NS_ENDPOINT_ID U(0)
-/* Mask and shift to check valid secure FFA Endpoint ID. */
-#define SPMC_SECURE_ID_MASK U(1)
-#define SPMC_SECURE_ID_SHIFT U(15)
+/* Mask and shift to check valid secure FF-A Endpoint ID. */
+#define SPMC_SECURE_ID_MASK U(1)
+#define SPMC_SECURE_ID_SHIFT U(15)
+
+#define SPMD_DIRECT_MSG_ENDPOINT_ID U(FFA_ENDPOINT_ID_MAX - 1)
+#define SPMD_DIRECT_MSG_SET_ENTRY_POINT U(1)
/* Functions used to enter/exit SPMC synchronously */
uint64_t spmd_spm_core_sync_entry(spmd_spm_core_context_t *ctx);