Browse Source

xilinx: versal: Add query data API

Add PM_QUERY_DATA API to pass query data
EEMI call from Linux to PLM .

Signed-off-by: Tejas Patel <tejas.patel@xilinx.com>
Signed-off-by: Jolly Shah <jolly.shah@xilinx.com>
Change-Id: I18735b72ab9cb62fb6cbc7582e77de6cb57f99b0
pull/1937/head
Tejas Patel 6 years ago
committed by Jolly Shah
parent
commit
1f71e4fbfe
  1. 20
      plat/xilinx/versal/pm_service/pm_api_sys.c
  2. 3
      plat/xilinx/versal/pm_service/pm_api_sys.h
  3. 1
      plat/xilinx/versal/pm_service/pm_defs.h
  4. 10
      plat/xilinx/versal/pm_service/pm_svc_main.c

20
plat/xilinx/versal/pm_service/pm_api_sys.c

@ -641,6 +641,26 @@ enum pm_ret_status pm_system_shutdown(uint32_t type, uint32_t subtype)
return pm_ipi_send_non_blocking(primary_proc, payload);
}
/**
* pm_query_data() - PM API for querying firmware data
* @qid The type of data to query
* @arg1 Argument 1 to requested query data call
* @arg2 Argument 2 to requested query data call
* @arg3 Argument 3 to requested query data call
* @data Returned output data
*
* This function returns requested data.
*/
enum pm_ret_status pm_query_data(uint32_t qid, uint32_t arg1, uint32_t arg2,
uint32_t arg3, uint32_t *data)
{
uint32_t payload[PAYLOAD_ARG_CNT];
/* Send request to the PMC */
PM_PACK_PAYLOAD5(payload, LIBPM_MODULE_ID, PM_QUERY_DATA, qid, arg1,
arg2, arg3);
return pm_ipi_send_sync(primary_proc, payload, data, 4);
}
/**
* pm_api_ioctl() - PM IOCTL API for device control and configs
* @device_id Device ID

3
plat/xilinx/versal/pm_service/pm_api_sys.h

@ -59,5 +59,6 @@ enum pm_ret_status pm_force_powerdown(uint32_t target, uint8_t ack);
enum pm_ret_status pm_system_shutdown(uint32_t type, uint32_t subtype);
enum pm_ret_status pm_api_ioctl(uint32_t device_id, uint32_t ioctl_id,
uint32_t arg1, uint32_t arg2, uint32_t *value);
enum pm_ret_status pm_query_data(uint32_t qid, uint32_t arg1, uint32_t arg2,
uint32_t arg3, uint32_t *data);
#endif /* PM_API_SYS_H */

1
plat/xilinx/versal/pm_service/pm_defs.h

@ -44,6 +44,7 @@
#define PM_PINCTRL_CONFIG_PARAM_GET 32U
#define PM_PINCTRL_CONFIG_PARAM_SET 33U
#define PM_IOCTL 34U
#define PM_QUERY_DATA 35U
#define PM_CLOCK_ENABLE 36U
#define PM_CLOCK_DISABLE 37U
#define PM_CLOCK_GETSTATE 38U

10
plat/xilinx/versal/pm_service/pm_svc_main.c

@ -200,6 +200,16 @@ uint64_t pm_smc_handler(uint32_t smc_fid, uint64_t x1, uint64_t x2, uint64_t x3,
SMC_RET1(handle, (uint64_t)ret | ((uint64_t)value) << 32);
}
case PM_QUERY_DATA:
{
uint32_t data[4] = { 0 };
ret = pm_query_data(pm_arg[0], pm_arg[1], pm_arg[2],
pm_arg[3], data);
SMC_RET2(handle, (uint64_t)ret | ((uint64_t)data[0] << 32),
(uint64_t)data[1] | ((uint64_t)data[2] << 32));
}
case PM_CLOCK_ENABLE:
ret = pm_clock_enable(pm_arg[0]);
SMC_RET1(handle, (uint64_t)ret);

Loading…
Cancel
Save