diff options
author | Tejas Patel <tejas.patel@xilinx.com> | 2019-01-08 01:46:38 -0800 |
---|---|---|
committer | Jolly Shah <jolly.shah@xilinx.com> | 2020-01-15 11:01:56 -0800 |
commit | 9c3c5e0737c91f5523f93797a2b38b9477f241b7 (patch) | |
tree | 0e43401faaaf3a038c17d6bdf4714591c58b4de2 /plat/xilinx | |
parent | cf1e56a4e74752f3ee7e2953ebd2ebb4ed8f9e20 (diff) |
xilinx: versal: Implement reset related PM APIs
Implement below reset related APIs:
- Reset assert
- Get reset status
Signed-off-by: Tejas Patel <tejas.patel@xilinx.com>
Signed-off-by: Jolly Shah <jolly.shah@xilinx.com>
Change-Id: Id42c9d3950a0d69125cb0eab79b75e5d22674f14
Diffstat (limited to 'plat/xilinx')
-rw-r--r-- | plat/xilinx/versal/pm_service/pm_api_sys.c | 35 | ||||
-rw-r--r-- | plat/xilinx/versal/pm_service/pm_api_sys.h | 2 | ||||
-rw-r--r-- | plat/xilinx/versal/pm_service/pm_defs.h | 2 |
3 files changed, 39 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 64c1e3503..51f1c2d4d 100644 --- a/plat/xilinx/versal/pm_service/pm_api_sys.c +++ b/plat/xilinx/versal/pm_service/pm_api_sys.c @@ -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); +} diff --git a/plat/xilinx/versal/pm_service/pm_api_sys.h b/plat/xilinx/versal/pm_service/pm_api_sys.h index 6e50e94b9..28e5504a7 100644 --- a/plat/xilinx/versal/pm_service/pm_api_sys.h +++ b/plat/xilinx/versal/pm_service/pm_api_sys.h @@ -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 */ diff --git a/plat/xilinx/versal/pm_service/pm_defs.h b/plat/xilinx/versal/pm_service/pm_defs.h index feaeee120..1b8871f7f 100644 --- a/plat/xilinx/versal/pm_service/pm_defs.h +++ b/plat/xilinx/versal/pm_service/pm_defs.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 |