mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 11:26:02 +09:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user