diff options
-rw-r--r-- | plat/xilinx/versal/pm_service/pm_api_sys.c | 23 | ||||
-rw-r--r-- | plat/xilinx/versal/pm_service/pm_api_sys.h | 2 | ||||
-rw-r--r-- | plat/xilinx/versal/pm_service/pm_defs.h | 1 | ||||
-rw-r--r-- | plat/xilinx/versal/pm_service/pm_svc_main.c | 6 |
4 files changed, 32 insertions, 0 deletions
diff --git a/plat/xilinx/versal/pm_service/pm_api_sys.c b/plat/xilinx/versal/pm_service/pm_api_sys.c index fd0581efa..df6c9af49 100644 --- a/plat/xilinx/versal/pm_service/pm_api_sys.c +++ b/plat/xilinx/versal/pm_service/pm_api_sys.c @@ -877,6 +877,7 @@ enum pm_ret_status pm_feature_check(uint32_t api_id, unsigned int *version) case PM_FEATURE_CHECK: case PM_INIT_FINALIZE: case PM_SET_MAX_LATENCY: + case PM_REGISTER_NOTIFIER: *version = (PM_API_BASE_VERSION << 16); break; case PM_LOAD_PDI: @@ -962,3 +963,25 @@ enum pm_ret_status pm_set_max_latency(uint32_t device_id, uint32_t latency) return pm_ipi_send_sync(primary_proc, payload, NULL, 0); } + +/** + * pm_register_notifier() - PM call to register a subsystem to be notified + * about the device event + * @device_id Device ID for the Node to which the event is related + * @event Event in question + * @wake Wake subsystem upon capturing the event if value 1 + * @enable Enable the registration for value 1, disable for value 0 + * + * @return Returns status, either success or error+reason + */ +enum pm_ret_status pm_register_notifier(uint32_t device_id, uint32_t event, + uint32_t wake, uint32_t enable) +{ + uint32_t payload[PAYLOAD_ARG_CNT]; + + /* Send request to the PMC */ + PM_PACK_PAYLOAD5(payload, LIBPM_MODULE_ID, PM_REGISTER_NOTIFIER, + device_id, event, wake, enable); + + return pm_ipi_send_sync(primary_proc, payload, NULL, 0); +} diff --git a/plat/xilinx/versal/pm_service/pm_api_sys.h b/plat/xilinx/versal/pm_service/pm_api_sys.h index 72f00763f..84867b638 100644 --- a/plat/xilinx/versal/pm_service/pm_api_sys.h +++ b/plat/xilinx/versal/pm_service/pm_api_sys.h @@ -75,4 +75,6 @@ enum pm_ret_status pm_get_op_characteristic(uint32_t device_id, enum pm_opchar_type type, uint32_t *result); enum pm_ret_status pm_set_max_latency(uint32_t device_id, uint32_t latency); +enum pm_ret_status pm_register_notifier(uint32_t device_id, uint32_t event, + uint32_t wake, uint32_t enable); #endif /* PM_API_SYS_H */ diff --git a/plat/xilinx/versal/pm_service/pm_defs.h b/plat/xilinx/versal/pm_service/pm_defs.h index 5f59ba7cb..793f75009 100644 --- a/plat/xilinx/versal/pm_service/pm_defs.h +++ b/plat/xilinx/versal/pm_service/pm_defs.h @@ -45,6 +45,7 @@ #define PM_GET_API_VERSION 1U #define PM_GET_DEVICE_STATUS 3U #define PM_GET_OP_CHARACTERISTIC 4U +#define PM_REGISTER_NOTIFIER 5U #define PM_REQ_SUSPEND 6U #define PM_SELF_SUSPEND 7U #define PM_FORCE_POWERDOWN 8U diff --git a/plat/xilinx/versal/pm_service/pm_svc_main.c b/plat/xilinx/versal/pm_service/pm_svc_main.c index f2c248e15..2ed6d2701 100644 --- a/plat/xilinx/versal/pm_service/pm_svc_main.c +++ b/plat/xilinx/versal/pm_service/pm_svc_main.c @@ -338,6 +338,12 @@ uint64_t pm_smc_handler(uint32_t smc_fid, uint64_t x1, uint64_t x2, uint64_t x3, SMC_RET1(handle, (uint64_t)ret); } + case PM_REGISTER_NOTIFIER: + { + ret = pm_register_notifier(pm_arg[0], pm_arg[1], pm_arg[2], pm_arg[3]); + SMC_RET1(handle, (uint64_t)ret); + } + default: WARN("Unimplemented PM Service Call: 0x%x\n", smc_fid); SMC_RET1(handle, SMC_UNK); |