From ad4b667d3ba7ece4cf28106aef6f91259b5b06ee Mon Sep 17 00:00:00 2001 From: Ronak Jain Date: Wed, 22 Feb 2023 04:28:02 -0800 Subject: [PATCH] fix(zynqmp): add bitmask for get_op_char API As per the current functionality, there are a couple of types like PM_OPCHAR_TYPE_TEMP, PM_OPCHAR_TYPE_POWER and PM_OPCHAR_TYPE_LATENCY for the PM_GET_OP_CHARACTERISTIC EEMI API which is mismatched across the Versal and ZynqMP platforms. So added the bitmask functionality for PM_GET_OP_CHARACTERISTIC API in feature check in the firmware and as part of that the firmware fill up payload[1] with the bitmask value of supported types of the PM_GET_OP_CHARACTERISTIC EEMI API but from TF-A based on the current codebase it is just returning the version. So filling up the bitmask buffer which is received from the firmware and returned the same to the user. Signed-off-by: Ronak Jain Change-Id: I2c55f3e902a5f89eed899e99a97ad9b3f0a12796 --- plat/xilinx/zynqmp/pm_service/pm_api_sys.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/plat/xilinx/zynqmp/pm_service/pm_api_sys.c b/plat/xilinx/zynqmp/pm_service/pm_api_sys.c index 63916b883..6965f4be7 100644 --- a/plat/xilinx/zynqmp/pm_service/pm_api_sys.c +++ b/plat/xilinx/zynqmp/pm_service/pm_api_sys.c @@ -923,14 +923,16 @@ enum pm_ret_status pm_feature_check(uint32_t api_id, uint32_t *version, *version = ret_payload[0]; /* Update IOCTL bit mask which are implemented in ATF */ - if (api_id == PM_IOCTL) { + if ((api_id == PM_IOCTL) || (api_id == PM_GET_OP_CHARACTERISTIC)) { if (len < 2) { return PM_RET_ERROR_ARGS; } bit_mask[0] = ret_payload[1]; bit_mask[1] = ret_payload[2]; - /* Get IOCTL's implemented by ATF */ - status = atf_ioctl_bitmask(bit_mask); + if (api_id == PM_IOCTL) { + /* Get IOCTL's implemented by ATF */ + status = atf_ioctl_bitmask(bit_mask); + } } else { /* Requires for MISRA */ } -- 2.39.5