From: Govind Singh <govinds@codeaurora.org>
To: bjorn.andersson@linaro.org, linux-remoteproc@vger.kernel.org,
sboyd@kernel.org
Cc: linux-clk@vger.kernel.org, sricharan@codeaurora.org,
sibis@codeaurora.org, linux-arm-msm@vger.kernel.org,
andy.gross@linaro.org, david.brown@linaro.org,
linux-soc@vger.kernel.org, devicetree@vger.kernel.org,
Govind Singh <govinds@codeaurora.org>
Subject: [PATCH v3 5/7] remoteproc: qcom: wcss: populate hardcoded param using driver data
Date: Sat, 15 Dec 2018 16:05:55 +0530 [thread overview]
Message-ID: <20181215103557.2748-6-govinds@codeaurora.org> (raw)
In-Reply-To: <20181215103557.2748-1-govinds@codeaurora.org>
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: Govind Singh <govinds@codeaurora.org>
---
drivers/remoteproc/qcom_q6v5_wcss.c | 40 ++++++++++++++++++++++++-----
1 file changed, 34 insertions(+), 6 deletions(-)
diff --git a/drivers/remoteproc/qcom_q6v5_wcss.c b/drivers/remoteproc/qcom_q6v5_wcss.c
index f93e1e4a1cc0..129f82404656 100644
--- a/drivers/remoteproc/qcom_q6v5_wcss.c
+++ b/drivers/remoteproc/qcom_q6v5_wcss.c
@@ -8,6 +8,7 @@
#include <linux/kernel.h>
#include <linux/mfd/syscon.h>
#include <linux/module.h>
+#include <linux/of_device.h>
#include <linux/of_reserved_mem.h>
#include <linux/platform_device.h>
#include <linux/regmap.h>
@@ -16,7 +17,6 @@
#include "qcom_common.h"
#include "qcom_q6v5.h"
-#define WCSS_CRASH_REASON 421
/* Q6SS Register Offsets */
#define Q6SS_RESET_REG 0x014
@@ -70,6 +70,14 @@
#define TCSR_WCSS_CLK_MASK 0x1F
#define TCSR_WCSS_CLK_ENABLE 0x14
+struct wcss_data {
+ void (*pas_handover)(struct qcom_q6v5 *q6v5);
+ const char *firmware_name;
+ int crash_reason_smem;
+ int version;
+ int pas_id;
+};
+
struct q6v5_wcss {
struct device *dev;
@@ -91,6 +99,10 @@ struct q6v5_wcss {
phys_addr_t mem_reloc;
void *mem_region;
size_t mem_size;
+
+ int crash_reason_smem;
+ int pas_id;
+ int version;
};
static int q6v5_wcss_reset(struct q6v5_wcss *wcss)
@@ -427,7 +439,7 @@ static int q6v5_wcss_load(struct rproc *rproc, const struct firmware *fw)
wcss->mem_size, &wcss->mem_reloc);
}
-static const struct rproc_ops q6v5_wcss_ops = {
+static const struct rproc_ops q6v5_wcss_ipq8074_ops = {
.start = q6v5_wcss_start,
.stop = q6v5_wcss_stop,
.da_to_va = q6v5_wcss_da_to_va,
@@ -527,12 +539,17 @@ static int q6v5_alloc_memory_region(struct q6v5_wcss *wcss)
static int q6v5_wcss_probe(struct platform_device *pdev)
{
+ const struct wcss_data *desc;
struct q6v5_wcss *wcss;
struct rproc *rproc;
int ret;
- rproc = rproc_alloc(&pdev->dev, pdev->name, &q6v5_wcss_ops,
- "IPQ8074/q6_fw.mdt", sizeof(*wcss));
+ desc = of_device_get_match_data(&pdev->dev);
+ if (!desc)
+ return -EINVAL;
+
+ rproc = rproc_alloc(&pdev->dev, pdev->name, &q6v5_wcss_ipq8074_ops,
+ desc->firmware_name, sizeof(*wcss));
if (!rproc) {
dev_err(&pdev->dev, "failed to allocate rproc\n");
return -ENOMEM;
@@ -540,6 +557,9 @@ static int q6v5_wcss_probe(struct platform_device *pdev)
wcss = rproc->priv;
wcss->dev = &pdev->dev;
+ wcss->pas_id = desc->pas_id;
+ wcss->version = desc->version;
+ wcss->crash_reason_smem = desc->crash_reason_smem;
ret = q6v5_wcss_init_mmio(wcss, pdev);
if (ret)
@@ -553,7 +573,8 @@ static int q6v5_wcss_probe(struct platform_device *pdev)
if (ret)
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,
+ desc->pas_handover);
if (ret)
goto free_rproc;
@@ -581,8 +602,15 @@ static int q6v5_wcss_remove(struct platform_device *pdev)
return 0;
}
+static const struct wcss_data wcss_ipq8074_res_init = {
+ .firmware_name = "IPQ8074/q6_fw.mdt",
+ .crash_reason_smem = 421,
+ .pas_handover = NULL,
+};
+
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);
--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
next prev parent reply other threads:[~2018-12-15 10:36 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-15 10:35 [PATCH v3 0/7] Add non PAS wcss Q6 support for QCS404 Govind Singh
2018-12-15 10:35 ` [PATCH v3 1/7] dt-bindings: clock: qcom: Introduce QCOM WCSS Q6DSP clock bindings Govind Singh
2018-12-17 19:33 ` Stephen Boyd
2019-02-02 15:35 ` Govind Singh
2018-12-15 10:35 ` [PATCH v3 2/7] clk: qcom: Add WCSS Q6DSP clock controller for QCS404 Govind Singh
2018-12-17 18:52 ` Stephen Boyd
2019-02-02 15:45 ` Govind Singh
2018-12-15 10:35 ` [PATCH v3 3/7] dt-bindings: clock: qcom: Add QCOM WCSS GCC clock bindings Govind Singh
2018-12-17 19:34 ` Stephen Boyd
2019-02-02 15:33 ` Govind Singh
2018-12-15 10:35 ` [PATCH v3 4/7] clk: qcom: Add WCSS gcc clock control for QCS404 Govind Singh
2018-12-15 17:56 ` Bjorn Andersson
2019-02-02 15:32 ` Govind Singh
2018-12-17 18:53 ` Stephen Boyd
2018-12-15 10:35 ` Govind Singh [this message]
2018-12-17 18:55 ` [PATCH v3 5/7] remoteproc: qcom: wcss: populate hardcoded param using driver data Stephen Boyd
2018-12-15 10:35 ` [PATCH v3 6/7] remoteproc: qcom: wcss: Add non pas wcss Q6 support for QCS404 Govind Singh
2018-12-17 19:00 ` Stephen Boyd
2018-12-17 20:48 ` Rob Herring
2018-12-15 10:35 ` [PATCH v3 7/7] remoteproc: qcom: wcss: explicitly request exclusive reset control Govind Singh
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181215103557.2748-6-govinds@codeaurora.org \
--to=govinds@codeaurora.org \
--cc=andy.gross@linaro.org \
--cc=bjorn.andersson@linaro.org \
--cc=david.brown@linaro.org \
--cc=devicetree@vger.kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-remoteproc@vger.kernel.org \
--cc=linux-soc@vger.kernel.org \
--cc=sboyd@kernel.org \
--cc=sibis@codeaurora.org \
--cc=sricharan@codeaurora.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).