From 4de081ad8ef79596293b299c05c2c0c67e8f2bf4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= Date: Thu, 11 Jun 2015 19:34:28 -0700 Subject: trusty: Select api version Select api version in probe, and store it in trusty_state. This enables new return codes from trusty, and will later be used to enable a nop stdcall that does not take smc_lock. Change-Id: Ib0c41b8b14e0638851d5236f83677c25507a2db6 Signed-off-by: Michael Ryleev --- include/linux/trusty/smcall.h | 19 +++++++++++++++++++ include/linux/trusty/trusty.h | 1 + 2 files changed, 20 insertions(+) (limited to 'include/linux') diff --git a/include/linux/trusty/smcall.h b/include/linux/trusty/smcall.h index a2be2e357..cdb4eccd7 100644 --- a/include/linux/trusty/smcall.h +++ b/include/linux/trusty/smcall.h @@ -78,6 +78,25 @@ #define SMC_FC_AARCH_SWITCH SMC_FASTCALL_NR (SMC_ENTITY_SECURE_MONITOR, 9) #define SMC_FC_GET_VERSION_STR SMC_FASTCALL_NR (SMC_ENTITY_SECURE_MONITOR, 10) +/** + * SMC_FC_API_VERSION - Find and select supported API version. + * + * @r1: Version supported by client. + * + * Returns version supported by trusty. + * + * If multiple versions are supported, the client should start by calling + * SMC_FC_API_VERSION with the largest version it supports. Trusty will then + * return a version it supports. If the client does not support the version + * returned by trusty and the version returned is less than the version + * requested, repeat the call with the largest supported version less than the + * last returned version. + * + * This call must be made before any calls that are affected by the api version. + */ +#define TRUSTY_API_VERSION_CURRENT (0) +#define SMC_FC_API_VERSION SMC_FASTCALL_NR (SMC_ENTITY_SECURE_MONITOR, 11) + /* TRUSTED_OS entity calls */ #define SMC_SC_VIRTIO_GET_DESCR SMC_STDCALL_NR(SMC_ENTITY_TRUSTED_OS, 20) #define SMC_SC_VIRTIO_START SMC_STDCALL_NR(SMC_ENTITY_TRUSTED_OS, 21) diff --git a/include/linux/trusty/trusty.h b/include/linux/trusty/trusty.h index d084d9d68..24fe2101a 100644 --- a/include/linux/trusty/trusty.h +++ b/include/linux/trusty/trusty.h @@ -56,6 +56,7 @@ int trusty_call_notifier_register(struct device *dev, int trusty_call_notifier_unregister(struct device *dev, struct notifier_block *n); const char *trusty_version_str_get(struct device *dev); +u32 trusty_get_api_version(struct device *dev); struct ns_mem_page_info { uint64_t attr; -- cgit v1.2.2