devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/8] Modem support for MSM8226
@ 2023-01-12 20:26 Matti Lehtimäki
  2023-01-12 20:26 ` [PATCH 1/8] dt-bindings: remoteproc: qcom,msm8916-mss-pil: Add MSM8226 Matti Lehtimäki
                   ` (5 more replies)
  0 siblings, 6 replies; 12+ messages in thread
From: Matti Lehtimäki @ 2023-01-12 20:26 UTC (permalink / raw)
  To: linux-arm-msm
  Cc: ~postmarketos/upstreaming, phone-devel, Matti Lehtimäki,
	Bjorn Andersson, devicetree, Konrad Dybcio, linux-kernel,
	linux-remoteproc, Stephan Gerhold

This series adds support for modem remoteproc found on MSM8226.
It also adds needed device tree nodes and enables modem used for
location service on matisse-wifi.

Luca Weiss (3):
  remoteproc: qcom_q6v5_mss: Handle platforms with only single power
    domain
  remoteproc: qcom_q6v5_mss: Add modem support on MSM8226
  ARM: dts: qcom: msm8226: Add modem remoteproc node

Matti Lehtimäki (5):
  dt-bindings: remoteproc: qcom,msm8916-mss-pil: Add MSM8226
  dt-bindings: mfd: qcom,tcsr: Add compatible for MSM8226
  ARM: dts: qcom: msm8226: Add node for TCSR halt regs
  ARM: dts: qcom: msm8226: Add smsm node
  ARM: dts: qcom: apq8026-samsung-matisse-wifi: Enable modem

 .../devicetree/bindings/mfd/qcom,tcsr.yaml    |   1 +
 .../remoteproc/qcom,msm8916-mss-pil.yaml      |  41 +++++-
 .../dts/qcom-apq8026-samsung-matisse-wifi.dts |  13 +-
 arch/arm/boot/dts/qcom-msm8226.dtsi           | 127 ++++++++++++++++
 drivers/remoteproc/qcom_q6v5_mss.c            | 137 ++++++++++++++++++
 5 files changed, 313 insertions(+), 6 deletions(-)

-- 
2.34.1


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

* [PATCH 1/8] dt-bindings: remoteproc: qcom,msm8916-mss-pil: Add MSM8226
  2023-01-12 20:26 [PATCH 0/8] Modem support for MSM8226 Matti Lehtimäki
@ 2023-01-12 20:26 ` Matti Lehtimäki
  2023-01-12 22:03   ` Stephan Gerhold
  2023-01-13  8:40   ` Krzysztof Kozlowski
  2023-01-12 20:26 ` [PATCH 4/8] dt-bindings: mfd: qcom,tcsr: Add compatible for MSM8226 Matti Lehtimäki
                   ` (4 subsequent siblings)
  5 siblings, 2 replies; 12+ messages in thread
From: Matti Lehtimäki @ 2023-01-12 20:26 UTC (permalink / raw)
  To: linux-arm-msm
  Cc: ~postmarketos/upstreaming, phone-devel, Matti Lehtimäki,
	Andy Gross, Bjorn Andersson, Konrad Dybcio, Mathieu Poirier,
	Rob Herring, Krzysztof Kozlowski, Stephan Gerhold,
	linux-remoteproc, devicetree, linux-kernel

Adds support for platforms with only single power domain.
Adds support for external power block headswitch (BHS) registers

Signed-off-by: Matti Lehtimäki <matti.lehtimaki@gmail.com>
---
 .../remoteproc/qcom,msm8916-mss-pil.yaml      | 41 +++++++++++++++++--
 1 file changed, 37 insertions(+), 4 deletions(-)

diff --git a/Documentation/devicetree/bindings/remoteproc/qcom,msm8916-mss-pil.yaml b/Documentation/devicetree/bindings/remoteproc/qcom,msm8916-mss-pil.yaml
index 6e6e69ad9cd7..6a921f2711b2 100644
--- a/Documentation/devicetree/bindings/remoteproc/qcom,msm8916-mss-pil.yaml
+++ b/Documentation/devicetree/bindings/remoteproc/qcom,msm8916-mss-pil.yaml
@@ -17,6 +17,7 @@ properties:
   compatible:
     oneOf:
       - enum:
+          - qcom,msm8226-mss-pil
           - qcom,msm8909-mss-pil
           - qcom,msm8916-mss-pil
           - qcom,msm8953-mss-pil
@@ -70,16 +71,17 @@ properties:
     items:
       - description: CX proxy power domain (control handed over after startup)
       - description: MX proxy power domain (control handed over after startup)
+                     (not valid for qcom,msm8226-mss-pil)
       - description: MSS proxy power domain (control handed over after startup)
                      (only valid for qcom,msm8953-mss-pil)
-    minItems: 2
+    minItems: 1
 
   power-domain-names:
     items:
       - const: cx
-      - const: mx
+      - const: mx # not valid for qcom,msm8226-mss-pil
       - const: mss # only valid for qcom,msm8953-mss-pil
-    minItems: 2
+    minItems: 1
 
   pll-supply:
     description: PLL proxy supply (control handed over after startup)
@@ -106,6 +108,15 @@ properties:
     items:
       - const: stop
 
+  qcom,ext-bhs-reg:
+    $ref: /schemas/types.yaml#/definitions/phandle-array
+    description: External power block headswitch (BHS) register
+                 (only valid for qcom,msm8226-mss-pil)
+    items:
+      - items:
+          - description: phandle to external BHS syscon region
+          - description: offset to the external BHS register
+
   qcom,halt-regs:
     $ref: /schemas/types.yaml#/definitions/phandle-array
     description:
@@ -205,13 +216,35 @@ allOf:
       required:
         - power-domains
         - power-domain-names
-    else:
+
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - qcom,msm8909-mss-pil
+              - qcom,msm8916-mss-pil
+              - qcom,msm8974-mss-pil
+    then:
       properties:
         power-domains:
           maxItems: 2
         power-domain-names:
           maxItems: 2
 
+  - if:
+      properties:
+        compatible:
+          const: qcom,msm8226-mss-pil
+    then:
+      properties:
+        power-domains:
+          maxItems: 1
+        power-domain-names:
+          maxItems: 1
+      required:
+        - qcom,ext-bhs-reg
+
   - if:
       properties:
         compatible:
-- 
2.34.1


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

* [PATCH 4/8] dt-bindings: mfd: qcom,tcsr: Add compatible for MSM8226
  2023-01-12 20:26 [PATCH 0/8] Modem support for MSM8226 Matti Lehtimäki
  2023-01-12 20:26 ` [PATCH 1/8] dt-bindings: remoteproc: qcom,msm8916-mss-pil: Add MSM8226 Matti Lehtimäki
@ 2023-01-12 20:26 ` Matti Lehtimäki
  2023-01-13  8:41   ` Krzysztof Kozlowski
  2023-01-13 14:49   ` Lee Jones
  2023-01-12 20:26 ` [PATCH 5/8] ARM: dts: qcom: msm8226: Add node for TCSR halt regs Matti Lehtimäki
                   ` (3 subsequent siblings)
  5 siblings, 2 replies; 12+ messages in thread
From: Matti Lehtimäki @ 2023-01-12 20:26 UTC (permalink / raw)
  To: linux-arm-msm
  Cc: ~postmarketos/upstreaming, phone-devel, Matti Lehtimäki,
	Andy Gross, Bjorn Andersson, Konrad Dybcio, Lee Jones,
	Rob Herring, Krzysztof Kozlowski, devicetree, linux-kernel

Document the qcom,msm8226-tcsr compatible.

Signed-off-by: Matti Lehtimäki <matti.lehtimaki@gmail.com>
---
 Documentation/devicetree/bindings/mfd/qcom,tcsr.yaml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/mfd/qcom,tcsr.yaml b/Documentation/devicetree/bindings/mfd/qcom,tcsr.yaml
index adcae6c007d9..d463fb47278f 100644
--- a/Documentation/devicetree/bindings/mfd/qcom,tcsr.yaml
+++ b/Documentation/devicetree/bindings/mfd/qcom,tcsr.yaml
@@ -31,6 +31,7 @@ properties:
           - qcom,tcsr-ipq6018
           - qcom,tcsr-ipq8064
           - qcom,tcsr-mdm9615
+          - qcom,tcsr-msm8226
           - qcom,tcsr-msm8660
           - qcom,tcsr-msm8916
           - qcom,tcsr-msm8953
-- 
2.34.1


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

* [PATCH 5/8] ARM: dts: qcom: msm8226: Add node for TCSR halt regs
  2023-01-12 20:26 [PATCH 0/8] Modem support for MSM8226 Matti Lehtimäki
  2023-01-12 20:26 ` [PATCH 1/8] dt-bindings: remoteproc: qcom,msm8916-mss-pil: Add MSM8226 Matti Lehtimäki
  2023-01-12 20:26 ` [PATCH 4/8] dt-bindings: mfd: qcom,tcsr: Add compatible for MSM8226 Matti Lehtimäki
@ 2023-01-12 20:26 ` Matti Lehtimäki
  2023-01-12 20:26 ` [PATCH 6/8] ARM: dts: qcom: msm8226: Add smsm node Matti Lehtimäki
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 12+ messages in thread
From: Matti Lehtimäki @ 2023-01-12 20:26 UTC (permalink / raw)
  To: linux-arm-msm
  Cc: ~postmarketos/upstreaming, phone-devel, Matti Lehtimäki,
	Andy Gross, Bjorn Andersson, Konrad Dybcio, Rob Herring,
	Krzysztof Kozlowski, devicetree, linux-kernel

Add a syscon device node for the TCSR halt regs needed by
modem and other remoteprocs.

Signed-off-by: Matti Lehtimäki <matti.lehtimaki@gmail.com>
---
 arch/arm/boot/dts/qcom-msm8226.dtsi | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/arch/arm/boot/dts/qcom-msm8226.dtsi b/arch/arm/boot/dts/qcom-msm8226.dtsi
index 4cba25dad8d6..394662cbf282 100644
--- a/arch/arm/boot/dts/qcom-msm8226.dtsi
+++ b/arch/arm/boot/dts/qcom-msm8226.dtsi
@@ -590,6 +590,11 @@ tcsr_mutex: hwlock@fd484000 {
 			#hwlock-cells = <1>;
 		};
 
+		tcsr_regs_1: syscon@fd485000 {
+			compatible = "qcom,msm8226-tcsr", "syscon";
+			reg = <0xfd485000 0x1000>;
+		};
+
 		adsp: remoteproc@fe200000 {
 			compatible = "qcom,msm8226-adsp-pil";
 			reg = <0xfe200000 0x100>;
-- 
2.34.1


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

* [PATCH 6/8] ARM: dts: qcom: msm8226: Add smsm node
  2023-01-12 20:26 [PATCH 0/8] Modem support for MSM8226 Matti Lehtimäki
                   ` (2 preceding siblings ...)
  2023-01-12 20:26 ` [PATCH 5/8] ARM: dts: qcom: msm8226: Add node for TCSR halt regs Matti Lehtimäki
@ 2023-01-12 20:26 ` Matti Lehtimäki
  2023-01-12 20:26 ` [PATCH 7/8] ARM: dts: qcom: msm8226: Add modem remoteproc node Matti Lehtimäki
  2023-01-12 20:26 ` [PATCH 8/8] ARM: dts: qcom: apq8026-samsung-matisse-wifi: Enable modem Matti Lehtimäki
  5 siblings, 0 replies; 12+ messages in thread
From: Matti Lehtimäki @ 2023-01-12 20:26 UTC (permalink / raw)
  To: linux-arm-msm
  Cc: ~postmarketos/upstreaming, phone-devel, Matti Lehtimäki,
	Luca Weiss, Andy Gross, Bjorn Andersson, Konrad Dybcio,
	Rob Herring, Krzysztof Kozlowski, devicetree, linux-kernel

Adds smsm node for remoteproc cores.

Co-developed-by: Luca Weiss <luca@z3ntu.xyz>
Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
Signed-off-by: Matti Lehtimäki <matti.lehtimaki@gmail.com>
---
 arch/arm/boot/dts/qcom-msm8226.dtsi | 36 +++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)

diff --git a/arch/arm/boot/dts/qcom-msm8226.dtsi b/arch/arm/boot/dts/qcom-msm8226.dtsi
index 394662cbf282..2639167c8976 100644
--- a/arch/arm/boot/dts/qcom-msm8226.dtsi
+++ b/arch/arm/boot/dts/qcom-msm8226.dtsi
@@ -140,6 +140,42 @@ adsp_smp2p_in: slave-kernel {
 		};
 	};
 
+	smsm {
+		compatible = "qcom,smsm";
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		qcom,ipc-1 = <&apcs 8 13>;
+		qcom,ipc-2 = <&apcs 8 9>;
+		qcom,ipc-3 = <&apcs 8 19>;
+
+		apps_smsm: apps@0 {
+			reg = <0>;
+			#qcom,smem-state-cells = <1>;
+		};
+
+		modem_smsm: modem@1 {
+			reg = <1>;
+			interrupts = <GIC_SPI 26 IRQ_TYPE_EDGE_RISING>;
+			interrupt-controller;
+			#interrupt-cells = <2>;
+		};
+
+		adsp_smsm: adsp@2 {
+			reg = <2>;
+			interrupts = <GIC_SPI 157 IRQ_TYPE_EDGE_RISING>;
+			interrupt-controller;
+			#interrupt-cells = <2>;
+		};
+
+		wcnss_smsm: wcnss@7 {
+			reg = <7>;
+			interrupts = <GIC_SPI 144 IRQ_TYPE_EDGE_RISING>;
+			interrupt-controller;
+			#interrupt-cells = <2>;
+		};
+	};
+
 	soc: soc {
 		compatible = "simple-bus";
 		#address-cells = <1>;
-- 
2.34.1


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

* [PATCH 7/8] ARM: dts: qcom: msm8226: Add modem remoteproc node
  2023-01-12 20:26 [PATCH 0/8] Modem support for MSM8226 Matti Lehtimäki
                   ` (3 preceding siblings ...)
  2023-01-12 20:26 ` [PATCH 6/8] ARM: dts: qcom: msm8226: Add smsm node Matti Lehtimäki
@ 2023-01-12 20:26 ` Matti Lehtimäki
  2023-01-12 22:24   ` Stephan Gerhold
  2023-01-12 20:26 ` [PATCH 8/8] ARM: dts: qcom: apq8026-samsung-matisse-wifi: Enable modem Matti Lehtimäki
  5 siblings, 1 reply; 12+ messages in thread
From: Matti Lehtimäki @ 2023-01-12 20:26 UTC (permalink / raw)
  To: linux-arm-msm
  Cc: ~postmarketos/upstreaming, phone-devel, Luca Weiss,
	Matti Lehtimäki, Andy Gross, Bjorn Andersson, Konrad Dybcio,
	Rob Herring, Krzysztof Kozlowski, devicetree, linux-kernel

From: Luca Weiss <luca@z3ntu.xyz>

Add a node for the modem remoteproc found on MSM8226.

Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
Co-developed-by: Matti Lehtimäki <matti.lehtimaki@gmail.com>
Signed-off-by: Matti Lehtimäki <matti.lehtimaki@gmail.com>
---
 arch/arm/boot/dts/qcom-msm8226.dtsi | 86 +++++++++++++++++++++++++++++
 1 file changed, 86 insertions(+)

diff --git a/arch/arm/boot/dts/qcom-msm8226.dtsi b/arch/arm/boot/dts/qcom-msm8226.dtsi
index 2639167c8976..34ea9cf46ae0 100644
--- a/arch/arm/boot/dts/qcom-msm8226.dtsi
+++ b/arch/arm/boot/dts/qcom-msm8226.dtsi
@@ -56,6 +56,16 @@ smem_region: smem@3000000 {
 			no-map;
 		};
 
+		mpss_region: mpss@8000000 {
+			reg = <0x08000000 0x5100000>;
+			no-map;
+		};
+
+		mba_region: mba@d100000 {
+			reg = <0x0d100000 0x100000>;
+			no-map;
+		};
+
 		adsp_region: adsp@dc00000 {
 			reg = <0x0dc00000 0x1900000>;
 			no-map;
@@ -140,6 +150,31 @@ adsp_smp2p_in: slave-kernel {
 		};
 	};
 
+	smp2p-modem {
+		compatible = "qcom,smp2p";
+		qcom,smem = <435>, <428>;
+
+		interrupt-parent = <&intc>;
+		interrupts = <GIC_SPI 27 IRQ_TYPE_EDGE_RISING>;
+
+		qcom,ipc = <&apcs 8 14>;
+
+		qcom,local-pid = <0>;
+		qcom,remote-pid = <1>;
+
+		modem_smp2p_out: master-kernel {
+			qcom,entry-name = "master-kernel";
+			#qcom,smem-state-cells = <1>;
+		};
+
+		modem_smp2p_in: slave-kernel {
+			qcom,entry-name = "slave-kernel";
+
+			interrupt-controller;
+			#interrupt-cells = <2>;
+		};
+	};
+
 	smsm {
 		compatible = "qcom,smsm";
 		#address-cells = <1>;
@@ -620,6 +655,57 @@ rpm_msg_ram: sram@fc428000 {
 			reg = <0xfc428000 0x4000>;
 		};
 
+		modem: remoteproc@fc880000 {
+			compatible = "qcom,msm8226-mss-pil";
+			reg = <0xfc880000 0x100>,
+			      <0xfc820000 0x020>;
+			reg-names = "qdsp6", "rmb";
+
+			interrupts-extended = <&intc GIC_SPI 24 IRQ_TYPE_EDGE_RISING>,
+					      <&modem_smp2p_in 0 IRQ_TYPE_EDGE_RISING>,
+					      <&modem_smp2p_in 1 IRQ_TYPE_EDGE_RISING>,
+					      <&modem_smp2p_in 2 IRQ_TYPE_EDGE_RISING>,
+					      <&modem_smp2p_in 3 IRQ_TYPE_EDGE_RISING>;
+			interrupt-names = "wdog", "fatal", "ready", "handover", "stop-ack";
+
+			clocks = <&gcc GCC_MSS_Q6_BIMC_AXI_CLK>,
+				 <&gcc GCC_MSS_CFG_AHB_CLK>,
+				 <&gcc GCC_BOOT_ROM_AHB_CLK>,
+				 <&xo_board>;
+			clock-names = "iface", "bus", "mem", "xo";
+
+			resets = <&gcc GCC_MSS_RESTART>;
+			reset-names = "mss_restart";
+
+			power-domains = <&rpmpd MSM8226_VDDCX>;
+			power-domain-names = "cx";
+
+			qcom,ext-bhs-reg = <&tcsr_regs_1 0x194>;
+			qcom,halt-regs = <&tcsr_regs_1 0x180 0x200 0x280>;
+
+			qcom,smem-states = <&modem_smp2p_out 0>;
+			qcom,smem-state-names = "stop";
+
+			status = "disabled";
+
+			mba {
+				memory-region = <&mba_region>;
+			};
+
+			mpss {
+				memory-region = <&mpss_region>;
+			};
+
+			smd-edge {
+				interrupts = <GIC_SPI 25 IRQ_TYPE_EDGE_RISING>;
+
+				qcom,ipc = <&apcs 8 12>;
+				qcom,smd-edge = <0>;
+
+				label = "modem";
+			};
+		};
+
 		tcsr_mutex: hwlock@fd484000 {
 			compatible = "qcom,msm8226-tcsr-mutex", "qcom,tcsr-mutex";
 			reg = <0xfd484000 0x1000>;
-- 
2.34.1


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

* [PATCH 8/8] ARM: dts: qcom: apq8026-samsung-matisse-wifi: Enable modem
  2023-01-12 20:26 [PATCH 0/8] Modem support for MSM8226 Matti Lehtimäki
                   ` (4 preceding siblings ...)
  2023-01-12 20:26 ` [PATCH 7/8] ARM: dts: qcom: msm8226: Add modem remoteproc node Matti Lehtimäki
@ 2023-01-12 20:26 ` Matti Lehtimäki
  5 siblings, 0 replies; 12+ messages in thread
From: Matti Lehtimäki @ 2023-01-12 20:26 UTC (permalink / raw)
  To: linux-arm-msm
  Cc: ~postmarketos/upstreaming, phone-devel, Matti Lehtimäki,
	Andy Gross, Bjorn Andersson, Konrad Dybcio, Rob Herring,
	Krzysztof Kozlowski, devicetree, linux-kernel

Enable modem remoteproc on samsung,matisse-wifi.

Signed-off-by: Matti Lehtimäki <matti.lehtimaki@gmail.com>
---
 .../boot/dts/qcom-apq8026-samsung-matisse-wifi.dts  | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/qcom-apq8026-samsung-matisse-wifi.dts b/arch/arm/boot/dts/qcom-apq8026-samsung-matisse-wifi.dts
index 91b860e24681..c84ae3e2a602 100644
--- a/arch/arm/boot/dts/qcom-apq8026-samsung-matisse-wifi.dts
+++ b/arch/arm/boot/dts/qcom-apq8026-samsung-matisse-wifi.dts
@@ -10,6 +10,8 @@
 #include "qcom-pm8226.dtsi"
 
 /delete-node/ &adsp_region;
+/delete-node/ &mba_region;
+/delete-node/ &mpss_region;
 /delete-node/ &smem_region;
 
 / {
@@ -165,12 +167,12 @@ framebuffer@3200000 {
 			no-map;
 		};
 
-		mpss@8400000 {
+		mpss_region: mpss@8400000 {
 			reg = <0x08400000 0x1f00000>;
 			no-map;
 		};
 
-		mba@a300000 {
+		mba_region: mba@a300000 {
 			reg = <0x0a300000 0x100000>;
 			no-map;
 		};
@@ -279,6 +281,13 @@ touchscreen@4a {
 	};
 };
 
+&modem {
+	mx-supply = <&pm8226_l3>;
+	pll-supply = <&pm8226_l8>;
+
+	status = "okay";
+};
+
 &rpm_requests {
 	regulators {
 		compatible = "qcom,rpm-pm8226-regulators";
-- 
2.34.1


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

* Re: [PATCH 1/8] dt-bindings: remoteproc: qcom,msm8916-mss-pil: Add MSM8226
  2023-01-12 20:26 ` [PATCH 1/8] dt-bindings: remoteproc: qcom,msm8916-mss-pil: Add MSM8226 Matti Lehtimäki
@ 2023-01-12 22:03   ` Stephan Gerhold
  2023-01-13  8:40   ` Krzysztof Kozlowski
  1 sibling, 0 replies; 12+ messages in thread
From: Stephan Gerhold @ 2023-01-12 22:03 UTC (permalink / raw)
  To: Matti Lehtimäki
  Cc: linux-arm-msm, ~postmarketos/upstreaming, phone-devel, Andy Gross,
	Bjorn Andersson, Konrad Dybcio, Mathieu Poirier, Rob Herring,
	Krzysztof Kozlowski, linux-remoteproc, devicetree, linux-kernel

Hi Matti,

On Thu, Jan 12, 2023 at 10:26:04PM +0200, Matti Lehtimäki wrote:
> Adds support for platforms with only single power domain.

This sentence is a bit misleading. MSM8226 also has both CX and MX power
domains. The difference is only the way they are exposed by the firmware
and the drivers in Linux.

The RPM firmware allows Linux to vote for either
 - Voltages (exposed as regulators in Linux), or
 - Performance states/"voltage corners" (exposed as power domains in Linux)

For the hardware there is no difference: When using power domains the
performance states are simply translated to corresponding voltages
within the RPM firmware.

All newer platforms have moved towards using power domains for CX and
MX, so for consistency it would be preferable to do the same for MSM8226
and MSM8974. Perhaps the RPM firmware even allows using them with
voltage corners? In that case you could just add PM8226 L3 to rpmpd and
use it as power domain like on other platforms.

For some reason I assumed this is the case for MSM8974 2.5 years ago.
I have to admit I no longer remember why, and verifying this reliably is
probably hard... :/

But the VDD_MX setup looks identical for MSM8974 and MSM8226 to me, so
please also apply the same changes for MSM8974. I would also appreciate
a small comment in the commit message that the MX voltage rail is still
represented as regulator on these platforms. Also, perhaps this should
even be a separate patch given that it kind of fixes what I added for
MSM8974 back then.

> Adds support for external power block headswitch (BHS) registers
> 
> Signed-off-by: Matti Lehtimäki <matti.lehtimaki@gmail.com>
> ---
>  .../remoteproc/qcom,msm8916-mss-pil.yaml      | 41 +++++++++++++++++--
>  1 file changed, 37 insertions(+), 4 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/remoteproc/qcom,msm8916-mss-pil.yaml b/Documentation/devicetree/bindings/remoteproc/qcom,msm8916-mss-pil.yaml
> index 6e6e69ad9cd7..6a921f2711b2 100644
> --- a/Documentation/devicetree/bindings/remoteproc/qcom,msm8916-mss-pil.yaml
> +++ b/Documentation/devicetree/bindings/remoteproc/qcom,msm8916-mss-pil.yaml
> [...]
> @@ -106,6 +108,15 @@ properties:
>      items:
>        - const: stop
>  
> +  qcom,ext-bhs-reg:
> +    $ref: /schemas/types.yaml#/definitions/phandle-array
> +    description: External power block headswitch (BHS) register
> +                 (only valid for qcom,msm8226-mss-pil)
> +    items:
> +      - items:
> +          - description: phandle to external BHS syscon region
> +          - description: offset to the external BHS register
> +

Please disallow this (qcom,ext-bhs-reg: false) for everything except
qcom,msm8226-mss-pil.

>    qcom,halt-regs:
>      $ref: /schemas/types.yaml#/definitions/phandle-array
>      description:
> @@ -205,13 +216,35 @@ allOf:
>        required:
>          - power-domains
>          - power-domain-names
> -    else:
> +
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            enum:
> +              - qcom,msm8909-mss-pil
> +              - qcom,msm8916-mss-pil
> +              - qcom,msm8974-mss-pil
> +    then:
>        properties:
>          power-domains:
>            maxItems: 2
>          power-domain-names:
>            maxItems: 2
>  

You also need to add minItems here now.

> +  - if:
> +      properties:
> +        compatible:
> +          const: qcom,msm8226-mss-pil
> +    then:
> +      properties:
> +        power-domains:
> +          maxItems: 1
> +        power-domain-names:
> +          maxItems: 1
> +      required:
> +        - qcom,ext-bhs-reg

And here you need to add the mx-supply as required, since you don't have
it as power domain.

Thanks,
Stephan

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

* Re: [PATCH 7/8] ARM: dts: qcom: msm8226: Add modem remoteproc node
  2023-01-12 20:26 ` [PATCH 7/8] ARM: dts: qcom: msm8226: Add modem remoteproc node Matti Lehtimäki
@ 2023-01-12 22:24   ` Stephan Gerhold
  0 siblings, 0 replies; 12+ messages in thread
From: Stephan Gerhold @ 2023-01-12 22:24 UTC (permalink / raw)
  To: Matti Lehtimäki
  Cc: linux-arm-msm, ~postmarketos/upstreaming, phone-devel, Luca Weiss,
	Andy Gross, Bjorn Andersson, Konrad Dybcio, Rob Herring,
	Krzysztof Kozlowski, devicetree, linux-kernel

On Thu, Jan 12, 2023 at 10:26:10PM +0200, Matti Lehtimäki wrote:
> From: Luca Weiss <luca@z3ntu.xyz>
> 
> Add a node for the modem remoteproc found on MSM8226.
> 
> Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
> Co-developed-by: Matti Lehtimäki <matti.lehtimaki@gmail.com>
> Signed-off-by: Matti Lehtimäki <matti.lehtimaki@gmail.com>
> ---
>  arch/arm/boot/dts/qcom-msm8226.dtsi | 86 +++++++++++++++++++++++++++++
>  1 file changed, 86 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/qcom-msm8226.dtsi b/arch/arm/boot/dts/qcom-msm8226.dtsi
> index 2639167c8976..34ea9cf46ae0 100644
> --- a/arch/arm/boot/dts/qcom-msm8226.dtsi
> +++ b/arch/arm/boot/dts/qcom-msm8226.dtsi
> [...]
> @@ -620,6 +655,57 @@ rpm_msg_ram: sram@fc428000 {
>  			reg = <0xfc428000 0x4000>;
>  		};
>  
> +		modem: remoteproc@fc880000 {
> +			compatible = "qcom,msm8226-mss-pil";
> +			reg = <0xfc880000 0x100>,
> +			      <0xfc820000 0x020>;
> +			reg-names = "qdsp6", "rmb";
> +
> +			interrupts-extended = <&intc GIC_SPI 24 IRQ_TYPE_EDGE_RISING>,
> +					      <&modem_smp2p_in 0 IRQ_TYPE_EDGE_RISING>,
> +					      <&modem_smp2p_in 1 IRQ_TYPE_EDGE_RISING>,
> +					      <&modem_smp2p_in 2 IRQ_TYPE_EDGE_RISING>,
> +					      <&modem_smp2p_in 3 IRQ_TYPE_EDGE_RISING>;
> +			interrupt-names = "wdog", "fatal", "ready", "handover", "stop-ack";
> +
> +			clocks = <&gcc GCC_MSS_Q6_BIMC_AXI_CLK>,
> +				 <&gcc GCC_MSS_CFG_AHB_CLK>,
> +				 <&gcc GCC_BOOT_ROM_AHB_CLK>,
> +				 <&xo_board>;
> +			clock-names = "iface", "bus", "mem", "xo";
> +
> +			resets = <&gcc GCC_MSS_RESTART>;
> +			reset-names = "mss_restart";
> +
> +			power-domains = <&rpmpd MSM8226_VDDCX>;
> +			power-domain-names = "cx";
> +
> +			qcom,ext-bhs-reg = <&tcsr_regs_1 0x194>;
> +			qcom,halt-regs = <&tcsr_regs_1 0x180 0x200 0x280>;
> +
> +			qcom,smem-states = <&modem_smp2p_out 0>;
> +			qcom,smem-state-names = "stop";
> +
> +			status = "disabled";
> +
> +			mba {
> +				memory-region = <&mba_region>;
> +			};
> +
> +			mpss {
> +				memory-region = <&mpss_region>;
> +			};

Please prefer using memory-region with two items in the node above, as
suggested in the DT schema:

			memory-region = <&mba_region>, <&mpss_region>;

Thanks,
Stephan

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

* Re: [PATCH 1/8] dt-bindings: remoteproc: qcom,msm8916-mss-pil: Add MSM8226
  2023-01-12 20:26 ` [PATCH 1/8] dt-bindings: remoteproc: qcom,msm8916-mss-pil: Add MSM8226 Matti Lehtimäki
  2023-01-12 22:03   ` Stephan Gerhold
@ 2023-01-13  8:40   ` Krzysztof Kozlowski
  1 sibling, 0 replies; 12+ messages in thread
From: Krzysztof Kozlowski @ 2023-01-13  8:40 UTC (permalink / raw)
  To: Matti Lehtimäki, linux-arm-msm
  Cc: ~postmarketos/upstreaming, phone-devel, Andy Gross,
	Bjorn Andersson, Konrad Dybcio, Mathieu Poirier, Rob Herring,
	Krzysztof Kozlowski, Stephan Gerhold, linux-remoteproc,
	devicetree, linux-kernel

On 12/01/2023 21:26, Matti Lehtimäki wrote:
> Adds support for platforms with only single power domain.

Add
https://elixir.bootlin.com/linux/v5.17.1/source/Documentation/process/submitting-patches.rst#L95

> Adds support for external power block headswitch (BHS) registers

Add.
Full stop.

> 
> Signed-off-by: Matti Lehtimäki <matti.lehtimaki@gmail.com>
> ---
>  .../remoteproc/qcom,msm8916-mss-pil.yaml      | 41 +++++++++++++++++--
>  1 file changed, 37 insertions(+), 4 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/remoteproc/qcom,msm8916-mss-pil.yaml b/Documentation/devicetree/bindings/remoteproc/qcom,msm8916-mss-pil.yaml
> index 6e6e69ad9cd7..6a921f2711b2 100644
> --- a/Documentation/devicetree/bindings/remoteproc/qcom,msm8916-mss-pil.yaml
> +++ b/Documentation/devicetree/bindings/remoteproc/qcom,msm8916-mss-pil.yaml
> @@ -17,6 +17,7 @@ properties:
>    compatible:
>      oneOf:
>        - enum:
> +          - qcom,msm8226-mss-pil
>            - qcom,msm8909-mss-pil
>            - qcom,msm8916-mss-pil
>            - qcom,msm8953-mss-pil
> @@ -70,16 +71,17 @@ properties:
>      items:
>        - description: CX proxy power domain (control handed over after startup)
>        - description: MX proxy power domain (control handed over after startup)
> +                     (not valid for qcom,msm8226-mss-pil)
>        - description: MSS proxy power domain (control handed over after startup)
>                       (only valid for qcom,msm8953-mss-pil)
> -    minItems: 2
> +    minItems: 1
>  
>    power-domain-names:
>      items:
>        - const: cx
> -      - const: mx
> +      - const: mx # not valid for qcom,msm8226-mss-pil
>        - const: mss # only valid for qcom,msm8953-mss-pil
> -    minItems: 2
> +    minItems: 1
>  
>    pll-supply:
>      description: PLL proxy supply (control handed over after startup)
> @@ -106,6 +108,15 @@ properties:
>      items:
>        - const: stop
>  
> +  qcom,ext-bhs-reg:
> +    $ref: /schemas/types.yaml#/definitions/phandle-array
> +    description: External power block headswitch (BHS) register
> +                 (only valid for qcom,msm8226-mss-pil)
> +    items:
> +      - items:
> +          - description: phandle to external BHS syscon region
> +          - description: offset to the external BHS register
> +
>    qcom,halt-regs:
>      $ref: /schemas/types.yaml#/definitions/phandle-array
>      description:
> @@ -205,13 +216,35 @@ allOf:

in this block:
qcom,ext-bhs-reg: false

>        required:
>          - power-domains
>          - power-domain-names
> -    else:
> +
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            enum:
> +              - qcom,msm8909-mss-pil
> +              - qcom,msm8916-mss-pil
> +              - qcom,msm8974-mss-pil
> +    then:
>        properties:
>          power-domains:
>            maxItems: 2
>          power-domain-names:
>            maxItems: 2

         qcom,ext-bhs-reg: false
>  
> +  - if:
> +      properties:
> +        compatible:
> +          const: qcom,msm8226-mss-pil
> +    then:
> +      properties:
> +        power-domains:
> +          maxItems: 1
> +        power-domain-names:
> +          maxItems: 1
> +      required:
> +        - qcom,ext-bhs-reg
> +
>    - if:
>        properties:
>          compatible:

Best regards,
Krzysztof


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

* Re: [PATCH 4/8] dt-bindings: mfd: qcom,tcsr: Add compatible for MSM8226
  2023-01-12 20:26 ` [PATCH 4/8] dt-bindings: mfd: qcom,tcsr: Add compatible for MSM8226 Matti Lehtimäki
@ 2023-01-13  8:41   ` Krzysztof Kozlowski
  2023-01-13 14:49   ` Lee Jones
  1 sibling, 0 replies; 12+ messages in thread
From: Krzysztof Kozlowski @ 2023-01-13  8:41 UTC (permalink / raw)
  To: Matti Lehtimäki, linux-arm-msm
  Cc: ~postmarketos/upstreaming, phone-devel, Andy Gross,
	Bjorn Andersson, Konrad Dybcio, Lee Jones, Rob Herring,
	Krzysztof Kozlowski, devicetree, linux-kernel

On 12/01/2023 21:26, Matti Lehtimäki wrote:
> Document the qcom,msm8226-tcsr compatible.
> 
> Signed-off-by: Matti Lehtimäki <matti.lehtimaki@gmail.com>
> ---

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

Best regards,
Krzysztof


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

* Re: [PATCH 4/8] dt-bindings: mfd: qcom,tcsr: Add compatible for MSM8226
  2023-01-12 20:26 ` [PATCH 4/8] dt-bindings: mfd: qcom,tcsr: Add compatible for MSM8226 Matti Lehtimäki
  2023-01-13  8:41   ` Krzysztof Kozlowski
@ 2023-01-13 14:49   ` Lee Jones
  1 sibling, 0 replies; 12+ messages in thread
From: Lee Jones @ 2023-01-13 14:49 UTC (permalink / raw)
  To: Matti Lehtimäki
  Cc: linux-arm-msm, ~postmarketos/upstreaming, phone-devel, Andy Gross,
	Bjorn Andersson, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski,
	devicetree, linux-kernel

On Thu, 12 Jan 2023, Matti Lehtimäki wrote:

> Document the qcom,msm8226-tcsr compatible.
> 
> Signed-off-by: Matti Lehtimäki <matti.lehtimaki@gmail.com>
> ---
>  Documentation/devicetree/bindings/mfd/qcom,tcsr.yaml | 1 +
>  1 file changed, 1 insertion(+)

Applied, thanks

-- 
Lee Jones [李琼斯]

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

end of thread, other threads:[~2023-01-13 15:00 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-12 20:26 [PATCH 0/8] Modem support for MSM8226 Matti Lehtimäki
2023-01-12 20:26 ` [PATCH 1/8] dt-bindings: remoteproc: qcom,msm8916-mss-pil: Add MSM8226 Matti Lehtimäki
2023-01-12 22:03   ` Stephan Gerhold
2023-01-13  8:40   ` Krzysztof Kozlowski
2023-01-12 20:26 ` [PATCH 4/8] dt-bindings: mfd: qcom,tcsr: Add compatible for MSM8226 Matti Lehtimäki
2023-01-13  8:41   ` Krzysztof Kozlowski
2023-01-13 14:49   ` Lee Jones
2023-01-12 20:26 ` [PATCH 5/8] ARM: dts: qcom: msm8226: Add node for TCSR halt regs Matti Lehtimäki
2023-01-12 20:26 ` [PATCH 6/8] ARM: dts: qcom: msm8226: Add smsm node Matti Lehtimäki
2023-01-12 20:26 ` [PATCH 7/8] ARM: dts: qcom: msm8226: Add modem remoteproc node Matti Lehtimäki
2023-01-12 22:24   ` Stephan Gerhold
2023-01-12 20:26 ` [PATCH 8/8] ARM: dts: qcom: apq8026-samsung-matisse-wifi: Enable modem Matti Lehtimäki

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).