Commit 6366c1ba authored by Rajan Vaja's avatar Rajan Vaja Committed by Greg Kroah-Hartman

firmware: xilinx: Remove eemi ops for query_data

Use direct function call for query_data instead of using eemi ops.
Signed-off-by: default avatarRajan Vaja <rajan.vaja@xilinx.com>
Signed-off-by: default avatarJolly Shah <jolly.shah@xilinx.com>
Link: https://lore.kernel.org/r/1587761887-4279-4-git-send-email-jolly.shah@xilinx.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 21cd93ba
...@@ -134,7 +134,6 @@ static struct clk_hw *(* const clk_topology[]) (const char *name, u32 clk_id, ...@@ -134,7 +134,6 @@ static struct clk_hw *(* const clk_topology[]) (const char *name, u32 clk_id,
static struct zynqmp_clock *clock; static struct zynqmp_clock *clock;
static struct clk_hw_onecell_data *zynqmp_data; static struct clk_hw_onecell_data *zynqmp_data;
static unsigned int clock_max_idx; static unsigned int clock_max_idx;
static const struct zynqmp_eemi_ops *eemi_ops;
/** /**
* zynqmp_is_valid_clock() - Check whether clock is valid or not * zynqmp_is_valid_clock() - Check whether clock is valid or not
...@@ -206,7 +205,7 @@ static int zynqmp_pm_clock_get_num_clocks(u32 *nclocks) ...@@ -206,7 +205,7 @@ static int zynqmp_pm_clock_get_num_clocks(u32 *nclocks)
qdata.qid = PM_QID_CLOCK_GET_NUM_CLOCKS; qdata.qid = PM_QID_CLOCK_GET_NUM_CLOCKS;
ret = eemi_ops->query_data(qdata, ret_payload); ret = zynqmp_pm_query_data(qdata, ret_payload);
*nclocks = ret_payload[1]; *nclocks = ret_payload[1];
return ret; return ret;
...@@ -231,7 +230,7 @@ static int zynqmp_pm_clock_get_name(u32 clock_id, ...@@ -231,7 +230,7 @@ static int zynqmp_pm_clock_get_name(u32 clock_id,
qdata.qid = PM_QID_CLOCK_GET_NAME; qdata.qid = PM_QID_CLOCK_GET_NAME;
qdata.arg1 = clock_id; qdata.arg1 = clock_id;
eemi_ops->query_data(qdata, ret_payload); zynqmp_pm_query_data(qdata, ret_payload);
memcpy(response, ret_payload, sizeof(*response)); memcpy(response, ret_payload, sizeof(*response));
return 0; return 0;
...@@ -265,7 +264,7 @@ static int zynqmp_pm_clock_get_topology(u32 clock_id, u32 index, ...@@ -265,7 +264,7 @@ static int zynqmp_pm_clock_get_topology(u32 clock_id, u32 index,
qdata.arg1 = clock_id; qdata.arg1 = clock_id;
qdata.arg2 = index; qdata.arg2 = index;
ret = eemi_ops->query_data(qdata, ret_payload); ret = zynqmp_pm_query_data(qdata, ret_payload);
memcpy(response, &ret_payload[1], sizeof(*response)); memcpy(response, &ret_payload[1], sizeof(*response));
return ret; return ret;
...@@ -296,7 +295,7 @@ struct clk_hw *zynqmp_clk_register_fixed_factor(const char *name, u32 clk_id, ...@@ -296,7 +295,7 @@ struct clk_hw *zynqmp_clk_register_fixed_factor(const char *name, u32 clk_id,
qdata.qid = PM_QID_CLOCK_GET_FIXEDFACTOR_PARAMS; qdata.qid = PM_QID_CLOCK_GET_FIXEDFACTOR_PARAMS;
qdata.arg1 = clk_id; qdata.arg1 = clk_id;
ret = eemi_ops->query_data(qdata, ret_payload); ret = zynqmp_pm_query_data(qdata, ret_payload);
if (ret) if (ret)
return ERR_PTR(ret); return ERR_PTR(ret);
...@@ -339,7 +338,7 @@ static int zynqmp_pm_clock_get_parents(u32 clock_id, u32 index, ...@@ -339,7 +338,7 @@ static int zynqmp_pm_clock_get_parents(u32 clock_id, u32 index,
qdata.arg1 = clock_id; qdata.arg1 = clock_id;
qdata.arg2 = index; qdata.arg2 = index;
ret = eemi_ops->query_data(qdata, ret_payload); ret = zynqmp_pm_query_data(qdata, ret_payload);
memcpy(response, &ret_payload[1], sizeof(*response)); memcpy(response, &ret_payload[1], sizeof(*response));
return ret; return ret;
...@@ -364,7 +363,7 @@ static int zynqmp_pm_clock_get_attributes(u32 clock_id, ...@@ -364,7 +363,7 @@ static int zynqmp_pm_clock_get_attributes(u32 clock_id,
qdata.qid = PM_QID_CLOCK_GET_ATTRIBUTES; qdata.qid = PM_QID_CLOCK_GET_ATTRIBUTES;
qdata.arg1 = clock_id; qdata.arg1 = clock_id;
ret = eemi_ops->query_data(qdata, ret_payload); ret = zynqmp_pm_query_data(qdata, ret_payload);
memcpy(response, &ret_payload[1], sizeof(*response)); memcpy(response, &ret_payload[1], sizeof(*response));
return ret; return ret;
...@@ -738,10 +737,6 @@ static int zynqmp_clock_probe(struct platform_device *pdev) ...@@ -738,10 +737,6 @@ static int zynqmp_clock_probe(struct platform_device *pdev)
int ret; int ret;
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
eemi_ops = zynqmp_pm_get_eemi_ops();
if (IS_ERR(eemi_ops))
return PTR_ERR(eemi_ops);
ret = zynqmp_clk_setup(dev->of_node); ret = zynqmp_clk_setup(dev->of_node);
return ret; return ret;
......
...@@ -258,7 +258,6 @@ static const struct clk_ops zynqmp_clk_divider_ops = { ...@@ -258,7 +258,6 @@ static const struct clk_ops zynqmp_clk_divider_ops = {
*/ */
u32 zynqmp_clk_get_max_divisor(u32 clk_id, u32 type) u32 zynqmp_clk_get_max_divisor(u32 clk_id, u32 type)
{ {
const struct zynqmp_eemi_ops *eemi_ops = zynqmp_pm_get_eemi_ops();
struct zynqmp_pm_query_data qdata = {0}; struct zynqmp_pm_query_data qdata = {0};
u32 ret_payload[PAYLOAD_ARG_CNT]; u32 ret_payload[PAYLOAD_ARG_CNT];
int ret; int ret;
...@@ -266,7 +265,7 @@ u32 zynqmp_clk_get_max_divisor(u32 clk_id, u32 type) ...@@ -266,7 +265,7 @@ u32 zynqmp_clk_get_max_divisor(u32 clk_id, u32 type)
qdata.qid = PM_QID_CLOCK_GET_MAX_DIVISOR; qdata.qid = PM_QID_CLOCK_GET_MAX_DIVISOR;
qdata.arg1 = clk_id; qdata.arg1 = clk_id;
qdata.arg2 = type; qdata.arg2 = type;
ret = eemi_ops->query_data(qdata, ret_payload); ret = zynqmp_pm_query_data(qdata, ret_payload);
/* /*
* To maintain backward compatibility return maximum possible value * To maintain backward compatibility return maximum possible value
* (0xFFFF) if query for max divisor is not successful. * (0xFFFF) if query for max divisor is not successful.
......
...@@ -85,7 +85,6 @@ static int get_pm_api_id(char *pm_api_req, u32 *pm_id) ...@@ -85,7 +85,6 @@ static int get_pm_api_id(char *pm_api_req, u32 *pm_id)
static int process_api_request(u32 pm_id, u64 *pm_api_arg, u32 *pm_api_ret) static int process_api_request(u32 pm_id, u64 *pm_api_arg, u32 *pm_api_ret)
{ {
const struct zynqmp_eemi_ops *eemi_ops = zynqmp_pm_get_eemi_ops();
u32 pm_api_version; u32 pm_api_version;
int ret; int ret;
struct zynqmp_pm_query_data qdata = {0}; struct zynqmp_pm_query_data qdata = {0};
...@@ -102,7 +101,7 @@ static int process_api_request(u32 pm_id, u64 *pm_api_arg, u32 *pm_api_ret) ...@@ -102,7 +101,7 @@ static int process_api_request(u32 pm_id, u64 *pm_api_arg, u32 *pm_api_ret)
qdata.arg2 = pm_api_arg[2]; qdata.arg2 = pm_api_arg[2];
qdata.arg3 = pm_api_arg[3]; qdata.arg3 = pm_api_arg[3];
ret = eemi_ops->query_data(qdata, pm_api_ret); ret = zynqmp_pm_query_data(qdata, pm_api_ret);
if (ret) if (ret)
break; break;
......
...@@ -326,7 +326,7 @@ static int get_set_conduit_method(struct device_node *np) ...@@ -326,7 +326,7 @@ static int get_set_conduit_method(struct device_node *np)
* *
* Return: Returns status, either success or error+reason * Return: Returns status, either success or error+reason
*/ */
static int zynqmp_pm_query_data(struct zynqmp_pm_query_data qdata, u32 *out) int zynqmp_pm_query_data(struct zynqmp_pm_query_data qdata, u32 *out)
{ {
int ret; int ret;
...@@ -340,6 +340,7 @@ static int zynqmp_pm_query_data(struct zynqmp_pm_query_data qdata, u32 *out) ...@@ -340,6 +340,7 @@ static int zynqmp_pm_query_data(struct zynqmp_pm_query_data qdata, u32 *out)
*/ */
return qdata.qid == PM_QID_CLOCK_GET_NAME ? 0 : ret; return qdata.qid == PM_QID_CLOCK_GET_NAME ? 0 : ret;
} }
EXPORT_SYMBOL_GPL(zynqmp_pm_query_data);
/** /**
* zynqmp_pm_clock_enable() - Enable the clock for given id * zynqmp_pm_clock_enable() - Enable the clock for given id
...@@ -736,7 +737,6 @@ static int zynqmp_pm_aes_engine(const u64 address, u32 *out) ...@@ -736,7 +737,6 @@ static int zynqmp_pm_aes_engine(const u64 address, u32 *out)
} }
static const struct zynqmp_eemi_ops eemi_ops = { static const struct zynqmp_eemi_ops eemi_ops = {
.query_data = zynqmp_pm_query_data,
.clock_enable = zynqmp_pm_clock_enable, .clock_enable = zynqmp_pm_clock_enable,
.clock_disable = zynqmp_pm_clock_disable, .clock_disable = zynqmp_pm_clock_disable,
.clock_getstate = zynqmp_pm_clock_getstate, .clock_getstate = zynqmp_pm_clock_getstate,
......
...@@ -296,7 +296,6 @@ struct zynqmp_pm_query_data { ...@@ -296,7 +296,6 @@ struct zynqmp_pm_query_data {
struct zynqmp_eemi_ops { struct zynqmp_eemi_ops {
int (*fpga_load)(const u64 address, const u32 size, const u32 flags); int (*fpga_load)(const u64 address, const u32 size, const u32 flags);
int (*fpga_get_status)(u32 *value); int (*fpga_get_status)(u32 *value);
int (*query_data)(struct zynqmp_pm_query_data qdata, u32 *out);
int (*clock_enable)(u32 clock_id); int (*clock_enable)(u32 clock_id);
int (*clock_disable)(u32 clock_id); int (*clock_disable)(u32 clock_id);
int (*clock_getstate)(u32 clock_id, u32 *state); int (*clock_getstate)(u32 clock_id, u32 *state);
...@@ -331,6 +330,7 @@ int zynqmp_pm_invoke_fn(u32 pm_api_id, u32 arg0, u32 arg1, ...@@ -331,6 +330,7 @@ int zynqmp_pm_invoke_fn(u32 pm_api_id, u32 arg0, u32 arg1,
const struct zynqmp_eemi_ops *zynqmp_pm_get_eemi_ops(void); const struct zynqmp_eemi_ops *zynqmp_pm_get_eemi_ops(void);
int zynqmp_pm_get_api_version(u32 *version); int zynqmp_pm_get_api_version(u32 *version);
int zynqmp_pm_get_chipid(u32 *idcode, u32 *version); int zynqmp_pm_get_chipid(u32 *idcode, u32 *version);
int zynqmp_pm_query_data(struct zynqmp_pm_query_data qdata, u32 *out);
#else #else
static inline struct zynqmp_eemi_ops *zynqmp_pm_get_eemi_ops(void) static inline struct zynqmp_eemi_ops *zynqmp_pm_get_eemi_ops(void)
{ {
...@@ -344,6 +344,11 @@ static inline int zynqmp_pm_get_chipid(u32 *idcode, u32 *version) ...@@ -344,6 +344,11 @@ static inline int zynqmp_pm_get_chipid(u32 *idcode, u32 *version)
{ {
return -ENODEV; return -ENODEV;
} }
static inline int zynqmp_pm_query_data(struct zynqmp_pm_query_data qdata,
u32 *out)
{
return -ENODEV;
}
#endif #endif
#endif /* __FIRMWARE_ZYNQMP_H__ */ #endif /* __FIRMWARE_ZYNQMP_H__ */
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