Commit 9c3c5e07 authored by Tejas Patel's avatar Tejas Patel Committed by Jolly Shah
Browse files

xilinx: versal: Implement reset related PM APIs



Implement below reset related APIs:
  - Reset assert
  - Get reset status

Signed-off-by: default avatarTejas Patel <tejas.patel@xilinx.com>
Signed-off-by: default avatarJolly Shah <jolly.shah@xilinx.com>
Change-Id: Id42c9d3950a0d69125cb0eab79b75e5d22674f14
parent cf1e56a4
......@@ -235,3 +235,38 @@ enum pm_ret_status pm_get_device_status(uint32_t device_id, uint32_t *response)
return pm_ipi_send_sync(primary_proc, payload, response, 3);
}
/**
* pm_reset_assert() - Assert/De-assert reset
* @reset Reset ID
* @assert Assert (1) or de-assert (0)
*
* @return Returns status, either success or error+reason
*/
enum pm_ret_status pm_reset_assert(uint32_t reset, bool assert)
{
uint32_t payload[PAYLOAD_ARG_CNT];
/* Send request to the PMC */
PM_PACK_PAYLOAD3(payload, LIBPM_MODULE_ID, PM_RESET_ASSERT, reset,
assert);
return pm_ipi_send_sync(primary_proc, payload, NULL, 0);
}
/**
* pm_reset_get_status() - Get current status of a reset line
* @reset Reset ID
* @status Returns current status of selected reset ID
*
* @return Returns status, either success or error+reason
*/
enum pm_ret_status pm_reset_get_status(uint32_t reset, uint32_t *status)
{
uint32_t payload[PAYLOAD_ARG_CNT];
/* Send request to the PMC */
PM_PACK_PAYLOAD2(payload, LIBPM_MODULE_ID, PM_RESET_ASSERT, reset);
return pm_ipi_send_sync(primary_proc, payload, status, 1);
}
......@@ -30,5 +30,7 @@ enum pm_ret_status pm_release_device(uint32_t device_id);
enum pm_ret_status pm_set_requirement(uint32_t device_id, uint32_t capabilities,
uint32_t latency, uint32_t qos);
enum pm_ret_status pm_get_device_status(uint32_t device_id, uint32_t *response);
enum pm_ret_status pm_reset_assert(uint32_t reset, bool assert);
enum pm_ret_status pm_reset_get_status(uint32_t reset, uint32_t *status);
#endif /* PM_API_SYS_H */
......@@ -31,6 +31,8 @@
#define PM_REQUEST_DEVICE 13U
#define PM_RELEASE_DEVICE 14U
#define PM_SET_REQUIREMENT 15U
#define PM_RESET_ASSERT 17U
#define PM_RESET_GET_STATUS 18U
/*********************************************************************
* Enum definitions
......
Supports Markdown
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