mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-19 02:54:24 +00:00
SPM: Remove remaining SMC interfaces
Also, add a disclaimer to explain that the current implementation of SPM is a prototype that is going to undergo a lot of rework. Change-Id: I303c1e61c51d9f286cc599fea565fc9ba5a996bf Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
This commit is contained in:
parent
e23ae073cb
commit
83a5d51279
4 changed files with 12 additions and 52 deletions
|
@ -7,6 +7,8 @@
|
||||||
#ifndef SPM_SVC_H
|
#ifndef SPM_SVC_H
|
||||||
#define SPM_SVC_H
|
#define SPM_SVC_H
|
||||||
|
|
||||||
|
#if SPM_DEPRECATED
|
||||||
|
|
||||||
#include <utils_def.h>
|
#include <utils_def.h>
|
||||||
|
|
||||||
#define SPM_VERSION_MAJOR U(0)
|
#define SPM_VERSION_MAJOR U(0)
|
||||||
|
@ -59,12 +61,16 @@
|
||||||
#define SPM_DENIED -3
|
#define SPM_DENIED -3
|
||||||
#define SPM_NO_MEMORY -5
|
#define SPM_NO_MEMORY -5
|
||||||
|
|
||||||
|
#endif /* SPM_DEPRECATED */
|
||||||
|
|
||||||
#ifndef __ASSEMBLY__
|
#ifndef __ASSEMBLY__
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
int32_t spm_setup(void);
|
int32_t spm_setup(void);
|
||||||
|
|
||||||
|
#if SPM_DEPRECATED
|
||||||
|
|
||||||
uint64_t spm_smc_handler(uint32_t smc_fid,
|
uint64_t spm_smc_handler(uint32_t smc_fid,
|
||||||
uint64_t x1,
|
uint64_t x1,
|
||||||
uint64_t x2,
|
uint64_t x2,
|
||||||
|
@ -77,6 +83,8 @@ uint64_t spm_smc_handler(uint32_t smc_fid,
|
||||||
/* Helper to enter a Secure Partition */
|
/* Helper to enter a Secure Partition */
|
||||||
uint64_t spm_sp_call(uint32_t smc_fid, uint64_t x1, uint64_t x2, uint64_t x3);
|
uint64_t spm_sp_call(uint32_t smc_fid, uint64_t x1, uint64_t x2, uint64_t x3);
|
||||||
|
|
||||||
|
#endif /* SPM_DEPRECATED */
|
||||||
|
|
||||||
#endif /* __ASSEMBLY__ */
|
#endif /* __ASSEMBLY__ */
|
||||||
|
|
||||||
#endif /* SPM_SVC_H */
|
#endif /* SPM_SVC_H */
|
||||||
|
|
3
services/std_svc/spm/README.rst
Normal file
3
services/std_svc/spm/README.rst
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
This is a prototype loosely based on the SPCI Alpha and SPRT pre-alpha
|
||||||
|
specifications. Any interface / platform API introduced for this is subject to
|
||||||
|
change as it evolves.
|
|
@ -18,7 +18,6 @@
|
||||||
#include <smccc_helpers.h>
|
#include <smccc_helpers.h>
|
||||||
#include <spinlock.h>
|
#include <spinlock.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <spm_svc.h>
|
|
||||||
#include <sprt_svc.h>
|
#include <sprt_svc.h>
|
||||||
#include <utils.h>
|
#include <utils.h>
|
||||||
#include <xlat_tables_v2.h>
|
#include <xlat_tables_v2.h>
|
||||||
|
@ -356,53 +355,3 @@ int32_t spm_setup(void)
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* Secure Partition Manager SMC handler.
|
|
||||||
******************************************************************************/
|
|
||||||
uint64_t spm_smc_handler(uint32_t smc_fid,
|
|
||||||
uint64_t x1,
|
|
||||||
uint64_t x2,
|
|
||||||
uint64_t x3,
|
|
||||||
uint64_t x4,
|
|
||||||
void *cookie,
|
|
||||||
void *handle,
|
|
||||||
uint64_t flags)
|
|
||||||
{
|
|
||||||
unsigned int ns;
|
|
||||||
|
|
||||||
/* Determine which security state this SMC originated from */
|
|
||||||
ns = is_caller_non_secure(flags);
|
|
||||||
|
|
||||||
if (ns == SMC_FROM_SECURE) {
|
|
||||||
|
|
||||||
/* Handle SMCs from Secure world. */
|
|
||||||
|
|
||||||
assert(handle == cm_get_context(SECURE));
|
|
||||||
|
|
||||||
/* Make next ERET jump to S-EL0 instead of S-EL1. */
|
|
||||||
cm_set_elr_spsr_el3(SECURE, read_elr_el1(), read_spsr_el1());
|
|
||||||
|
|
||||||
switch (smc_fid) {
|
|
||||||
|
|
||||||
case SPM_VERSION_AARCH32:
|
|
||||||
SMC_RET1(handle, SPM_VERSION_COMPILED);
|
|
||||||
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
|
|
||||||
/* Handle SMCs from Non-secure world. */
|
|
||||||
|
|
||||||
assert(handle == cm_get_context(NON_SECURE));
|
|
||||||
|
|
||||||
switch (smc_fid) {
|
|
||||||
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
SMC_RET1(handle, SMC_UNK);
|
|
||||||
}
|
|
||||||
|
|
|
@ -102,7 +102,7 @@ static uintptr_t std_svc_smc_handler(uint32_t smc_fid,
|
||||||
SMC_RET1(handle, ret);
|
SMC_RET1(handle, ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if ENABLE_SPM
|
#if ENABLE_SPM && SPM_DEPRECATED
|
||||||
/*
|
/*
|
||||||
* Dispatch SPM calls to SPM SMC handler and return its return
|
* Dispatch SPM calls to SPM SMC handler and return its return
|
||||||
* value
|
* value
|
||||||
|
|
Loading…
Add table
Reference in a new issue