OPTEE: check psci state when driver init

Kernel is running in secure mode on some platforms(e.g. rk3128/rv1108),
which has no secure OS to support TEE service.

Change-Id: I275413230b2a8ec3864fc5a5ba043a155d724ced
Signed-off-by: Zhang Zhijie <zhangzj@rock-chips.com>
This commit is contained in:
Zhang Zhijie
2018-06-15 11:19:13 +08:00
committed by Tao Huang
parent 9a7a78b838
commit 5d5542e8fe

View File

@@ -40,6 +40,10 @@
#include "tee_tz_priv.h"
#include "handle.h"
#ifdef CONFIG_ARM
#include <asm/psci.h>
#endif
#ifdef CONFIG_OUTER_CACHE
#undef CONFIG_OUTER_CACHE
#endif
@@ -1431,6 +1435,13 @@ static int __init tee_tz_init(void)
{
int rc;
#ifdef CONFIG_ARM
if (!psci_smp_available()) {
pr_info("tee: kernel is running in secure mode, tee service unavailable.\n");
return -EACCES;
}
#endif
pr_info("TEE armv7 Driver initialization\n");
#ifdef _TEE_DEBUG