Commit 7bc05f52 authored by Mihir Joshi's avatar Mihir Joshi Committed by Varun Wadekar
Browse files

tlkd: support new TLK SMCs

This patch adds support to handle following TLK SMCs:
{TLK_SS_REGISTER_HANDLER, TLK_REGISTER_NS_DRAM_RANGES, TLK_SET_ROOT_OF_TRUST}

These SMCs need to be supported in ATF in order to forward them to
TLK. Otherwise, these functionalities won't work.

Brief:
TLK_SS_REGISTER_HANDLER: This SMC is issued by TLK Linux Driver to
set up secure storage buffers.

TLK_REGISTER_NS_DRAM_RANGES: Cboot performs this SMC during boot to
pass NS memory ranges to TLK.

TLK_SET_ROOT_OF_TRUST: Cboot performs this SMC during boot to pass
Verified Boot parameters to TLK.

Change-Id: I18af35f6dd6f510dfc22c1d1d1d07f643c7b82bc
Reviewed-on: https://git-master.nvidia.com/r/1643851

Signed-off-by: default avatarMihir Joshi <mihirj@nvidia.com>
parent d16b045c
...@@ -20,7 +20,9 @@ ...@@ -20,7 +20,9 @@
*/ */
#define TLK_REGISTER_LOGBUF TLK_TOS_YIELD_FID(0x1) #define TLK_REGISTER_LOGBUF TLK_TOS_YIELD_FID(0x1)
#define TLK_REGISTER_REQBUF TLK_TOS_YIELD_FID(0x2) #define TLK_REGISTER_REQBUF TLK_TOS_YIELD_FID(0x2)
#define TLK_REGISTER_NS_DRAM TLK_TOS_YIELD_FID(0x4) #define TLK_SS_REGISTER_HANDLER TLK_TOS_YIELD_FID(0x3)
#define TLK_REGISTER_NS_DRAM_RANGES TLK_TOS_YIELD_FID(0x4)
#define TLK_SET_ROOT_OF_TRUST TLK_TOS_YIELD_FID(0x5)
#define TLK_RESUME_FID TLK_TOS_YIELD_FID(0x100) #define TLK_RESUME_FID TLK_TOS_YIELD_FID(0x100)
#define TLK_SYSTEM_SUSPEND TLK_TOS_YIELD_FID(0xE001) #define TLK_SYSTEM_SUSPEND TLK_TOS_YIELD_FID(0xE001)
#define TLK_SYSTEM_RESUME TLK_TOS_YIELD_FID(0xE002) #define TLK_SYSTEM_RESUME TLK_TOS_YIELD_FID(0xE002)
......
...@@ -195,14 +195,18 @@ static uintptr_t tlkd_smc_handler(uint32_t smc_fid, ...@@ -195,14 +195,18 @@ static uintptr_t tlkd_smc_handler(uint32_t smc_fid,
* b. register shared memory with the SP for passing args * b. register shared memory with the SP for passing args
* required for maintaining sessions with the Trusted * required for maintaining sessions with the Trusted
* Applications. * Applications.
* c. register non-secure world's memory map with the OS * c. register shared persistent buffers for secure storage
* d. open/close sessions * d. register NS DRAM ranges passed by Cboot
* e. issue commands to the Trusted Apps * e. register Root of Trust parameters from Cboot for Verified Boot
* f. resume the preempted yielding SMC call. * f. open/close sessions
* g. issue commands to the Trusted Apps
* h. resume the preempted yielding SMC call.
*/ */
case TLK_REGISTER_LOGBUF: case TLK_REGISTER_LOGBUF:
case TLK_REGISTER_REQBUF: case TLK_REGISTER_REQBUF:
case TLK_REGISTER_NS_DRAM: case TLK_SS_REGISTER_HANDLER:
case TLK_REGISTER_NS_DRAM_RANGES:
case TLK_SET_ROOT_OF_TRUST:
case TLK_OPEN_TA_SESSION: case TLK_OPEN_TA_SESSION:
case TLK_CLOSE_TA_SESSION: case TLK_CLOSE_TA_SESSION:
case TLK_TA_LAUNCH_OP: case TLK_TA_LAUNCH_OP:
...@@ -400,6 +404,7 @@ static uintptr_t tlkd_smc_handler(uint32_t smc_fid, ...@@ -400,6 +404,7 @@ static uintptr_t tlkd_smc_handler(uint32_t smc_fid,
SMC_RET2(handle, TLK_VERSION_MAJOR, TLK_VERSION_MINOR); SMC_RET2(handle, TLK_VERSION_MAJOR, TLK_VERSION_MINOR);
default: default:
WARN("%s: Unhandled SMC: 0x%x\n", __func__, smc_fid);
break; break;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment