summaryrefslogtreecommitdiff
path: root/services
diff options
context:
space:
mode:
authorVarun Wadekar <vwadekar@nvidia.com>2016-09-29 16:08:16 -0700
committerVarun Wadekar <vwadekar@nvidia.com>2017-03-06 08:47:53 -0800
commit0e1f9e3155c164f12910fe0f32f6cbf2d37177c8 (patch)
treece6fcca529ac10642f6a24139a4aff24d8422bd2 /services
parent26670c8260a03add519ee26d3da7ac2bce64ee1e (diff)
spd: trusty: add SET_ROT_PARAMS handling
If Trusty is not running on the device, then Verified Boot is not supported and the NS layer will fail gracefully later during boot. This patch just returns success for the case when Trusty is not running on the device and the bootloader issues SET_ROT_PARAMS call during boot, so that we can at least boot non-Android images. Change-Id: I40fc249983df80fb8cc5be5e4ce94c99d5b5f17d Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
Diffstat (limited to 'services')
-rw-r--r--services/spd/trusty/smcall.h1
-rw-r--r--services/spd/trusty/trusty.c12
2 files changed, 13 insertions, 0 deletions
diff --git a/services/spd/trusty/smcall.h b/services/spd/trusty/smcall.h
index a1d91e5a..2abcee62 100644
--- a/services/spd/trusty/smcall.h
+++ b/services/spd/trusty/smcall.h
@@ -94,5 +94,6 @@
#define SMC_SC_VDEV_RESET SMC_STDCALL_NR(SMC_ENTITY_TRUSTED_OS, 23)
#define SMC_SC_VDEV_KICK_VQ SMC_STDCALL_NR(SMC_ENTITY_TRUSTED_OS, 24)
+#define SMC_SC_SET_ROT_PARAMS SMC_STDCALL_NR(SMC_ENTITY_TRUSTED_OS, 65535)
#endif /* __LIB_SM_SMCALL_H */
diff --git a/services/spd/trusty/trusty.c b/services/spd/trusty/trusty.c
index 750c3b0c..976087c9 100644
--- a/services/spd/trusty/trusty.c
+++ b/services/spd/trusty/trusty.c
@@ -237,6 +237,18 @@ static uint64_t trusty_smc_handler(uint32_t smc_fid,
{
struct args ret;
uint32_t vmid = 0;
+ entry_point_info_t *ep_info = bl31_plat_get_next_image_ep_info(SECURE);
+
+ /*
+ * Return success for SET_ROT_PARAMS if Trusty is not present, as
+ * Verified Boot is not even supported and returning success here
+ * would not compromise the boot process.
+ */
+ if (!ep_info && (smc_fid == SMC_SC_SET_ROT_PARAMS)) {
+ SMC_RET1(handle, 0);
+ } else if (!ep_info) {
+ SMC_RET1(handle, SMC_UNK);
+ }
if (is_caller_secure(flags)) {
if (smc_fid == SMC_SC_NS_RETURN) {