Commit d744b6f5 authored by Anes Hadziahmetagic's avatar Anes Hadziahmetagic Committed by Siva Durga Prasad Paladugu
Browse files

zynqmp: pm: Implement pm_get_node_status API function



pm_get_node_status API function returns 3 values:
-status: Current power state of the node
-requirements: Current requirements for the node
-usage: Current usage of the node
The last two values only apply to slave nodes.
Signed-off-by: default avatarAnes Hadziahmetagic <anes.hadziahmetagic@aggios.com>
Signed-off-by: default avatarFilip Drazic <filip.drazic@aggios.com>
Acked-by: default avatarWill Wong <willw@xilinx.com>
parent b6ceca43
......@@ -342,18 +342,22 @@ enum pm_ret_status pm_set_configuration(unsigned int phys_addr)
}
/**
* pm_get_node_status() - PM call to request a node's current power state
* @nid Node id of the slave
* pm_get_node_status() - PM call to request a node's current status
* @nid Node id
* @ret_buff Buffer for the return values:
* [0] - Current power state of the node
* [1] - Current requirements for the node (slave nodes only)
* [2] - Current usage status for the node (slave nodes only)
*
* @return Returns status, either success or error+reason
*/
enum pm_ret_status pm_get_node_status(enum pm_node_id nid)
enum pm_ret_status pm_get_node_status(enum pm_node_id nid,
uint32_t *ret_buff)
{
/* TODO: Add power state argument!! */
uint32_t payload[PAYLOAD_ARG_CNT];
PM_PACK_PAYLOAD2(payload, PM_GET_NODE_STATUS, nid);
return pm_ipi_send(primary_proc, payload);
return pm_ipi_send_sync(primary_proc, payload, ret_buff, 3);
}
/**
......
......@@ -76,7 +76,8 @@ enum pm_ret_status pm_set_max_latency(enum pm_node_id nid,
/* Miscellaneous API functions */
enum pm_ret_status pm_get_api_version(unsigned int *version);
enum pm_ret_status pm_set_configuration(unsigned int phys_addr);
enum pm_ret_status pm_get_node_status(enum pm_node_id node);
enum pm_ret_status pm_get_node_status(enum pm_node_id node,
uint32_t *ret_buff);
enum pm_ret_status pm_register_notifier(enum pm_node_id nid,
unsigned int event,
unsigned int wake,
......
......@@ -176,8 +176,13 @@ 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_GET_NODE_STATUS:
ret = pm_get_node_status(pm_arg[0]);
SMC_RET1(handle, (uint64_t)ret);
{
uint32_t buff[3];
ret = pm_get_node_status(pm_arg[0], buff);
SMC_RET2(handle, (uint64_t)ret | ((uint64_t)buff[0] << 32),
(uint64_t)buff[1] | ((uint64_t)buff[2] << 32));
}
case PM_GET_OP_CHARACTERISTIC:
{
......
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