From 6f97b8f4e7f66f95c040a1e37b0d1d2624af38da Mon Sep 17 00:00:00 2001 From: Bjorn Andersson Date: Tue, 7 Jan 2020 21:50:53 -0800 Subject: remoteproc: qcom: wcnss: Allow specifying firmware-name Introduce a firmware-name property, in order to be able to support device/platform specific firmware for the wireless connectivity subsystem; in line with other Qualcomm remoteproc drivers. Link: https://lore.kernel.org/r/20200108055252.639791-1-bjorn.andersson@linaro.org Signed-off-by: Bjorn Andersson --- Documentation/devicetree/bindings/remoteproc/qcom,wcnss-pil.txt | 6 ++++++ drivers/remoteproc/qcom_wcnss.c | 8 +++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/remoteproc/qcom,wcnss-pil.txt b/Documentation/devicetree/bindings/remoteproc/qcom,wcnss-pil.txt index d420f84ddfb0..00844a5d2ccf 100644 --- a/Documentation/devicetree/bindings/remoteproc/qcom,wcnss-pil.txt +++ b/Documentation/devicetree/bindings/remoteproc/qcom,wcnss-pil.txt @@ -34,6 +34,12 @@ on the Qualcomm WCNSS core. Definition: should be "wdog", "fatal", optionally followed by "ready", "handover", "stop-ack" +- firmware-name: + Usage: optional + Value type: + Definition: must list the relative firmware image path for the + WCNSS core. + - vddmx-supply: - vddcx-supply: - vddpx-supply: diff --git a/drivers/remoteproc/qcom_wcnss.c b/drivers/remoteproc/qcom_wcnss.c index dc135754bb9c..a0468b3cc76f 100644 --- a/drivers/remoteproc/qcom_wcnss.c +++ b/drivers/remoteproc/qcom_wcnss.c @@ -457,6 +457,7 @@ static int wcnss_alloc_memory_region(struct qcom_wcnss *wcnss) static int wcnss_probe(struct platform_device *pdev) { + const char *fw_name = WCNSS_FIRMWARE_NAME; const struct wcnss_data *data; struct qcom_wcnss *wcnss; struct resource *res; @@ -474,8 +475,13 @@ static int wcnss_probe(struct platform_device *pdev) return -ENXIO; } + ret = of_property_read_string(pdev->dev.of_node, "firmware-name", + &fw_name); + if (ret < 0 && ret != -EINVAL) + return ret; + rproc = rproc_alloc(&pdev->dev, pdev->name, &wcnss_ops, - WCNSS_FIRMWARE_NAME, sizeof(*wcnss)); + fw_name, sizeof(*wcnss)); if (!rproc) { dev_err(&pdev->dev, "unable to allocate remoteproc\n"); return -ENOMEM; -- cgit v1.2.3 From 08393e4386abc488afee732dd02ed80c4f005d59 Mon Sep 17 00:00:00 2001 From: Bjorn Andersson Date: Tue, 7 Jan 2020 21:54:48 -0800 Subject: arm64: dts: qcom: db410c: Update firmware-name for wcnss and mpss Enable the mpss remoteproc node and specify the firmware-name for this and the wcnss remoteproc on the Dragonboard 410c. Link: https://lore.kernel.org/r/20200108055735.660475-1-bjorn.andersson@linaro.org Signed-off-by: Bjorn Andersson --- arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi | 6 ++++++ arch/arm64/boot/dts/qcom/msm8916.dtsi | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi b/arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi index 037e26b3f8d5..298684c62cc1 100644 --- a/arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi +++ b/arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi @@ -494,6 +494,7 @@ wcnss@a21b000 { status = "okay"; + firmware-name = "qcom/msm8916/wcnss.mdt"; }; }; @@ -538,6 +539,11 @@ }; }; +&mpss { + status = "okay"; + firmware-name = "qcom/msm8916/mba.mbn", "qcom/msm8916/modem.mdt"; +}; + &spmi_bus { pm8916_0: pm8916@0 { pon@800 { diff --git a/arch/arm64/boot/dts/qcom/msm8916.dtsi b/arch/arm64/boot/dts/qcom/msm8916.dtsi index 9f31064f2374..dc651ce73546 100644 --- a/arch/arm64/boot/dts/qcom/msm8916.dtsi +++ b/arch/arm64/boot/dts/qcom/msm8916.dtsi @@ -1078,7 +1078,7 @@ }; - hexagon@4080000 { + mpss: remoteproc@4080000 { compatible = "qcom,q6v5-pil"; reg = <0x04080000 0x100>, <0x04020000 0x040>; -- cgit v1.2.3 From 636996939fb23d25f4afef98cdeec094c3bba43c Mon Sep 17 00:00:00 2001 From: Loic Poulain Date: Wed, 12 Feb 2020 18:54:03 +0100 Subject: remoteproc: qcom: wcnss: Add iris completion barrier There is no guarantee that the iris pointer will be assigned before remoteproc subsystem starts the wcnss rproc, actually it depends how fast rproc subsystem is able to get the firmware to trigger the start. This leads to sporadic wifi/bluetooth initialization issue on db410c with the following output: remoteproc remoteproc1: powering up a204000.wcnss remoteproc remoteproc1: Booting fw image qcom/msm8916/wcnss.mdt... qcom-wcnss-pil a204000.wcnss: no iris registered remoteproc remoteproc1: can't start rproc a204000.wcnss: -22 This patch introduces a 'iris_assigned' completion barrier to fix this issue. Maybe not the most elegant way, but it does the trick. Signed-off-by: Loic Poulain --- drivers/remoteproc/qcom_wcnss.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/remoteproc/qcom_wcnss.c b/drivers/remoteproc/qcom_wcnss.c index a0468b3cc76f..c88828212295 100644 --- a/drivers/remoteproc/qcom_wcnss.c +++ b/drivers/remoteproc/qcom_wcnss.c @@ -84,6 +84,7 @@ struct qcom_wcnss { struct completion start_done; struct completion stop_done; + struct completion iris_assigned; phys_addr_t mem_phys; phys_addr_t mem_reloc; @@ -138,6 +139,7 @@ void qcom_wcnss_assign_iris(struct qcom_wcnss *wcnss, wcnss->iris = iris; wcnss->use_48mhz_xo = use_48mhz_xo; + complete(&wcnss->iris_assigned); mutex_unlock(&wcnss->iris_lock); } @@ -213,6 +215,10 @@ static int wcnss_start(struct rproc *rproc) struct qcom_wcnss *wcnss = (struct qcom_wcnss *)rproc->priv; int ret; + /* Grant some time for iris registration */ + wait_for_completion_timeout(&wcnss->iris_assigned, + msecs_to_jiffies(5000)); + mutex_lock(&wcnss->iris_lock); if (!wcnss->iris) { dev_err(wcnss->dev, "no iris registered\n"); @@ -494,6 +500,7 @@ static int wcnss_probe(struct platform_device *pdev) init_completion(&wcnss->start_done); init_completion(&wcnss->stop_done); + init_completion(&wcnss->iris_assigned); mutex_init(&wcnss->iris_lock); -- cgit v1.2.3