Commit 6af12286 authored by Tejas Patel's avatar Tejas Patel Committed by Manish Pandey
Browse files

plat: xilinx: versal: Add support of register notifier



Add support of register notifier.
Signed-off-by: default avatarTejas Patel <tejas.patel@xilinx.com>
Signed-off-by: default avatarRajan Vaja <rajan.vaja@xilinx.com>
Change-Id: I41ef4c63abcc9aee552790b843adb25a5fd0c23e
parent b6d7b3e9
...@@ -877,6 +877,7 @@ enum pm_ret_status pm_feature_check(uint32_t api_id, unsigned int *version) ...@@ -877,6 +877,7 @@ enum pm_ret_status pm_feature_check(uint32_t api_id, unsigned int *version)
case PM_FEATURE_CHECK: case PM_FEATURE_CHECK:
case PM_INIT_FINALIZE: case PM_INIT_FINALIZE:
case PM_SET_MAX_LATENCY: case PM_SET_MAX_LATENCY:
case PM_REGISTER_NOTIFIER:
*version = (PM_API_BASE_VERSION << 16); *version = (PM_API_BASE_VERSION << 16);
break; break;
case PM_LOAD_PDI: case PM_LOAD_PDI:
...@@ -962,3 +963,25 @@ enum pm_ret_status pm_set_max_latency(uint32_t device_id, uint32_t latency) ...@@ -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); 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);
}
...@@ -75,4 +75,6 @@ enum pm_ret_status pm_get_op_characteristic(uint32_t device_id, ...@@ -75,4 +75,6 @@ enum pm_ret_status pm_get_op_characteristic(uint32_t device_id,
enum pm_opchar_type type, enum pm_opchar_type type,
uint32_t *result); uint32_t *result);
enum pm_ret_status pm_set_max_latency(uint32_t device_id, uint32_t latency); 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 */ #endif /* PM_API_SYS_H */
...@@ -45,6 +45,7 @@ ...@@ -45,6 +45,7 @@
#define PM_GET_API_VERSION 1U #define PM_GET_API_VERSION 1U
#define PM_GET_DEVICE_STATUS 3U #define PM_GET_DEVICE_STATUS 3U
#define PM_GET_OP_CHARACTERISTIC 4U #define PM_GET_OP_CHARACTERISTIC 4U
#define PM_REGISTER_NOTIFIER 5U
#define PM_REQ_SUSPEND 6U #define PM_REQ_SUSPEND 6U
#define PM_SELF_SUSPEND 7U #define PM_SELF_SUSPEND 7U
#define PM_FORCE_POWERDOWN 8U #define PM_FORCE_POWERDOWN 8U
......
...@@ -338,6 +338,12 @@ uint64_t pm_smc_handler(uint32_t smc_fid, uint64_t x1, uint64_t x2, uint64_t x3, ...@@ -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); 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: default:
WARN("Unimplemented PM Service Call: 0x%x\n", smc_fid); WARN("Unimplemented PM Service Call: 0x%x\n", smc_fid);
SMC_RET1(handle, SMC_UNK); SMC_RET1(handle, SMC_UNK);
......
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