Commit a41ca4c3 authored by Madhukar Pappireddy's avatar Madhukar Pappireddy Committed by TrustedFirmware Code Review
Browse files

Merge "spd: trusty: allow clients to retrieve service UUID" into integration

parents 959a0486 fc198188
/* /*
* Copyright (c) 2016-2017, ARM Limited and Contributors. All rights reserved. * Copyright (c) 2016-2017, ARM Limited and Contributors. All rights reserved.
* Copyright (c) 2020, NVIDIA Corporation. All rights reserved.
* *
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
...@@ -71,4 +72,11 @@ ...@@ -71,4 +72,11 @@
#define SMC_YC_VDEV_KICK_VQ SMC_YIELDCALL_NR(SMC_ENTITY_TRUSTED_OS, 24U) #define SMC_YC_VDEV_KICK_VQ SMC_YIELDCALL_NR(SMC_ENTITY_TRUSTED_OS, 24U)
#define SMC_YC_SET_ROT_PARAMS SMC_YIELDCALL_NR(SMC_ENTITY_TRUSTED_OS, 65535U) #define SMC_YC_SET_ROT_PARAMS SMC_YIELDCALL_NR(SMC_ENTITY_TRUSTED_OS, 65535U)
/*
* Standard Trusted OS Function IDs that fall under Trusted OS call range
* according to SMC calling convention
*/
#define SMC_FC64_GET_UUID SMC_FASTCALL64_NR(63U, 0xFF01U) /* Implementation UID */
#define SMC_FC_GET_UUID SMC_FASTCALL_NR(63U, 0xFF01U) /* Implementation.UID */
#endif /* SMCALL_H */ #endif /* SMCALL_H */
/* /*
* Copyright (c) 2016-2019, ARM Limited and Contributors. All rights reserved. * Copyright (c) 2016-2019, ARM Limited and Contributors. All rights reserved.
* Copyright (c) 2020, NVIDIA Corporation. All rights reserved.
* *
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
...@@ -16,11 +17,18 @@ ...@@ -16,11 +17,18 @@
#include <common/debug.h> #include <common/debug.h>
#include <common/runtime_svc.h> #include <common/runtime_svc.h>
#include <lib/el3_runtime/context_mgmt.h> #include <lib/el3_runtime/context_mgmt.h>
#include <lib/smccc.h>
#include <plat/common/platform.h> #include <plat/common/platform.h>
#include <tools_share/uuid.h>
#include "sm_err.h" #include "sm_err.h"
#include "smcall.h" #include "smcall.h"
/* Trusty UID: RFC-4122 compliant UUID version 4 */
DEFINE_SVC_UUID2(trusty_uuid,
0x40ee25f0, 0xa2bc, 0x304c, 0x8c, 0x4c,
0xa1, 0x73, 0xc5, 0x7d, 0x8a, 0xf1);
/* macro to check if Hypervisor is enabled in the HCR_EL2 register */ /* macro to check if Hypervisor is enabled in the HCR_EL2 register */
#define HYP_ENABLE_FLAG 0x286001U #define HYP_ENABLE_FLAG 0x286001U
...@@ -256,6 +264,11 @@ static uintptr_t trusty_smc_handler(uint32_t smc_fid, ...@@ -256,6 +264,11 @@ static uintptr_t trusty_smc_handler(uint32_t smc_fid,
SMC_RET1(handle, SMC_UNK); SMC_RET1(handle, SMC_UNK);
} else { } else {
switch (smc_fid) { switch (smc_fid) {
case SMC_FC64_GET_UUID:
case SMC_FC_GET_UUID:
/* provide the UUID for the service to the client */
SMC_UUID_RET(handle, trusty_uuid);
break;
case SMC_FC64_SET_FIQ_HANDLER: case SMC_FC64_SET_FIQ_HANDLER:
return trusty_set_fiq_handler(handle, x1, x2, x3); return trusty_set_fiq_handler(handle, x1, x2, x3);
case SMC_FC64_GET_FIQ_REGS: case SMC_FC64_GET_FIQ_REGS:
...@@ -263,6 +276,12 @@ static uintptr_t trusty_smc_handler(uint32_t smc_fid, ...@@ -263,6 +276,12 @@ static uintptr_t trusty_smc_handler(uint32_t smc_fid,
case SMC_FC_FIQ_EXIT: case SMC_FC_FIQ_EXIT:
return trusty_fiq_exit(handle, x1, x2, x3); return trusty_fiq_exit(handle, x1, x2, x3);
default: default:
/* Not all OENs greater than SMC_ENTITY_SECURE_MONITOR are supported */
if (SMC_ENTITY(smc_fid) > SMC_ENTITY_SECURE_MONITOR) {
VERBOSE("%s: unsupported SMC FID (0x%x)\n", __func__, smc_fid);
SMC_RET1(handle, SMC_UNK);
}
if (is_hypervisor_mode()) if (is_hypervisor_mode())
vmid = SMC_GET_GP(handle, CTX_GPREG_X7); vmid = SMC_GET_GP(handle, CTX_GPREG_X7);
...@@ -502,7 +521,7 @@ DECLARE_RT_SVC( ...@@ -502,7 +521,7 @@ DECLARE_RT_SVC(
trusty_fast, trusty_fast,
OEN_TOS_START, OEN_TOS_START,
SMC_ENTITY_SECURE_MONITOR, OEN_TOS_END,
SMC_TYPE_FAST, SMC_TYPE_FAST,
trusty_setup, trusty_setup,
trusty_smc_handler trusty_smc_handler
......
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