]> git.baikalelectronics.ru Git - arm-tf.git/commitdiff
feat(versal): add SMCCC call TF_A_PM_REGISTER_SGI
authorTanmay Shah <tanmay.shah@xilinx.com>
Tue, 14 Dec 2021 12:53:40 +0000 (04:53 -0800)
committerTanmay <tanmay.shah@xilinx.com>
Thu, 12 May 2022 18:29:41 +0000 (20:29 +0200)
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 <tanmay.shah@xilinx.com>
plat/xilinx/versal/pm_service/pm_defs.h
plat/xilinx/versal/pm_service/pm_svc_main.c

index 378565049fe2d57c0962de6d2da0ad5b63e76ffa..92061208b9bf48192c90bc6d5cbcbebc7b4a1e25 100644 (file)
@@ -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
index f779ad78b4ac9dd932196dd591c91ec3fdf57e49..24b68e7efc11a49444e2559778e2210b73d9a87c 100644 (file)
@@ -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};