Commit 27722ac1 authored by Filip Drazic's avatar Filip Drazic Committed by Siva Durga Prasad Paladugu
Browse files

zynqmp: pm: Implement PM_INIT_FINALIZE PM API call



The PM_INIT_FINALIZE PM API is required to inform the PFW that APU is
done with requesting nodes and that not-requested nodes can be powered
down. If PM is not enabled, this call will never be made and PFW will
never power down any of the nodes which APU can use.
Signed-off-by: default avatarFilip Drazic <filip.drazic@aggios.com>
parent 04849672
......@@ -338,6 +338,22 @@ enum pm_ret_status pm_set_configuration(unsigned int phys_addr)
return PM_RET_ERROR_NOTSUPPORTED;
}
/**
* pm_init_finalize() - Call to notify PMU firmware that master has power
* management enabled and that it has finished its
* initialization
*
* @return Status returned by the PMU firmware
*/
enum pm_ret_status pm_init_finalize(void)
{
uint32_t payload[PAYLOAD_ARG_CNT];
/* Send request to the PMU */
PM_PACK_PAYLOAD1(payload, PM_INIT_FINALIZE);
return pm_ipi_send_sync(primary_proc, payload, NULL, 0);
}
/**
* pm_get_node_status() - PM call to request a node's current status
* @nid Node id
......
......@@ -76,6 +76,7 @@ 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_init_finalize(void);
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,
......
......@@ -183,6 +183,10 @@ uint64_t pm_smc_handler(uint32_t smc_fid, uint64_t x1, uint64_t x2, uint64_t x3,
ret = pm_set_configuration(pm_arg[0]);
SMC_RET1(handle, (uint64_t)ret);
case PM_INIT_FINALIZE:
ret = pm_init_finalize();
SMC_RET1(handle, (uint64_t)ret);
case PM_GET_NODE_STATUS:
{
uint32_t buff[3];
......
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