summaryrefslogtreecommitdiff
path: root/plat/xilinx
diff options
context:
space:
mode:
authorTejas Patel <tejas.patel@xilinx.com>2019-01-23 14:18:53 +0530
committerJolly Shah <jolly.shah@xilinx.com>2020-01-15 11:03:06 -0800
commit42cd77e386d4d0b847bcbbbe26fff315ed754087 (patch)
tree18d1a25ec518f4dcdbe4e33562d7a4fefe05d869 /plat/xilinx
parent25b1a91033ae3e4220c933333764c01c7a687c2d (diff)
xilinx: versal: Add set wakeup source API
Implement set wakeup source API to pass SMC call for set wakeup source to PLM (Platform Loader and Manager). Signed-off-by: Tejas Patel <tejas.patel@xilinx.com> Signed-off-by: Jolly Shah <jolly.shah@xilinx.com> Change-Id: I654ce07235c0fc7dfcb81bf98820153255f61537
Diffstat (limited to 'plat/xilinx')
-rw-r--r--plat/xilinx/versal/pm_service/pm_api_sys.c18
-rw-r--r--plat/xilinx/versal/pm_service/pm_api_sys.h2
-rw-r--r--plat/xilinx/versal/pm_service/pm_defs.h1
-rw-r--r--plat/xilinx/versal/pm_service/pm_svc_main.c4
4 files changed, 25 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 125134db8..5f3e30fff 100644
--- a/plat/xilinx/versal/pm_service/pm_api_sys.c
+++ b/plat/xilinx/versal/pm_service/pm_api_sys.c
@@ -694,3 +694,21 @@ enum pm_ret_status pm_api_ioctl(uint32_t device_id, uint32_t ioctl_id,
return pm_ipi_send_sync(primary_proc, payload, value, 1);
}
}
+
+/**
+ * pm_set_wakeup_source() - PM call to specify the wakeup source while suspended
+ * @target Device id of the targeted PU or subsystem
+ * @wkup_node Device id of the wakeup peripheral
+ * @enable Enable or disable the specified peripheral as wake source
+ *
+ * @return Returns status, either success or error+reason
+ */
+enum pm_ret_status pm_set_wakeup_source(uint32_t target, uint32_t wkup_device,
+ uint8_t enable)
+{
+ uint32_t payload[PAYLOAD_ARG_CNT];
+
+ PM_PACK_PAYLOAD4(payload, LIBPM_MODULE_ID, PM_SET_WAKEUP_SOURCE, target,
+ wkup_device, enable);
+ return pm_ipi_send(primary_proc, payload);
+}
diff --git a/plat/xilinx/versal/pm_service/pm_api_sys.h b/plat/xilinx/versal/pm_service/pm_api_sys.h
index ff3588236..16722e72b 100644
--- a/plat/xilinx/versal/pm_service/pm_api_sys.h
+++ b/plat/xilinx/versal/pm_service/pm_api_sys.h
@@ -26,6 +26,8 @@ enum pm_ret_status pm_req_suspend(uint32_t target,
unsigned int state);
enum pm_ret_status pm_req_wakeup(uint32_t target, uint32_t set_address,
uintptr_t address, uint8_t ack);
+enum pm_ret_status pm_set_wakeup_source(uint32_t target, uint32_t device_id,
+ uint8_t enable);
enum pm_ret_status pm_request_device(uint32_t device_id, uint32_t capabilities,
uint32_t qos, uint32_t ack);
enum pm_ret_status pm_release_device(uint32_t device_id);
diff --git a/plat/xilinx/versal/pm_service/pm_defs.h b/plat/xilinx/versal/pm_service/pm_defs.h
index bd7430433..7d69699ba 100644
--- a/plat/xilinx/versal/pm_service/pm_defs.h
+++ b/plat/xilinx/versal/pm_service/pm_defs.h
@@ -30,6 +30,7 @@
#define PM_FORCE_POWERDOWN 8U
#define PM_ABORT_SUSPEND 9U
#define PM_REQ_WAKEUP 10U
+#define PM_SET_WAKEUP_SOURCE 11U
#define PM_SYSTEM_SHUTDOWN 12U
#define PM_REQUEST_DEVICE 13U
#define PM_RELEASE_DEVICE 14U
diff --git a/plat/xilinx/versal/pm_service/pm_svc_main.c b/plat/xilinx/versal/pm_service/pm_svc_main.c
index 7f8e42fba..94d1438cf 100644
--- a/plat/xilinx/versal/pm_service/pm_svc_main.c
+++ b/plat/xilinx/versal/pm_service/pm_svc_main.c
@@ -111,6 +111,10 @@ uint64_t pm_smc_handler(uint32_t smc_fid, uint64_t x1, uint64_t x2, uint64_t x3,
ret = pm_req_wakeup(pm_arg[0], pm_arg[1], pm_arg[2], pm_arg[3]);
SMC_RET1(handle, (uint64_t)ret);
+ case PM_SET_WAKEUP_SOURCE:
+ ret = pm_set_wakeup_source(pm_arg[0], pm_arg[1], pm_arg[2]);
+ SMC_RET1(handle, (uint64_t)ret);
+
case PM_REQUEST_DEVICE:
ret = pm_request_device(pm_arg[0], pm_arg[1], pm_arg[2],
pm_arg[3]);