Commit 89224531 authored by Rajan Vaja's avatar Rajan Vaja Committed by Jolly Shah
Browse files

plat: xilinx: versal: Add GET_CALLBACK_DATA function



Add GET_CALLBACK_DATA function to get IPI callback
data in Linux during init suspend callback.
Signed-off-by: default avatarRajan Vaja <rajan.vaja@xilinx.com>
Signed-off-by: default avatarJolly Shah <jolly.shah@xilinx.com>
Change-Id: Ieb60e561b5f656611f0702c43ba6a4296a012651
parent 0abf4bba
...@@ -312,6 +312,22 @@ enum pm_ret_status pm_reset_get_status(uint32_t reset, uint32_t *status) ...@@ -312,6 +312,22 @@ enum pm_ret_status pm_reset_get_status(uint32_t reset, uint32_t *status)
return pm_ipi_send_sync(primary_proc, payload, status, 1); return pm_ipi_send_sync(primary_proc, payload, status, 1);
} }
/**
* pm_get_callbackdata() - Read from IPI response buffer
* @data - array of PAYLOAD_ARG_CNT elements
*
* Read value from ipi buffer response buffer.
*/
void pm_get_callbackdata(uint32_t *data, size_t count)
{
/* Return if interrupt is not from PMU */
if (!pm_ipi_irq_status(primary_proc))
return;
pm_ipi_buff_read_callb(data, count);
pm_ipi_irq_clear(primary_proc);
}
/** /**
* pm_pinctrl_request() - Request a pin * pm_pinctrl_request() - Request a pin
* @pin Pin ID * @pin Pin ID
......
...@@ -36,6 +36,7 @@ enum pm_ret_status pm_set_requirement(uint32_t device_id, uint32_t capabilities, ...@@ -36,6 +36,7 @@ enum pm_ret_status pm_set_requirement(uint32_t device_id, uint32_t capabilities,
enum pm_ret_status pm_get_device_status(uint32_t device_id, uint32_t *response); 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_assert(uint32_t reset, bool assert);
enum pm_ret_status pm_reset_get_status(uint32_t reset, uint32_t *status); enum pm_ret_status pm_reset_get_status(uint32_t reset, uint32_t *status);
void pm_get_callbackdata(uint32_t *data, size_t count);
enum pm_ret_status pm_pinctrl_request(uint32_t pin); enum pm_ret_status pm_pinctrl_request(uint32_t pin);
enum pm_ret_status pm_pinctrl_release(uint32_t pin); enum pm_ret_status pm_pinctrl_release(uint32_t pin);
enum pm_ret_status pm_pinctrl_set_function(uint32_t pin, uint32_t function); enum pm_ret_status pm_pinctrl_set_function(uint32_t pin, uint32_t function);
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#include "pm_client.h" #include "pm_client.h"
#include "pm_ipi.h" #include "pm_ipi.h"
#define PM_GET_CALLBACK_DATA 0xa01
#define PM_GET_TRUSTZONE_VERSION 0xa03 #define PM_GET_TRUSTZONE_VERSION 0xa03
/* pm_up = true - UP, pm_up = false - DOWN */ /* pm_up = true - UP, pm_up = false - DOWN */
...@@ -163,6 +164,16 @@ uint64_t pm_smc_handler(uint32_t smc_fid, uint64_t x1, uint64_t x2, uint64_t x3, ...@@ -163,6 +164,16 @@ uint64_t pm_smc_handler(uint32_t smc_fid, uint64_t x1, uint64_t x2, uint64_t x3,
case PM_INIT_FINALIZE: case PM_INIT_FINALIZE:
SMC_RET1(handle, (uint64_t)PM_RET_SUCCESS); SMC_RET1(handle, (uint64_t)PM_RET_SUCCESS);
case PM_GET_CALLBACK_DATA:
{
uint32_t result[4] = {0};
pm_get_callbackdata(result, sizeof(result));
SMC_RET2(handle,
(uint64_t)result[0] | ((uint64_t)result[1] << 32),
(uint64_t)result[2] | ((uint64_t)result[3] << 32));
}
case PM_PINCTRL_REQUEST: case PM_PINCTRL_REQUEST:
ret = pm_pinctrl_request(pm_arg[0]); ret = pm_pinctrl_request(pm_arg[0]);
SMC_RET1(handle, (uint64_t)ret); SMC_RET1(handle, (uint64_t)ret);
......
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