Commit 59ecdd77 authored by Rajan Vaja's avatar Rajan Vaja Committed by Michal Simek

firmware: xilinx: Add query data API

Add ZynqMP firmware query data API to query platform
specific information(clocks, pins) from firmware.
Signed-off-by: default avatarRajan Vaja <rajanv@xilinx.com>
Signed-off-by: default avatarJolly Shah <jollys@xilinx.com>
Signed-off-by: default avatarMichal Simek <michal.simek@xilinx.com>
parent 76582671
...@@ -241,8 +241,22 @@ static int get_set_conduit_method(struct device_node *np) ...@@ -241,8 +241,22 @@ static int get_set_conduit_method(struct device_node *np)
return 0; return 0;
} }
/**
* zynqmp_pm_query_data() - Get query data from firmware
* @qdata: Variable to the zynqmp_pm_query_data structure
* @out: Returned output value
*
* Return: Returns status, either success or error+reason
*/
static int zynqmp_pm_query_data(struct zynqmp_pm_query_data qdata, u32 *out)
{
return zynqmp_pm_invoke_fn(PM_QUERY_DATA, qdata.qid, qdata.arg1,
qdata.arg2, qdata.arg3, out);
}
static const struct zynqmp_eemi_ops eemi_ops = { static const struct zynqmp_eemi_ops eemi_ops = {
.get_api_version = zynqmp_pm_get_api_version, .get_api_version = zynqmp_pm_get_api_version,
.query_data = zynqmp_pm_query_data,
}; };
/** /**
......
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
enum pm_api_id { enum pm_api_id {
PM_GET_API_VERSION = 1, PM_GET_API_VERSION = 1,
PM_QUERY_DATA = 35,
}; };
/* PMU-FW return status codes */ /* PMU-FW return status codes */
...@@ -47,8 +48,27 @@ enum pm_ret_status { ...@@ -47,8 +48,27 @@ enum pm_ret_status {
XST_PM_ABORT_SUSPEND, XST_PM_ABORT_SUSPEND,
}; };
enum pm_query_id {
PM_QID_INVALID,
};
/**
* struct zynqmp_pm_query_data - PM query data
* @qid: query ID
* @arg1: Argument 1 of query data
* @arg2: Argument 2 of query data
* @arg3: Argument 3 of query data
*/
struct zynqmp_pm_query_data {
u32 qid;
u32 arg1;
u32 arg2;
u32 arg3;
};
struct zynqmp_eemi_ops { struct zynqmp_eemi_ops {
int (*get_api_version)(u32 *version); int (*get_api_version)(u32 *version);
int (*query_data)(struct zynqmp_pm_query_data qdata, u32 *out);
}; };
#if IS_REACHABLE(CONFIG_ARCH_ZYNQMP) #if IS_REACHABLE(CONFIG_ARCH_ZYNQMP)
......
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