All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v5 0/5] remoteproc: qcom: Add support for pronto-v3
@ 2022-09-29  5:02 Sireesh Kodali
  2022-09-29  5:02 ` [PATCH v5 1/5] remoteproc: qcom: qcom_wcnss: " Sireesh Kodali
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Sireesh Kodali @ 2022-09-29  5:02 UTC (permalink / raw)
  To: devicetree, linux-arm-msm, linux-remoteproc,
	~postmarketos/upstreaming, linux-kernel
  Cc: andersson, krzysztof.kozlowski+dt, Sireesh Kodali

This patch series adds support for the pronto-v3 remoteproc found on the
MSM8953 platform. It also converts the documentation for wcnss to YAML.

Changes since v4:
 * Addressed comments to YAML conversion patch
 * Added patch to fix docs for MSM8974

Sireesh Kodali (4):
  dt-bindings: remoteproc: qcom: Convert wcnss documentation to YAML
  dt-bindings: remoteproc: qcom: wcnss: Add qcom,pronto compatible
  dt-bindings: remoteproc: qcom: wcnss: Add compatible for pronto v3
  dt-bindings: remoteproc: wcnss-pil: Make supplies optionally required

Vladimir Lypak (1):
  remoteproc: qcom: qcom_wcnss: Add support for pronto-v3

 .../bindings/remoteproc/qcom,wcnss-pil.txt    | 177 -----------
 .../bindings/remoteproc/qcom,wcnss-pil.yaml   | 294 ++++++++++++++++++
 drivers/remoteproc/qcom_wcnss.c               |  13 +
 3 files changed, 307 insertions(+), 177 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/remoteproc/qcom,wcnss-pil.txt
 create mode 100644 Documentation/devicetree/bindings/remoteproc/qcom,wcnss-pil.yaml

-- 
2.37.3


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH v5 1/5] remoteproc: qcom: qcom_wcnss: Add support for pronto-v3
  2022-09-29  5:02 [PATCH v5 0/5] remoteproc: qcom: Add support for pronto-v3 Sireesh Kodali
@ 2022-09-29  5:02 ` Sireesh Kodali
  2022-09-29  9:39   ` Stephan Gerhold
  2022-09-29  5:02 ` [PATCH v5 2/5] dt-bindings: remoteproc: qcom: Convert wcnss documentation to YAML Sireesh Kodali
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 10+ messages in thread
From: Sireesh Kodali @ 2022-09-29  5:02 UTC (permalink / raw)
  To: devicetree, linux-arm-msm, linux-remoteproc,
	~postmarketos/upstreaming, linux-kernel
  Cc: andersson, krzysztof.kozlowski+dt, Vladimir Lypak,
	Sireesh Kodali, Andy Gross, Bjorn Andersson, Konrad Dybcio,
	Mathieu Poirier

From: Vladimir Lypak <vladimir.lypak@gmail.com>

Pronto-v3 is similar to pronto-v2. It requires two power domains, and it
requires the xo clock. It is used on the MSM8953 platform.

Signed-off-by: Vladimir Lypak <vladimir.lypak@gmail.com>
Signed-off-by: Sireesh Kodali <sireeshkodali1@gmail.com>
---
 drivers/remoteproc/qcom_wcnss.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/drivers/remoteproc/qcom_wcnss.c b/drivers/remoteproc/qcom_wcnss.c
index 68f37296b151..ff18bfae5eb6 100644
--- a/drivers/remoteproc/qcom_wcnss.c
+++ b/drivers/remoteproc/qcom_wcnss.c
@@ -141,6 +141,18 @@ static const struct wcnss_data pronto_v2_data = {
 	.num_vregs = 1,
 };
 
+static const struct wcnss_data pronto_v3_data = {
+	.pmu_offset = 0x1004,
+	.spare_offset = 0x1088,
+
+	.pd_names = { "mx", "cx" },
+	.vregs = (struct wcnss_vreg_info[]) {
+		{ "vddpx", 1800000, 1800000, 0 },
+	},
+	.num_pd_vregs = 2,
+	.num_vregs = 1,
+};
+
 static int wcnss_load(struct rproc *rproc, const struct firmware *fw)
 {
 	struct qcom_wcnss *wcnss = (struct qcom_wcnss *)rproc->priv;
@@ -675,6 +687,7 @@ static const struct of_device_id wcnss_of_match[] = {
 	{ .compatible = "qcom,riva-pil", &riva_data },
 	{ .compatible = "qcom,pronto-v1-pil", &pronto_v1_data },
 	{ .compatible = "qcom,pronto-v2-pil", &pronto_v2_data },
+	{ .compatible = "qcom,pronto-v3-pil", &pronto_v3_data },
 	{ },
 };
 MODULE_DEVICE_TABLE(of, wcnss_of_match);
-- 
2.37.3


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH v5 2/5] dt-bindings: remoteproc: qcom: Convert wcnss documentation to YAML
  2022-09-29  5:02 [PATCH v5 0/5] remoteproc: qcom: Add support for pronto-v3 Sireesh Kodali
  2022-09-29  5:02 ` [PATCH v5 1/5] remoteproc: qcom: qcom_wcnss: " Sireesh Kodali
@ 2022-09-29  5:02 ` Sireesh Kodali
  2022-09-29  9:18   ` Krzysztof Kozlowski
  2022-09-29  5:02 ` [PATCH v5 3/5] dt-bindings: remoteproc: qcom: wcnss: Add qcom,pronto compatible Sireesh Kodali
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 10+ messages in thread
From: Sireesh Kodali @ 2022-09-29  5:02 UTC (permalink / raw)
  To: devicetree, linux-arm-msm, linux-remoteproc,
	~postmarketos/upstreaming, linux-kernel
  Cc: andersson, krzysztof.kozlowski+dt, Sireesh Kodali, Andy Gross,
	Bjorn Andersson, Konrad Dybcio, Mathieu Poirier, Rob Herring

This is a direct conversion of the existing txt documentation to YAML.
It is in preparation for the addition of pronto-v3 to the docs. This
patch doesn't document any of the existing subnodes/properties that are
not documented in the existing txt file. That is done in a separate
patch.

Signed-off-by: Sireesh Kodali <sireeshkodali1@gmail.com>
---
 .../bindings/remoteproc/qcom,wcnss-pil.txt    | 177 ------------
 .../bindings/remoteproc/qcom,wcnss-pil.yaml   | 269 ++++++++++++++++++
 2 files changed, 269 insertions(+), 177 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/remoteproc/qcom,wcnss-pil.txt
 create mode 100644 Documentation/devicetree/bindings/remoteproc/qcom,wcnss-pil.yaml

diff --git a/Documentation/devicetree/bindings/remoteproc/qcom,wcnss-pil.txt b/Documentation/devicetree/bindings/remoteproc/qcom,wcnss-pil.txt
deleted file mode 100644
index ac423f4c3f1b..000000000000
--- a/Documentation/devicetree/bindings/remoteproc/qcom,wcnss-pil.txt
+++ /dev/null
@@ -1,177 +0,0 @@
-Qualcomm WCNSS Peripheral Image Loader
-
-This document defines the binding for a component that loads and boots firmware
-on the Qualcomm WCNSS core.
-
-- compatible:
-	Usage: required
-	Value type: <string>
-	Definition: must be one of:
-		    "qcom,riva-pil",
-		    "qcom,pronto-v1-pil",
-		    "qcom,pronto-v2-pil"
-
-- reg:
-	Usage: required
-	Value type: <prop-encoded-array>
-	Definition: must specify the base address and size of the CCU, DXE and
-		    PMU register blocks
-
-- reg-names:
-	Usage: required
-	Value type: <stringlist>
-	Definition: must be "ccu", "dxe", "pmu"
-
-- interrupts-extended:
-	Usage: required
-	Value type: <prop-encoded-array>
-	Definition: must list the watchdog and fatal IRQs and may specify the
-		    ready, handover and stop-ack IRQs
-
-- interrupt-names:
-	Usage: required
-	Value type: <stringlist>
-	Definition: should be "wdog", "fatal", optionally followed by "ready",
-		    "handover", "stop-ack"
-
-- firmware-name:
-	Usage: optional
-	Value type: <string>
-	Definition: must list the relative firmware image path for the
-		    WCNSS core. Defaults to "wcnss.mdt".
-
-- vddmx-supply: (deprecated for qcom,pronto-v1/2-pil)
-- vddcx-supply: (deprecated for qcom,pronto-v1/2-pil)
-- vddpx-supply:
-	Usage: required
-	Value type: <phandle>
-	Definition: reference to the regulators to be held on behalf of the
-		    booting of the WCNSS core
-
-- power-domains:
-	Usage: required (for qcom,pronto-v1/2-pil)
-	Value type: <phandle>
-	Definition: reference to the power domains to be held on behalf of the
-		    booting of the WCNSS core
-
-- power-domain-names:
-	Usage: required (for qcom,pronto-v1/2-pil)
-	Value type: <stringlist>
-	Definition: must be "cx", "mx"
-
-- qcom,smem-states:
-	Usage: optional
-	Value type: <prop-encoded-array>
-	Definition: reference to the SMEM state used to indicate to WCNSS that
-		    it should shut down
-
-- qcom,smem-state-names:
-	Usage: optional
-	Value type: <stringlist>
-	Definition: should be "stop"
-
-- memory-region:
-	Usage: required
-	Value type: <prop-encoded-array>
-	Definition: reference to reserved-memory node for the remote processor
-		    see ../reserved-memory/reserved-memory.txt
-
-= SUBNODES
-A required subnode of the WCNSS PIL is used to describe the attached rf module
-and its resource dependencies. It is described by the following properties:
-
-- compatible:
-	Usage: required
-	Value type: <string>
-	Definition: must be one of:
-		    "qcom,wcn3620",
-		    "qcom,wcn3660",
-		    "qcom,wcn3660b",
-		    "qcom,wcn3680"
-
-- clocks:
-	Usage: required
-	Value type: <prop-encoded-array>
-	Definition: should specify the xo clock and optionally the rf clock
-
-- clock-names:
-	Usage: required
-	Value type: <stringlist>
-	Definition: should be "xo", optionally followed by "rf"
-
-- vddxo-supply:
-- vddrfa-supply:
-- vddpa-supply:
-- vdddig-supply:
-	Usage: required
-	Value type: <phandle>
-	Definition: reference to the regulators to be held on behalf of the
-		    booting of the WCNSS core
-
-
-The wcnss node can also have an subnode named "smd-edge" that describes the SMD
-edge, channels and devices related to the WCNSS.
-See ../soc/qcom/qcom,smd.yaml for details on how to describe the SMD edge.
-
-= EXAMPLE
-The following example describes the resources needed to boot control the WCNSS,
-with attached WCN3680, as it is commonly found on MSM8974 boards.
-
-pronto@fb204000 {
-	compatible = "qcom,pronto-v2-pil";
-	reg = <0xfb204000 0x2000>, <0xfb202000 0x1000>, <0xfb21b000 0x3000>;
-	reg-names = "ccu", "dxe", "pmu";
-
-	interrupts-extended = <&intc 0 149 1>,
-			      <&wcnss_smp2p_slave 0 0>,
-			      <&wcnss_smp2p_slave 1 0>,
-			      <&wcnss_smp2p_slave 2 0>,
-			      <&wcnss_smp2p_slave 3 0>;
-	interrupt-names = "wdog", "fatal", "ready", "handover", "stop-ack";
-
-	power-domains = <&rpmpd MSM8974_VDDCX>, <&rpmpd MSM8974_VDDMX>;
-	power-domain-names = "cx", "mx";
-
-	vddpx-supply = <&pm8941_s3>;
-
-	qcom,smem-states = <&wcnss_smp2p_out 0>;
-	qcom,smem-state-names = "stop";
-
-	memory-region = <&wcnss_region>;
-
-	pinctrl-names = "default";
-	pinctrl-0 = <&wcnss_pin_a>;
-
-	iris {
-		compatible = "qcom,wcn3680";
-
-		clocks = <&rpmcc RPM_CXO_CLK_SRC>, <&rpmcc RPM_CXO_A2>;
-		clock-names = "xo", "rf";
-
-		vddxo-supply = <&pm8941_l6>;
-		vddrfa-supply = <&pm8941_l11>;
-		vddpa-supply = <&pm8941_l19>;
-		vdddig-supply = <&pm8941_s3>;
-	};
-
-	smd-edge {
-		interrupts = <0 142 1>;
-
-		qcom,ipc = <&apcs 8 17>;
-		qcom,smd-edge = <6>;
-		qcom,remote-pid = <4>;
-
-		label = "pronto";
-
-		wcnss {
-			compatible = "qcom,wcnss";
-			qcom,smd-channels = "WCNSS_CTRL";
-
-			qcom,mmio = <&pronto>;
-
-			bt {
-				compatible = "qcom,wcnss-bt";
-			};
-		};
-	};
-};
diff --git a/Documentation/devicetree/bindings/remoteproc/qcom,wcnss-pil.yaml b/Documentation/devicetree/bindings/remoteproc/qcom,wcnss-pil.yaml
new file mode 100644
index 000000000000..c22a6090220f
--- /dev/null
+++ b/Documentation/devicetree/bindings/remoteproc/qcom,wcnss-pil.yaml
@@ -0,0 +1,269 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/remoteproc/qcom,wcnss-pil.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Qualcomm WCNSS Peripheral Image Loader
+
+maintainers:
+  - Bjorn Andersson <andersson@kernel.org>
+
+description:
+  This document defines the binding for a component that loads and boots
+  firmware on the Qualcomm WCNSS core.
+
+properties:
+  compatible:
+    enum:
+      - qcom,riva-pil
+      - qcom,pronto-v1-pil
+      - qcom,pronto-v2-pil
+
+  reg:
+    maxItems: 3
+    description:
+      The base address and size of the CCU, DXE and PMU register blocks
+
+  reg-names:
+    items:
+      - const: ccu
+      - const: dxe
+      - const: pmu
+
+  interrupts:
+    minItems: 2
+    maxItems: 5
+
+  interrupt-names:
+    minItems: 2
+    items:
+      - const: wdog
+      - const: fatal
+      - const: ready
+      - const: handover
+      - const: stop-ack
+
+  firmware-name:
+    $ref: /schemas/types.yaml#/definitions/string
+    description:
+      Relative firmware image path for the WCNSS core. Defaults to
+      "wcnss.mdt".
+
+  vddpx-supply:
+    description:
+      PX regulator to be held on behalf of the booting of the WCNSS core
+
+  vddmx-supply:
+    description:
+      MX regulator to be held on behalf of the booting of the WCNSS core.
+
+  vddcx-supply:
+    description:
+      CX regulator to be held on behalf of the booting of the WCNSS core.
+
+  power-domains:
+    maxItems: 2
+
+  power-domain-names:
+    items:
+      - const: cx
+      - const: mx
+
+  qcom,smem-states:
+    $ref: /schemas/types.yaml#/definitions/phandle-array
+    description:
+      States used by the AP to signal the WCNSS core that it should shutdown
+    items:
+      - description: Stop the modem
+
+  qcom,smem-state-names:
+    description: The names of the state bits used for SMP2P output
+    items:
+      - const: stop
+
+  memory-region:
+    maxItems: 1
+    description: reserved-memory for the WCNSS core
+
+  smd-edge:
+    $ref: /schemas/remoteproc/qcom,smd-edge.yaml#
+    description:
+      Qualcomm Shared Memory subnode which represents communication edge,
+      channels and devices related to the ADSP.
+
+  iris:
+    type: object
+    description:
+      The iris subnode of the WCNSS PIL is used to describe the attached RF module
+      and its resource dependencies.
+
+    properties:
+      compatible:
+        enum:
+          - qcom,wcn3620
+          - qcom,wcn3660
+          - qcom,wcn3660b
+          - qcom,wcn3680
+
+      clocks:
+        minItems: 1
+        items:
+          - description: XO clock
+          - description: RF clock
+
+      clock-names:
+        minItems: 1
+        items:
+          - const: xo
+          - const: rf
+
+      vddxo-supply:
+        description:
+          Reference to the regulator to be held on behalf of the booting WCNSS
+          core
+
+      vddrfa-supply:
+        description:
+          Reference to the regulator to be held on behalf of the booting WCNSS
+          core
+
+      vddpa-supply:
+        description:
+          Reference to the regulator to be held on behalf of the booting WCNSS
+          core
+
+      vdddig-supply:
+        description:
+          Reference to the regulator to be held on behalf of the booting WCNSS
+          core
+
+    required:
+      - compatible
+      - clocks
+      - clock-names
+      - vddxo-supply
+      - vddrfa-supply
+      - vddpa-supply
+      - vdddig-supply
+
+    additionalProperties: false
+
+required:
+  - compatible
+  - reg
+  - reg-names
+  - interrupts
+  - interrupt-names
+  - iris
+  - vddpx-supply
+  - memory-region
+  - smd-edge
+
+additionalProperties: false
+
+allOf:
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: qcom,riva-pil
+    then:
+      required:
+        - vddcx-supply
+        - vddmx-supply
+
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - qcom,pronto-v1-pil
+              - qcom,pronto-v2-pil
+    then:
+      properties:
+        vddmx-supply:
+          deprecated: true
+          description: Deprecated for qcom,pronto-v1/2-pil
+
+        vddcx-supply:
+          deprecated: true
+          description: Deprecated for qcom,pronto-v1/2-pil
+
+      required:
+        - power-domains
+        - power-domain-names
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+    #include <dt-bindings/clock/qcom,rpmcc.h>
+    #include <dt-bindings/power/qcom-rpmpd.h>
+    pronto@a21b000 {
+        compatible = "qcom,pronto-v2-pil";
+        reg = <0x0a204000 0x2000>, <0x0a202000 0x1000>, <0x0a21b000 0x3000>;
+        reg-names = "ccu", "dxe", "pmu";
+
+        interrupts-extended = <&intc GIC_SPI 149 IRQ_TYPE_EDGE_RISING>,
+                              <&wcnss_smp2p_in 0 IRQ_TYPE_EDGE_RISING>,
+                              <&wcnss_smp2p_in 1 IRQ_TYPE_EDGE_RISING>,
+                              <&wcnss_smp2p_in 2 IRQ_TYPE_EDGE_RISING>,
+                              <&wcnss_smp2p_in 3 IRQ_TYPE_EDGE_RISING>;
+        interrupt-names = "wdog", "fatal", "ready", "handover", "stop-ack";
+
+        power-domains = <&rpmpd MSM8916_VDDCX>, <&rpmpd MSM8916_VDDMX>;
+        power-domain-names = "cx", "mx";
+
+        vddpx-supply = <&pm8916_l7>;
+
+        qcom,smem-states = <&wcnss_smp2p_out 0>;
+        qcom,smem-state-names = "stop";
+
+        memory-region = <&wcnss_region>;
+
+        pinctrl-names = "default";
+        pinctrl-0 = <&wcnss_pin_a>;
+
+        iris {
+            compatible = "qcom,wcn3620";
+            vddxo-supply = <&pm8916_l7>;
+            vddrfa-supply = <&pm8916_s3>;
+            vddpa-supply = <&pm8916_l9>;
+            vdddig-supply = <&pm8916_l5>;
+
+            clocks = <&rpmcc RPM_SMD_RF_CLK2>;
+            clock-names = "xo";
+        };
+
+        smd-edge {
+            interrupts = <GIC_SPI 142 IRQ_TYPE_EDGE_RISING>;
+
+            qcom,ipc = <&apcs 8 17>;
+            qcom,smd-edge = <6>;
+            qcom,remote-pid = <4>;
+
+            label = "pronto";
+
+            wcnss_ctrl: wcnss {
+                compatible = "qcom,wcnss";
+                qcom,smd-channels = "WCNSS_CTRL";
+
+                qcom,mmio = <&pronto>;
+
+                bluetooth {
+                    compatible = "qcom,wcnss-bt";
+                };
+
+                wifi {
+                    compatible = "qcom,wcnss-wlan";
+
+                    interrupts = <GIC_SPI 145 IRQ_TYPE_LEVEL_HIGH>,
+                                 <GIC_SPI 146 IRQ_TYPE_LEVEL_HIGH>;
+                    interrupt-names = "tx", "rx";
+
+                    qcom,smem-states = <&apps_smsm 10>, <&apps_smsm 9>;
+                    qcom,smem-state-names = "tx-enable", "tx-rings-empty";
+                };
+            };
+        };
+    };
-- 
2.37.3


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH v5 3/5] dt-bindings: remoteproc: qcom: wcnss: Add qcom,pronto compatible
  2022-09-29  5:02 [PATCH v5 0/5] remoteproc: qcom: Add support for pronto-v3 Sireesh Kodali
  2022-09-29  5:02 ` [PATCH v5 1/5] remoteproc: qcom: qcom_wcnss: " Sireesh Kodali
  2022-09-29  5:02 ` [PATCH v5 2/5] dt-bindings: remoteproc: qcom: Convert wcnss documentation to YAML Sireesh Kodali
@ 2022-09-29  5:02 ` Sireesh Kodali
  2022-09-29  5:02 ` [PATCH v5 4/5] dt-bindings: remoteproc: qcom: wcnss: Add compatible for pronto v3 Sireesh Kodali
  2022-09-29  5:02 ` [PATCH v5 5/5] dt-bindings: remoteproc: wcnss-pil: Make supplies optionally required Sireesh Kodali
  4 siblings, 0 replies; 10+ messages in thread
From: Sireesh Kodali @ 2022-09-29  5:02 UTC (permalink / raw)
  To: devicetree, linux-arm-msm, linux-remoteproc,
	~postmarketos/upstreaming, linux-kernel
  Cc: andersson, krzysztof.kozlowski+dt, Sireesh Kodali,
	Krzysztof Kozlowski, Andy Gross, Bjorn Andersson, Konrad Dybcio,
	Mathieu Poirier, Rob Herring

This is not a fallback compatible, it must be present in addition to
"qcom,pronto-v*". It is also not documented in qcom,wcnss-pil.txt.  This
is the reason for documenting it in a separate commit.

This compatible is used in the wcn36xx driver to determine which
register must be accessed. However it isn't immediately clear why the
wcn36xx driver relies on this extra compatible string rather than just
looking for "qcom,pronto-v*".

Signed-off-by: Sireesh Kodali <sireeshkodali1@gmail.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 .../bindings/remoteproc/qcom,wcnss-pil.yaml       | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/Documentation/devicetree/bindings/remoteproc/qcom,wcnss-pil.yaml b/Documentation/devicetree/bindings/remoteproc/qcom,wcnss-pil.yaml
index c22a6090220f..0eb2617e3482 100644
--- a/Documentation/devicetree/bindings/remoteproc/qcom,wcnss-pil.yaml
+++ b/Documentation/devicetree/bindings/remoteproc/qcom,wcnss-pil.yaml
@@ -15,10 +15,15 @@ description:
 
 properties:
   compatible:
-    enum:
-      - qcom,riva-pil
-      - qcom,pronto-v1-pil
-      - qcom,pronto-v2-pil
+    description:
+      Append "qcom,pronto" if the device is actually pronto, and not riva
+    oneOf:
+      - items:
+          - enum:
+              - qcom,pronto-v1-pil
+              - qcom,pronto-v2-pil
+          - const: qcom,pronto
+      - const: qcom,riva-pil
 
   reg:
     maxItems: 3
@@ -200,7 +205,7 @@ examples:
     #include <dt-bindings/clock/qcom,rpmcc.h>
     #include <dt-bindings/power/qcom-rpmpd.h>
     pronto@a21b000 {
-        compatible = "qcom,pronto-v2-pil";
+        compatible = "qcom,pronto-v2-pil", "qcom,pronto";
         reg = <0x0a204000 0x2000>, <0x0a202000 0x1000>, <0x0a21b000 0x3000>;
         reg-names = "ccu", "dxe", "pmu";
 
-- 
2.37.3


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH v5 4/5] dt-bindings: remoteproc: qcom: wcnss: Add compatible for pronto v3
  2022-09-29  5:02 [PATCH v5 0/5] remoteproc: qcom: Add support for pronto-v3 Sireesh Kodali
                   ` (2 preceding siblings ...)
  2022-09-29  5:02 ` [PATCH v5 3/5] dt-bindings: remoteproc: qcom: wcnss: Add qcom,pronto compatible Sireesh Kodali
@ 2022-09-29  5:02 ` Sireesh Kodali
  2022-09-29  5:02 ` [PATCH v5 5/5] dt-bindings: remoteproc: wcnss-pil: Make supplies optionally required Sireesh Kodali
  4 siblings, 0 replies; 10+ messages in thread
From: Sireesh Kodali @ 2022-09-29  5:02 UTC (permalink / raw)
  To: devicetree, linux-arm-msm, linux-remoteproc,
	~postmarketos/upstreaming, linux-kernel
  Cc: andersson, krzysztof.kozlowski+dt, Sireesh Kodali,
	Krzysztof Kozlowski, Andy Gross, Bjorn Andersson, Konrad Dybcio,
	Mathieu Poirier, Rob Herring

The pronto v3 remoteproc is similar to pronto v2. It is found on the
MSM8953 platform, which is used by SDM450, SDM625, SDM626, APQ8053 and
other SoCs. Since the configuration is same on all SoCs, a single
compatible is used.

Signed-off-by: Sireesh Kodali <sireeshkodali1@gmail.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 .../bindings/remoteproc/qcom,wcnss-pil.yaml      | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/Documentation/devicetree/bindings/remoteproc/qcom,wcnss-pil.yaml b/Documentation/devicetree/bindings/remoteproc/qcom,wcnss-pil.yaml
index 0eb2617e3482..2ba2b6cf11fb 100644
--- a/Documentation/devicetree/bindings/remoteproc/qcom,wcnss-pil.yaml
+++ b/Documentation/devicetree/bindings/remoteproc/qcom,wcnss-pil.yaml
@@ -22,6 +22,7 @@ properties:
           - enum:
               - qcom,pronto-v1-pil
               - qcom,pronto-v2-pil
+              - qcom,pronto-v3-pil
           - const: qcom,pronto
       - const: qcom,riva-pil
 
@@ -199,6 +200,21 @@ allOf:
         - power-domains
         - power-domain-names
 
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - qcom,pronto-v3-pil
+    then:
+      properties:
+        vddmx-supply: false
+        vddcx-supply: false
+
+      required:
+        - power-domains
+        - power-domain-names
+
 examples:
   - |
     #include <dt-bindings/interrupt-controller/arm-gic.h>
-- 
2.37.3


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH v5 5/5] dt-bindings: remoteproc: wcnss-pil: Make supplies optionally required
  2022-09-29  5:02 [PATCH v5 0/5] remoteproc: qcom: Add support for pronto-v3 Sireesh Kodali
                   ` (3 preceding siblings ...)
  2022-09-29  5:02 ` [PATCH v5 4/5] dt-bindings: remoteproc: qcom: wcnss: Add compatible for pronto v3 Sireesh Kodali
@ 2022-09-29  5:02 ` Sireesh Kodali
  2022-09-29  9:19   ` Krzysztof Kozlowski
  4 siblings, 1 reply; 10+ messages in thread
From: Sireesh Kodali @ 2022-09-29  5:02 UTC (permalink / raw)
  To: devicetree, linux-arm-msm, linux-remoteproc,
	~postmarketos/upstreaming, linux-kernel
  Cc: andersson, krzysztof.kozlowski+dt, Sireesh Kodali, Andy Gross,
	Bjorn Andersson, Konrad Dybcio, Mathieu Poirier, Rob Herring

On MSM8974, power domains are not yet supported. The platform uses
regulators. This patch marks either the power-domains or *-supply as
required (instead of always requiring the power domains).

Signed-off-by: Sireesh Kodali <sireeshkodali1@gmail.com>
---
 .../devicetree/bindings/remoteproc/qcom,wcnss-pil.yaml | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/Documentation/devicetree/bindings/remoteproc/qcom,wcnss-pil.yaml b/Documentation/devicetree/bindings/remoteproc/qcom,wcnss-pil.yaml
index 2ba2b6cf11fb..45eb42bd3c2c 100644
--- a/Documentation/devicetree/bindings/remoteproc/qcom,wcnss-pil.yaml
+++ b/Documentation/devicetree/bindings/remoteproc/qcom,wcnss-pil.yaml
@@ -196,9 +196,13 @@ allOf:
           deprecated: true
           description: Deprecated for qcom,pronto-v1/2-pil
 
-      required:
-        - power-domains
-        - power-domain-names
+      oneOf:
+        - required:
+            - power-domains
+            - power-domain-names
+        - required:
+            - vddmx-supply
+            - vddcx-supply
 
   - if:
       properties:
-- 
2.37.3


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH v5 2/5] dt-bindings: remoteproc: qcom: Convert wcnss documentation to YAML
  2022-09-29  5:02 ` [PATCH v5 2/5] dt-bindings: remoteproc: qcom: Convert wcnss documentation to YAML Sireesh Kodali
@ 2022-09-29  9:18   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 10+ messages in thread
From: Krzysztof Kozlowski @ 2022-09-29  9:18 UTC (permalink / raw)
  To: Sireesh Kodali, devicetree, linux-arm-msm, linux-remoteproc,
	~postmarketos/upstreaming, linux-kernel
  Cc: andersson, krzysztof.kozlowski+dt, Andy Gross, Bjorn Andersson,
	Konrad Dybcio, Mathieu Poirier, Rob Herring

On 29/09/2022 07:02, Sireesh Kodali wrote:
> This is a direct conversion of the existing txt documentation to YAML.
> It is in preparation for the addition of pronto-v3 to the docs. This
> patch doesn't document any of the existing subnodes/properties that are
> not documented in the existing txt file. That is done in a separate
> patch.
> 
> Signed-off-by: Sireesh Kodali <sireeshkodali1@gmail.com>
> ---


Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v5 5/5] dt-bindings: remoteproc: wcnss-pil: Make supplies optionally required
  2022-09-29  5:02 ` [PATCH v5 5/5] dt-bindings: remoteproc: wcnss-pil: Make supplies optionally required Sireesh Kodali
@ 2022-09-29  9:19   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 10+ messages in thread
From: Krzysztof Kozlowski @ 2022-09-29  9:19 UTC (permalink / raw)
  To: Sireesh Kodali, devicetree, linux-arm-msm, linux-remoteproc,
	~postmarketos/upstreaming, linux-kernel
  Cc: andersson, krzysztof.kozlowski+dt, Andy Gross, Bjorn Andersson,
	Konrad Dybcio, Mathieu Poirier, Rob Herring

On 29/09/2022 07:02, Sireesh Kodali wrote:
> On MSM8974, power domains are not yet supported. The platform uses
> regulators. This patch marks either the power-domains or *-supply as
> required (instead of always requiring the power domains).
> 
> Signed-off-by: Sireesh Kodali <sireeshkodali1@gmail.com>


Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v5 1/5] remoteproc: qcom: qcom_wcnss: Add support for pronto-v3
  2022-09-29  5:02 ` [PATCH v5 1/5] remoteproc: qcom: qcom_wcnss: " Sireesh Kodali
@ 2022-09-29  9:39   ` Stephan Gerhold
  2022-09-30  4:28     ` Sireesh Kodali
  0 siblings, 1 reply; 10+ messages in thread
From: Stephan Gerhold @ 2022-09-29  9:39 UTC (permalink / raw)
  To: Sireesh Kodali
  Cc: devicetree, linux-arm-msm, linux-remoteproc,
	~postmarketos/upstreaming, linux-kernel, andersson,
	krzysztof.kozlowski+dt, Vladimir Lypak, Andy Gross,
	Bjorn Andersson, Konrad Dybcio, Mathieu Poirier

On Thu, Sep 29, 2022 at 10:32:05AM +0530, Sireesh Kodali wrote:
> From: Vladimir Lypak <vladimir.lypak@gmail.com>
> 
> Pronto-v3 is similar to pronto-v2. It requires two power domains, and it
> requires the xo clock. It is used on the MSM8953 platform.
> 
> Signed-off-by: Vladimir Lypak <vladimir.lypak@gmail.com>
> Signed-off-by: Sireesh Kodali <sireeshkodali1@gmail.com>
> ---
>  drivers/remoteproc/qcom_wcnss.c | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
> 
> diff --git a/drivers/remoteproc/qcom_wcnss.c b/drivers/remoteproc/qcom_wcnss.c
> index 68f37296b151..ff18bfae5eb6 100644
> --- a/drivers/remoteproc/qcom_wcnss.c
> +++ b/drivers/remoteproc/qcom_wcnss.c
> @@ -141,6 +141,18 @@ static const struct wcnss_data pronto_v2_data = {
>  	.num_vregs = 1,
>  };
>  
> +static const struct wcnss_data pronto_v3_data = {
> +	.pmu_offset = 0x1004,
> +	.spare_offset = 0x1088,
> +
> +	.pd_names = { "mx", "cx" },
> +	.vregs = (struct wcnss_vreg_info[]) {
> +		{ "vddpx", 1800000, 1800000, 0 },
> +	},
> +	.num_pd_vregs = 2,

Can you try dropping this line? num_pd_vregs = 2 means:
"If power domains are specified in the device tree, skip the first two
 entries in 'vregs'." For pronto-v1/v2 it would skip the "vddmx" and
"vddcx" entry, since those are already covered by the power domains.

However, since pronto-v3 should always have power domains in DT and
"vregs" has just a single entry this means that it would always access
the array out of bounds at runtime and request some garbage regulator.
I'm confused why this does not crash more spectacularly...

Thanks,
Stephan

> +	.num_vregs = 1,
> +};
> +
>  static int wcnss_load(struct rproc *rproc, const struct firmware *fw)
>  {
>  	struct qcom_wcnss *wcnss = (struct qcom_wcnss *)rproc->priv;
> @@ -675,6 +687,7 @@ static const struct of_device_id wcnss_of_match[] = {
>  	{ .compatible = "qcom,riva-pil", &riva_data },
>  	{ .compatible = "qcom,pronto-v1-pil", &pronto_v1_data },
>  	{ .compatible = "qcom,pronto-v2-pil", &pronto_v2_data },
> +	{ .compatible = "qcom,pronto-v3-pil", &pronto_v3_data },
>  	{ },
>  };
>  MODULE_DEVICE_TABLE(of, wcnss_of_match);
> -- 
> 2.37.3
> 

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v5 1/5] remoteproc: qcom: qcom_wcnss: Add support for pronto-v3
  2022-09-29  9:39   ` Stephan Gerhold
@ 2022-09-30  4:28     ` Sireesh Kodali
  0 siblings, 0 replies; 10+ messages in thread
From: Sireesh Kodali @ 2022-09-30  4:28 UTC (permalink / raw)
  To: Stephan Gerhold
  Cc: devicetree, linux-arm-msm, linux-remoteproc,
	~postmarketos/upstreaming, linux-kernel, andersson,
	krzysztof.kozlowski+dt, Vladimir Lypak, Andy Gross,
	Bjorn Andersson, Konrad Dybcio, Mathieu Poirier

On Thu Sep 29, 2022 at 3:09 PM IST, Stephan Gerhold wrote:
> On Thu, Sep 29, 2022 at 10:32:05AM +0530, Sireesh Kodali wrote:
> > From: Vladimir Lypak <vladimir.lypak@gmail.com>
> > 
> > Pronto-v3 is similar to pronto-v2. It requires two power domains, and it
> > requires the xo clock. It is used on the MSM8953 platform.
> > 
> > Signed-off-by: Vladimir Lypak <vladimir.lypak@gmail.com>
> > Signed-off-by: Sireesh Kodali <sireeshkodali1@gmail.com>
> > ---
> >  drivers/remoteproc/qcom_wcnss.c | 13 +++++++++++++
> >  1 file changed, 13 insertions(+)
> > 
> > diff --git a/drivers/remoteproc/qcom_wcnss.c b/drivers/remoteproc/qcom_wcnss.c
> > index 68f37296b151..ff18bfae5eb6 100644
> > --- a/drivers/remoteproc/qcom_wcnss.c
> > +++ b/drivers/remoteproc/qcom_wcnss.c
> > @@ -141,6 +141,18 @@ static const struct wcnss_data pronto_v2_data = {
> >  	.num_vregs = 1,
> >  };
> >  
> > +static const struct wcnss_data pronto_v3_data = {
> > +	.pmu_offset = 0x1004,
> > +	.spare_offset = 0x1088,
> > +
> > +	.pd_names = { "mx", "cx" },
> > +	.vregs = (struct wcnss_vreg_info[]) {
> > +		{ "vddpx", 1800000, 1800000, 0 },
> > +	},
> > +	.num_pd_vregs = 2,
>
> Can you try dropping this line? num_pd_vregs = 2 means:
> "If power domains are specified in the device tree, skip the first two
>  entries in 'vregs'." For pronto-v1/v2 it would skip the "vddmx" and
> "vddcx" entry, since those are already covered by the power domains.
>
> However, since pronto-v3 should always have power domains in DT and
> "vregs" has just a single entry this means that it would always access
> the array out of bounds at runtime and request some garbage regulator.
> I'm confused why this does not crash more spectacularly...

Indeed it should have crashed, thanks for catching this. Will be fixed
in v6
>
> Thanks,
> Stephan
>
> > +	.num_vregs = 1,
> > +};
> > +
> >  static int wcnss_load(struct rproc *rproc, const struct firmware *fw)
> >  {
> >  	struct qcom_wcnss *wcnss = (struct qcom_wcnss *)rproc->priv;
> > @@ -675,6 +687,7 @@ static const struct of_device_id wcnss_of_match[] = {
> >  	{ .compatible = "qcom,riva-pil", &riva_data },
> >  	{ .compatible = "qcom,pronto-v1-pil", &pronto_v1_data },
> >  	{ .compatible = "qcom,pronto-v2-pil", &pronto_v2_data },
> > +	{ .compatible = "qcom,pronto-v3-pil", &pronto_v3_data },
> >  	{ },
> >  };
> >  MODULE_DEVICE_TABLE(of, wcnss_of_match);
> > -- 
> > 2.37.3
> > 


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2022-09-30  4:28 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-29  5:02 [PATCH v5 0/5] remoteproc: qcom: Add support for pronto-v3 Sireesh Kodali
2022-09-29  5:02 ` [PATCH v5 1/5] remoteproc: qcom: qcom_wcnss: " Sireesh Kodali
2022-09-29  9:39   ` Stephan Gerhold
2022-09-30  4:28     ` Sireesh Kodali
2022-09-29  5:02 ` [PATCH v5 2/5] dt-bindings: remoteproc: qcom: Convert wcnss documentation to YAML Sireesh Kodali
2022-09-29  9:18   ` Krzysztof Kozlowski
2022-09-29  5:02 ` [PATCH v5 3/5] dt-bindings: remoteproc: qcom: wcnss: Add qcom,pronto compatible Sireesh Kodali
2022-09-29  5:02 ` [PATCH v5 4/5] dt-bindings: remoteproc: qcom: wcnss: Add compatible for pronto v3 Sireesh Kodali
2022-09-29  5:02 ` [PATCH v5 5/5] dt-bindings: remoteproc: wcnss-pil: Make supplies optionally required Sireesh Kodali
2022-09-29  9:19   ` Krzysztof Kozlowski

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.