diff options
author | Jérôme Forissier <jerome.forissier@linaro.org> | 2017-11-24 15:47:18 +0100 |
---|---|---|
committer | Jens Wiklander <jens.wiklander@linaro.org> | 2018-03-06 11:03:55 +0100 |
commit | 5c5f80307ab27c53b56569245a0b12f4e3b577de (patch) | |
tree | 9e1b207fd0bc22f73e0357aaf06bb97612b8f00b /drivers/tee | |
parent | 6e112de0427874500fb9c373595481653ae4078d (diff) | |
download | linux-5c5f80307ab27c53b56569245a0b12f4e3b577de.tar.bz2 |
tee: optee: report OP-TEE revision information
When the driver initializes, report the following information
about the OP-TEE OS:
- major and minor version,
- build identifier (if available).
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Matthias Brugger <mbruger@suse.com>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Diffstat (limited to 'drivers/tee')
-rw-r--r-- | drivers/tee/optee/core.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/drivers/tee/optee/core.c b/drivers/tee/optee/core.c index e9843c53fe31..e5fd5ed217da 100644 --- a/drivers/tee/optee/core.c +++ b/drivers/tee/optee/core.c @@ -356,6 +356,27 @@ static bool optee_msg_api_uid_is_optee_api(optee_invoke_fn *invoke_fn) return false; } +static void optee_msg_get_os_revision(optee_invoke_fn *invoke_fn) +{ + union { + struct arm_smccc_res smccc; + struct optee_smc_call_get_os_revision_result result; + } res = { + .result = { + .build_id = 0 + } + }; + + invoke_fn(OPTEE_SMC_CALL_GET_OS_REVISION, 0, 0, 0, 0, 0, 0, 0, + &res.smccc); + + if (res.result.build_id) + pr_info("revision %lu.%lu (%08lx)", res.result.major, + res.result.minor, res.result.build_id); + else + pr_info("revision %lu.%lu", res.result.major, res.result.minor); +} + static bool optee_msg_api_revision_is_compatible(optee_invoke_fn *invoke_fn) { union { @@ -547,6 +568,8 @@ static struct optee *optee_probe(struct device_node *np) return ERR_PTR(-EINVAL); } + optee_msg_get_os_revision(invoke_fn); + if (!optee_msg_api_revision_is_compatible(invoke_fn)) { pr_warn("api revision mismatch\n"); return ERR_PTR(-EINVAL); |