Commit 6549f42c authored by Govind Singh's avatar Govind Singh Committed by Bjorn Andersson

remoteproc: qcom: wcss: populate hardcoded param using driver data

Q6 based WiFi fw loading is supported across
different targets, ex: IPQ8074/QCS404. In order to
support different fw names/pas id etc, populate
hardcoded param using driver data.
Signed-off-by: default avatarGovind Singh <govinds@codeaurora.org>
Signed-off-by: default avatarGokul Sriram Palanisamy <gokulsri@codeaurora.org>
Link: https://lore.kernel.org/r/1611859695-11824-2-git-send-email-gokulsri@codeaurora.orgSigned-off-by: default avatarBjorn Andersson <bjorn.andersson@linaro.org>
parent 6e71d2b2
...@@ -71,6 +71,11 @@ ...@@ -71,6 +71,11 @@
#define TCSR_WCSS_CLK_MASK 0x1F #define TCSR_WCSS_CLK_MASK 0x1F
#define TCSR_WCSS_CLK_ENABLE 0x14 #define TCSR_WCSS_CLK_ENABLE 0x14
struct wcss_data {
const char *firmware_name;
unsigned int crash_reason_smem;
};
struct q6v5_wcss { struct q6v5_wcss {
struct device *dev; struct device *dev;
...@@ -93,6 +98,8 @@ struct q6v5_wcss { ...@@ -93,6 +98,8 @@ struct q6v5_wcss {
void *mem_region; void *mem_region;
size_t mem_size; size_t mem_size;
unsigned int crash_reason_smem;
struct qcom_rproc_glink glink_subdev; struct qcom_rproc_glink glink_subdev;
struct qcom_rproc_ssr ssr_subdev; struct qcom_rproc_ssr ssr_subdev;
}; };
...@@ -438,7 +445,7 @@ static int q6v5_wcss_load(struct rproc *rproc, const struct firmware *fw) ...@@ -438,7 +445,7 @@ static int q6v5_wcss_load(struct rproc *rproc, const struct firmware *fw)
return ret; return ret;
} }
static const struct rproc_ops q6v5_wcss_ops = { static const struct rproc_ops q6v5_wcss_ipq8074_ops = {
.start = q6v5_wcss_start, .start = q6v5_wcss_start,
.stop = q6v5_wcss_stop, .stop = q6v5_wcss_stop,
.da_to_va = q6v5_wcss_da_to_va, .da_to_va = q6v5_wcss_da_to_va,
...@@ -538,12 +545,17 @@ static int q6v5_alloc_memory_region(struct q6v5_wcss *wcss) ...@@ -538,12 +545,17 @@ static int q6v5_alloc_memory_region(struct q6v5_wcss *wcss)
static int q6v5_wcss_probe(struct platform_device *pdev) static int q6v5_wcss_probe(struct platform_device *pdev)
{ {
const struct wcss_data *desc;
struct q6v5_wcss *wcss; struct q6v5_wcss *wcss;
struct rproc *rproc; struct rproc *rproc;
int ret; int ret;
rproc = rproc_alloc(&pdev->dev, pdev->name, &q6v5_wcss_ops, desc = device_get_match_data(&pdev->dev);
"IPQ8074/q6_fw.mdt", sizeof(*wcss)); if (!desc)
return -EINVAL;
rproc = rproc_alloc(&pdev->dev, pdev->name, &q6v5_wcss_ipq8074_ops,
desc->firmware_name, sizeof(*wcss));
if (!rproc) { if (!rproc) {
dev_err(&pdev->dev, "failed to allocate rproc\n"); dev_err(&pdev->dev, "failed to allocate rproc\n");
return -ENOMEM; return -ENOMEM;
...@@ -551,6 +563,7 @@ static int q6v5_wcss_probe(struct platform_device *pdev) ...@@ -551,6 +563,7 @@ static int q6v5_wcss_probe(struct platform_device *pdev)
wcss = rproc->priv; wcss = rproc->priv;
wcss->dev = &pdev->dev; wcss->dev = &pdev->dev;
wcss->crash_reason_smem = desc->crash_reason_smem;
ret = q6v5_wcss_init_mmio(wcss, pdev); ret = q6v5_wcss_init_mmio(wcss, pdev);
if (ret) if (ret)
...@@ -564,7 +577,8 @@ static int q6v5_wcss_probe(struct platform_device *pdev) ...@@ -564,7 +577,8 @@ static int q6v5_wcss_probe(struct platform_device *pdev)
if (ret) if (ret)
goto free_rproc; goto free_rproc;
ret = qcom_q6v5_init(&wcss->q6v5, pdev, rproc, WCSS_CRASH_REASON, NULL); ret = qcom_q6v5_init(&wcss->q6v5, pdev, rproc, desc->crash_reason_smem,
NULL);
if (ret) if (ret)
goto free_rproc; goto free_rproc;
...@@ -595,8 +609,13 @@ static int q6v5_wcss_remove(struct platform_device *pdev) ...@@ -595,8 +609,13 @@ static int q6v5_wcss_remove(struct platform_device *pdev)
return 0; return 0;
} }
static const struct wcss_data wcss_ipq8074_res_init = {
.firmware_name = "IPQ8074/q6_fw.mdt",
.crash_reason_smem = WCSS_CRASH_REASON,
};
static const struct of_device_id q6v5_wcss_of_match[] = { static const struct of_device_id q6v5_wcss_of_match[] = {
{ .compatible = "qcom,ipq8074-wcss-pil" }, { .compatible = "qcom,ipq8074-wcss-pil", .data = &wcss_ipq8074_res_init },
{ }, { },
}; };
MODULE_DEVICE_TABLE(of, q6v5_wcss_of_match); MODULE_DEVICE_TABLE(of, q6v5_wcss_of_match);
......
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