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

plat: xilinx: zynqmp: Add GET_CALLBACK_DATA function



Add GET_CALLBACK_DATA function again as now Linux driver
supports both mailbox as well as ISR method.
Signed-off-by: default avatarRajan Vaja <rajan.vaja@xilinx.com>
Signed-off-by: default avatarJolly Shah <jolly.shah@xilinx.com>
Change-Id: Ieb99d61976e1cb718fcd1021d9cf4958e7556c81
parent 20fdf0b0
/* /*
* Copyright (c) 2013-2018, ARM Limited and Contributors. All rights reserved. * Copyright (c) 2013-2020, ARM Limited and Contributors. All rights reserved.
* *
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
...@@ -629,6 +629,22 @@ enum pm_ret_status pm_aes_engine(uint32_t address_high, ...@@ -629,6 +629,22 @@ enum pm_ret_status pm_aes_engine(uint32_t address_high,
return pm_ipi_send_sync(primary_proc, payload, value, 1); return pm_ipi_send_sync(primary_proc, payload, value, 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 Pin from firmware * pm_pinctrl_request() - Request Pin from firmware
* @pin Pin number to request * @pin Pin number to request
......
/* /*
* Copyright (c) 2013-2018, ARM Limited and Contributors. All rights reserved. * Copyright (c) 2013-2020, ARM Limited and Contributors. All rights reserved.
* *
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
...@@ -116,6 +116,7 @@ enum pm_ret_status pm_secure_rsaaes(uint32_t address_high, ...@@ -116,6 +116,7 @@ enum pm_ret_status pm_secure_rsaaes(uint32_t address_high,
uint32_t size, uint32_t size,
uint32_t flags); uint32_t flags);
unsigned int pm_get_shutdown_scope(void); unsigned int pm_get_shutdown_scope(void);
void pm_get_callbackdata(uint32_t *data, size_t count);
enum pm_ret_status pm_pinctrl_request(unsigned int pin); enum pm_ret_status pm_pinctrl_request(unsigned int pin);
enum pm_ret_status pm_pinctrl_release(unsigned int pin); enum pm_ret_status pm_pinctrl_release(unsigned int pin);
enum pm_ret_status pm_pinctrl_get_function(unsigned int pin, enum pm_ret_status pm_pinctrl_get_function(unsigned int pin,
......
/* /*
* Copyright (c) 2013-2018, ARM Limited and Contributors. All rights reserved. * Copyright (c) 2013-2020, ARM Limited and Contributors. All rights reserved.
* *
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,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_SET_SUSPEND_MODE 0xa02 #define PM_SET_SUSPEND_MODE 0xa02
#define PM_GET_TRUSTZONE_VERSION 0xa03 #define PM_GET_TRUSTZONE_VERSION 0xa03
...@@ -412,6 +413,16 @@ uint64_t pm_smc_handler(uint32_t smc_fid, uint64_t x1, uint64_t x2, uint64_t x3, ...@@ -412,6 +413,16 @@ uint64_t pm_smc_handler(uint32_t smc_fid, uint64_t x1, uint64_t x2, uint64_t x3,
pm_arg[3]); pm_arg[3]);
SMC_RET1(handle, (uint64_t)ret); SMC_RET1(handle, (uint64_t)ret);
case PM_GET_CALLBACK_DATA:
{
uint32_t result[4] = {0};
pm_get_callbackdata(result, (sizeof(result)/sizeof(uint32_t)));
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