From fcf6f469318d693a024d42ae2d0f4afb26c1e85d Mon Sep 17 00:00:00 2001 From: Tanmay Shah Date: Tue, 14 Dec 2021 04:53:40 -0800 Subject: [PATCH] feat(versal): add SMCCC call TF_A_PM_REGISTER_SGI This call is used to register and reset SGI interrupt. Before this functionality was performed using IOCTL_REGISTER_SGI pm_ioctl EEMI call. It's not correct use of PM_IOCTL as it is not EEMI functionality. Instead this new SMCCC call will be handled by TF-A specific handler. Change-Id: If2408af38b889d29a5c584e8eec5f1672eab4fb5 Signed-off-by: Tanmay Shah --- plat/xilinx/versal/pm_service/pm_defs.h | 1 + plat/xilinx/versal/pm_service/pm_svc_main.c | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/plat/xilinx/versal/pm_service/pm_defs.h b/plat/xilinx/versal/pm_service/pm_defs.h index 378565049..92061208b 100644 --- a/plat/xilinx/versal/pm_service/pm_defs.h +++ b/plat/xilinx/versal/pm_service/pm_defs.h @@ -35,6 +35,7 @@ #define PM_GET_CALLBACK_DATA 0xa01U #define PM_GET_TRUSTZONE_VERSION 0xa03U +#define TF_A_PM_REGISTER_SGI 0xa04U /* PM API Versions */ #define PM_API_BASE_VERSION 1U diff --git a/plat/xilinx/versal/pm_service/pm_svc_main.c b/plat/xilinx/versal/pm_service/pm_svc_main.c index f779ad78b..24b68e7ef 100644 --- a/plat/xilinx/versal/pm_service/pm_svc_main.c +++ b/plat/xilinx/versal/pm_service/pm_svc_main.c @@ -237,6 +237,18 @@ static uintptr_t TF_A_specific_handler(uint32_t api_id, uint32_t *pm_arg, { switch (api_id) { + case TF_A_PM_REGISTER_SGI: + { + int ret; + + ret = pm_register_sgi(pm_arg[0], pm_arg[1]); + if (ret != 0) { + SMC_RET1(handle, (uint32_t)PM_RET_ERROR_ARGS); + } + + SMC_RET1(handle, (uint32_t)PM_RET_SUCCESS); + } + case PM_GET_CALLBACK_DATA: { uint32_t result[4] = {0};