linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 1/9] dt-bindings: arm-smmu: Allow up to 3 power-domains
       [not found] <20221114104222.36329-1-konrad.dybcio@linaro.org>
@ 2022-11-14 10:42 ` Konrad Dybcio
  2022-11-14 11:01   ` Krzysztof Kozlowski
  2022-11-14 14:19   ` Rob Herring
  2022-11-14 10:42 ` [PATCH v2 2/9] arm64: dts: qcom: pmk8350: Allow specifying arbitrary SID Konrad Dybcio
                   ` (7 subsequent siblings)
  8 siblings, 2 replies; 21+ messages in thread
From: Konrad Dybcio @ 2022-11-14 10:42 UTC (permalink / raw)
  To: linux-arm-msm, andersson, agross, krzysztof.kozlowski
  Cc: patches, Konrad Dybcio, Will Deacon, Robin Murphy, Joerg Roedel,
	Rob Herring, Krzysztof Kozlowski, linux-arm-kernel, iommu,
	devicetree, linux-kernel

Some SMMUs require that a vote is held on as much as 3 separate PDs
(hello Qualcomm). Allow it in bindings.

Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
---
Changes since v1:
- Add minItems

 Documentation/devicetree/bindings/iommu/arm,smmu.yaml | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/iommu/arm,smmu.yaml b/Documentation/devicetree/bindings/iommu/arm,smmu.yaml
index 9066e6df1ba1..82bc696de662 100644
--- a/Documentation/devicetree/bindings/iommu/arm,smmu.yaml
+++ b/Documentation/devicetree/bindings/iommu/arm,smmu.yaml
@@ -159,7 +159,8 @@ properties:
           through the TCU's programming interface.
 
   power-domains:
-    maxItems: 1
+    minItems: 0
+    maxItems: 3
 
   nvidia,memory-controller:
     description: |
-- 
2.38.1


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

* [PATCH v2 2/9] arm64: dts: qcom: pmk8350: Allow specifying arbitrary SID
       [not found] <20221114104222.36329-1-konrad.dybcio@linaro.org>
  2022-11-14 10:42 ` [PATCH v2 1/9] dt-bindings: arm-smmu: Allow up to 3 power-domains Konrad Dybcio
@ 2022-11-14 10:42 ` Konrad Dybcio
  2022-11-14 10:42 ` [PATCH v2 3/9] arm64: dts: qcom: sm6375: Add GPI DMA nodes Konrad Dybcio
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 21+ messages in thread
From: Konrad Dybcio @ 2022-11-14 10:42 UTC (permalink / raw)
  To: linux-arm-msm, andersson, agross, krzysztof.kozlowski
  Cc: patches, Konrad Dybcio, Dmitry Baryshkov, Konrad Dybcio,
	Rob Herring, Krzysztof Kozlowski, devicetree, linux-kernel

PMK8350 is shipped on SID6 with some SoCs, for example with SM6375.
Add some preprocessor logic to allow changing the SID in cases like
this.

While I am not in favour of adding #if's into the device tree, this
is the least messy way to handle this. If one isn't specified, it
will default to 0 (as it has been previously).

Suggested-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
---
Changes since v1:
- take a different approach; patch substituted

 arch/arm64/boot/dts/qcom/pmk8350.dtsi | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

diff --git a/arch/arm64/boot/dts/qcom/pmk8350.dtsi b/arch/arm64/boot/dts/qcom/pmk8350.dtsi
index a7ec9d11946d..2730d97ab213 100644
--- a/arch/arm64/boot/dts/qcom/pmk8350.dtsi
+++ b/arch/arm64/boot/dts/qcom/pmk8350.dtsi
@@ -8,10 +8,15 @@
 #include <dt-bindings/interrupt-controller/irq.h>
 #include <dt-bindings/spmi/spmi.h>
 
+/* (Sadly) this PMIC can be configured to be at different SIDs */
+#ifndef PMK8350_SID
+	#define PMK8350_SID 0
+#endif
+
 &spmi_bus {
-	pmk8350: pmic@0 {
+	pmk8350: pmic@PMK8350_SID {
 		compatible = "qcom,pmk8350", "qcom,spmi-pmic";
-		reg = <0x0 SPMI_USID>;
+		reg = <PMK8350_SID SPMI_USID>;
 		#address-cells = <1>;
 		#size-cells = <0>;
 
@@ -21,14 +26,14 @@ pmk8350_pon: pon@1300 {
 
 			pon_pwrkey: pwrkey {
 				compatible = "qcom,pmk8350-pwrkey";
-				interrupts = <0x0 0x13 0x7 IRQ_TYPE_EDGE_BOTH>;
+				interrupts = <PMK8350_SID 0x13 0x7 IRQ_TYPE_EDGE_BOTH>;
 				linux,code = <KEY_POWER>;
 				status = "disabled";
 			};
 
 			pon_resin: resin {
 				compatible = "qcom,pmk8350-resin";
-				interrupts = <0x0 0x13 0x6 IRQ_TYPE_EDGE_BOTH>;
+				interrupts = <PMK8350_SID 0x13 0x6 IRQ_TYPE_EDGE_BOTH>;
 				status = "disabled";
 			};
 		};
@@ -38,14 +43,14 @@ pmk8350_vadc: adc@3100 {
 			reg = <0x3100>;
 			#address-cells = <1>;
 			#size-cells = <0>;
-			interrupts = <0x0 0x31 0x0 IRQ_TYPE_EDGE_RISING>;
+			interrupts = <PMK8350_SID 0x31 0x0 IRQ_TYPE_EDGE_RISING>;
 			#io-channel-cells = <1>;
 		};
 
 		pmk8350_adc_tm: adc-tm@3400 {
 			compatible = "qcom,adc-tm7";
 			reg = <0x3400>;
-			interrupts = <0x0 0x34 0x0 IRQ_TYPE_EDGE_RISING>;
+			interrupts = <PMK8350_SID 0x34 0x0 IRQ_TYPE_EDGE_RISING>;
 			#address-cells = <1>;
 			#size-cells = <0>;
 			#thermal-sensor-cells = <1>;
@@ -56,7 +61,7 @@ pmk8350_rtc: rtc@6100 {
 			compatible = "qcom,pmk8350-rtc";
 			reg = <0x6100>, <0x6200>;
 			reg-names = "rtc", "alarm";
-			interrupts = <0x0 0x62 0x1 IRQ_TYPE_EDGE_RISING>;
+			interrupts = <PMK8350_SID 0x62 0x1 IRQ_TYPE_EDGE_RISING>;
 			status = "disabled";
 		};
 
-- 
2.38.1


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

* [PATCH v2 3/9] arm64: dts: qcom: sm6375: Add GPI DMA nodes
       [not found] <20221114104222.36329-1-konrad.dybcio@linaro.org>
  2022-11-14 10:42 ` [PATCH v2 1/9] dt-bindings: arm-smmu: Allow up to 3 power-domains Konrad Dybcio
  2022-11-14 10:42 ` [PATCH v2 2/9] arm64: dts: qcom: pmk8350: Allow specifying arbitrary SID Konrad Dybcio
@ 2022-11-14 10:42 ` Konrad Dybcio
  2022-11-14 10:42 ` [PATCH v2 4/9] arm64: dts: qcom: sm6375: Add pin configs for some QUP configurations Konrad Dybcio
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 21+ messages in thread
From: Konrad Dybcio @ 2022-11-14 10:42 UTC (permalink / raw)
  To: linux-arm-msm, andersson, agross, krzysztof.kozlowski
  Cc: patches, Konrad Dybcio, Konrad Dybcio, Rob Herring,
	Krzysztof Kozlowski, devicetree, linux-kernel

Add nodes for GPI DMA hosts on SM6375.

Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
---
No changes since v1.

 arch/arm64/boot/dts/qcom/sm6375.dtsi | 40 ++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sm6375.dtsi b/arch/arm64/boot/dts/qcom/sm6375.dtsi
index 9b1a497e5ca7..62a64dd731a0 100644
--- a/arch/arm64/boot/dts/qcom/sm6375.dtsi
+++ b/arch/arm64/boot/dts/qcom/sm6375.dtsi
@@ -567,6 +567,46 @@ rpm_msg_ram: sram@45f0000 {
 			reg = <0 0x045f0000 0 0x7000>;
 		};
 
+		gpi_dma0: dma-controller@4a00000 {
+			compatible = "qcom,sm6375-gpi-dma", "qcom,sm6350-gpi-dma";
+			reg = <0 0x04a00000 0 0x60000>;
+			interrupts = <GIC_SPI 335 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 336 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 337 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 338 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 339 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 340 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 341 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 342 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 343 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 344 IRQ_TYPE_LEVEL_HIGH>;
+			dma-channels = <10>;
+			dma-channel-mask = <0x1f>;
+			iommus = <&apps_smmu 0x16 0x0>;
+			#dma-cells = <3>;
+			status = "disabled";
+		};
+
+		gpi_dma1: dma-controller@4c00000 {
+			compatible = "qcom,sm6375-gpi-dma", "qcom,sm6350-gpi-dma";
+			reg = <0 0x04c00000 0 0x60000>;
+			interrupts = <GIC_SPI 497 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 498 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 499 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 500 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 501 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 502 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 503 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 504 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 505 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 506 IRQ_TYPE_LEVEL_HIGH>;
+			dma-channels = <10>;
+			dma-channel-mask = <0x1f>;
+			iommus = <&apps_smmu 0xd6 0x0>;
+			#dma-cells = <3>;
+			status = "disabled";
+		};
+
 		usb_1: usb@4ef8800 {
 			compatible = "qcom,sm6375-dwc3", "qcom,dwc3";
 			reg = <0 0x04ef8800 0 0x400>;
-- 
2.38.1


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

* [PATCH v2 4/9] arm64: dts: qcom: sm6375: Add pin configs for some QUP configurations
       [not found] <20221114104222.36329-1-konrad.dybcio@linaro.org>
                   ` (2 preceding siblings ...)
  2022-11-14 10:42 ` [PATCH v2 3/9] arm64: dts: qcom: sm6375: Add GPI DMA nodes Konrad Dybcio
@ 2022-11-14 10:42 ` Konrad Dybcio
  2022-11-14 10:42 ` [PATCH v2 5/9] arm64: dts: qcom: sm6375: Add QUPs and corresponding SPI/I2C hosts Konrad Dybcio
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 21+ messages in thread
From: Konrad Dybcio @ 2022-11-14 10:42 UTC (permalink / raw)
  To: linux-arm-msm, andersson, agross, krzysztof.kozlowski
  Cc: patches, Konrad Dybcio, Konrad Dybcio, Rob Herring,
	Krzysztof Kozlowski, devicetree, linux-kernel

Add the pin setup for SPI/I2C configurations that are supported
downstream. I can guesstimate the correct settings for other buses,
but:

- I have no hardware to test it on
- Some QUPs are straight up missing pin funcs in TLMM
- Vendors probably didn't really care and used whatever was there in
the reference design and BSP - should any other be used, they can be
configured at a later time

Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
---
Changes since v1:
- pick up a-b

 arch/arm64/boot/dts/qcom/sm6375.dtsi | 43 ++++++++++++++++++++++++++++
 1 file changed, 43 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sm6375.dtsi b/arch/arm64/boot/dts/qcom/sm6375.dtsi
index 62a64dd731a0..952156891476 100644
--- a/arch/arm64/boot/dts/qcom/sm6375.dtsi
+++ b/arch/arm64/boot/dts/qcom/sm6375.dtsi
@@ -519,6 +519,49 @@ tlmm: pinctrl@500000 {
 			gpio-controller;
 			#interrupt-cells = <2>;
 			#gpio-cells = <2>;
+
+			qup_i2c0_default: qup-i2c0-default-state {
+				pins = "gpio0", "gpio1";
+				function = "qup00";
+				drive-strength = <2>;
+				bias-pull-up;
+			};
+
+			qup_i2c1_default: qup-i2c1-default-state {
+				pins = "gpio61", "gpio62";
+				function = "qup01";
+				drive-strength = <2>;
+				bias-pull-up;
+			};
+
+			qup_i2c2_default: qup-i2c2-default-state {
+				pins = "gpio45", "gpio46";
+				function = "qup02";
+				drive-strength = <2>;
+				bias-pull-up;
+			};
+
+			qup_i2c8_default: qup-i2c8-default-state {
+				pins = "gpio19", "gpio20";
+				/* TLMM, GCC and vendor DT all have different indices.. */
+				function = "qup12";
+				drive-strength = <2>;
+				bias-pull-up;
+			};
+
+			qup_i2c10_default: qup-i2c10-default-state {
+				pins = "gpio4", "gpio5";
+				function = "qup10";
+				drive-strength = <2>;
+				bias-pull-up;
+			};
+
+			qup_spi0_default: qup-spi0-default-state {
+				pins = "gpio0", "gpio1", "gpio2", "gpio3";
+				function = "qup00";
+				drive-strength = <6>;
+				bias-disable;
+			};
 		};
 
 		gcc: clock-controller@1400000 {
-- 
2.38.1


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

* [PATCH v2 5/9] arm64: dts: qcom: sm6375: Add QUPs and corresponding SPI/I2C hosts
       [not found] <20221114104222.36329-1-konrad.dybcio@linaro.org>
                   ` (3 preceding siblings ...)
  2022-11-14 10:42 ` [PATCH v2 4/9] arm64: dts: qcom: sm6375: Add pin configs for some QUP configurations Konrad Dybcio
@ 2022-11-14 10:42 ` Konrad Dybcio
  2022-11-14 10:42 ` [PATCH v2 6/9] arm64: dts: qcom: sm6375-pdx225: Enable QUPs & GPI DMA Konrad Dybcio
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 21+ messages in thread
From: Konrad Dybcio @ 2022-11-14 10:42 UTC (permalink / raw)
  To: linux-arm-msm, andersson, agross, krzysztof.kozlowski
  Cc: patches, Konrad Dybcio, Konrad Dybcio, Rob Herring,
	Krzysztof Kozlowski, devicetree, linux-kernel

Add necessary nodes to support various QUP configurations. Note that:

- QUP3/4/5 and 11 are straight up missing
- There may be more QUPs physically on the SoC that work perfectly
fine, but Qualcomm decided not to expose them on the downstream kernel
- Many are missing pinctrls, as there are both missing pin funcs in
the TLMM driver and missing configuration settings (though they are
possible to guesstimate quite easily)

Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
---
No changes since v1.

 arch/arm64/boot/dts/qcom/sm6375.dtsi | 306 +++++++++++++++++++++++++++
 1 file changed, 306 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sm6375.dtsi b/arch/arm64/boot/dts/qcom/sm6375.dtsi
index 952156891476..6adffd927a8e 100644
--- a/arch/arm64/boot/dts/qcom/sm6375.dtsi
+++ b/arch/arm64/boot/dts/qcom/sm6375.dtsi
@@ -5,6 +5,7 @@
 
 #include <dt-bindings/clock/qcom,rpmcc.h>
 #include <dt-bindings/clock/qcom,sm6375-gcc.h>
+#include <dt-bindings/dma/qcom-gpi.h>
 #include <dt-bindings/interrupt-controller/arm-gic.h>
 #include <dt-bindings/mailbox/qcom-ipcc.h>
 #include <dt-bindings/power/qcom-rpmpd.h>
@@ -317,6 +318,25 @@ CLUSTER_PD: cpu-cluster0 {
 		};
 	};
 
+	qup_opp_table: opp-table-qup {
+		compatible = "operating-points-v2";
+
+		opp-75000000 {
+			opp-hz = /bits/ 64 <75000000>;
+			required-opps = <&rpmpd_opp_low_svs>;
+		};
+
+		opp-100000000 {
+			opp-hz = /bits/ 64 <100000000>;
+			required-opps = <&rpmpd_opp_svs>;
+		};
+
+		opp-128000000 {
+			opp-hz = /bits/ 64 <128000000>;
+			required-opps = <&rpmpd_opp_nom>;
+		};
+	};
+
 	reserved_memory: reserved-memory {
 		#address-cells = <2>;
 		#size-cells = <2>;
@@ -630,6 +650,125 @@ gpi_dma0: dma-controller@4a00000 {
 			status = "disabled";
 		};
 
+		qupv3_id_0: geniqup@4ac0000 {
+			compatible = "qcom,geni-se-qup";
+			reg = <0x0 0x04ac0000 0x0 0x2000>;
+			clock-names = "m-ahb", "s-ahb";
+			clocks = <&gcc GCC_QUPV3_WRAP_0_M_AHB_CLK>,
+				 <&gcc GCC_QUPV3_WRAP_0_S_AHB_CLK>;
+			iommus = <&apps_smmu 0x3 0x0>;
+			#address-cells = <2>;
+			#size-cells = <2>;
+			ranges;
+			status = "disabled";
+
+			i2c0: i2c@4a80000 {
+				compatible = "qcom,geni-i2c";
+				reg = <0x0 0x04a80000 0x0 0x4000>;
+				clock-names = "se";
+				clocks = <&gcc GCC_QUPV3_WRAP0_S0_CLK>;
+				interrupts = <GIC_SPI 327 IRQ_TYPE_LEVEL_HIGH>;
+				pinctrl-names = "default";
+				pinctrl-0 = <&qup_i2c0_default>;
+				dmas = <&gpi_dma0 0 0 QCOM_GPI_I2C>,
+				       <&gpi_dma0 1 0 QCOM_GPI_I2C>;
+				dma-names = "tx", "rx";
+				#address-cells = <1>;
+				#size-cells = <0>;
+				status = "disabled";
+			};
+
+			spi0: spi@4a80000 {
+				compatible = "qcom,geni-spi";
+				reg = <0x0 0x04a80000 0x0 0x4000>;
+				clock-names = "se";
+				clocks = <&gcc GCC_QUPV3_WRAP0_S0_CLK>;
+				interrupts = <GIC_SPI 327 IRQ_TYPE_LEVEL_HIGH>;
+				pinctrl-names = "default";
+				pinctrl-0 = <&qup_spi0_default>;
+				power-domains = <&rpmpd SM6375_VDDCX>;
+				operating-points-v2 = <&qup_opp_table>;
+				dmas = <&gpi_dma0 0 0 QCOM_GPI_SPI>,
+				       <&gpi_dma0 1 0 QCOM_GPI_SPI>;
+				dma-names = "tx", "rx";
+				#address-cells = <1>;
+				#size-cells = <0>;
+				status = "disabled";
+			};
+
+			i2c1: i2c@4a84000 {
+				compatible = "qcom,geni-i2c";
+				reg = <0x0 0x04a84000 0x0 0x4000>;
+				clock-names = "se";
+				clocks = <&gcc GCC_QUPV3_WRAP0_S1_CLK>;
+				interrupts = <GIC_SPI 328 IRQ_TYPE_LEVEL_HIGH>;
+				pinctrl-names = "default";
+				pinctrl-0 = <&qup_i2c1_default>;
+				dmas = <&gpi_dma0 0 1 QCOM_GPI_I2C>,
+				       <&gpi_dma0 1 1 QCOM_GPI_I2C>;
+				dma-names = "tx", "rx";
+				#address-cells = <1>;
+				#size-cells = <0>;
+				status = "disabled";
+			};
+
+			spi1: spi@4a84000 {
+				compatible = "qcom,geni-spi";
+				reg = <0x0 0x04a84000 0x0 0x4000>;
+				clock-names = "se";
+				clocks = <&gcc GCC_QUPV3_WRAP0_S1_CLK>;
+				interrupts = <GIC_SPI 328 IRQ_TYPE_LEVEL_HIGH>;
+				power-domains = <&rpmpd SM6375_VDDCX>;
+				operating-points-v2 = <&qup_opp_table>;
+				dmas = <&gpi_dma0 0 1 QCOM_GPI_SPI>,
+				       <&gpi_dma0 1 1 QCOM_GPI_SPI>;
+				dma-names = "tx", "rx";
+				#address-cells = <1>;
+				#size-cells = <0>;
+				status = "disabled";
+			};
+
+			i2c2: i2c@4a88000 {
+				compatible = "qcom,geni-i2c";
+				reg = <0x0 0x04a88000 0x0 0x4000>;
+				clock-names = "se";
+				clocks = <&gcc GCC_QUPV3_WRAP0_S2_CLK>;
+				interrupts = <GIC_SPI 329 IRQ_TYPE_LEVEL_HIGH>;
+				pinctrl-names = "default";
+				pinctrl-0 = <&qup_i2c2_default>;
+				dmas = <&gpi_dma0 0 2 QCOM_GPI_I2C>,
+				       <&gpi_dma0 1 2 QCOM_GPI_I2C>;
+				dma-names = "tx", "rx";
+				#address-cells = <1>;
+				#size-cells = <0>;
+				status = "disabled";
+			};
+
+			spi2: spi@4a88000 {
+				compatible = "qcom,geni-spi";
+				reg = <0x0 0x04a88000 0x0 0x4000>;
+				clock-names = "se";
+				clocks = <&gcc GCC_QUPV3_WRAP0_S2_CLK>;
+				interrupts = <GIC_SPI 329 IRQ_TYPE_LEVEL_HIGH>;
+				power-domains = <&rpmpd SM6375_VDDCX>;
+				operating-points-v2 = <&qup_opp_table>;
+				dmas = <&gpi_dma0 0 2 QCOM_GPI_SPI>,
+				       <&gpi_dma0 1 2 QCOM_GPI_SPI>;
+				dma-names = "tx", "rx";
+				#address-cells = <1>;
+				#size-cells = <0>;
+				status = "disabled";
+			};
+
+			/*
+			 * As per GCC, QUP3/4/5/11 also exist, but are not even defined downstream.
+			 * There is a comment in the included DTSI of another SoC saying that they
+			 * are not "bolled out" (probably meaning not routed to solder balls)
+			 * TLMM driver however, suggests there are as many as 15 QUPs in total!
+			 * Most of which don't even have pin configurations for.. Sad stuff!
+			 */
+		};
+
 		gpi_dma1: dma-controller@4c00000 {
 			compatible = "qcom,sm6375-gpi-dma", "qcom,sm6350-gpi-dma";
 			reg = <0 0x04c00000 0 0x60000>;
@@ -650,6 +789,173 @@ gpi_dma1: dma-controller@4c00000 {
 			status = "disabled";
 		};
 
+		qupv3_id_1: geniqup@4cc0000 {
+			compatible = "qcom,geni-se-qup";
+			reg = <0x0 0x04cc0000 0x0 0x2000>;
+			clock-names = "m-ahb", "s-ahb";
+			clocks = <&gcc GCC_QUPV3_WRAP_1_M_AHB_CLK>,
+				 <&gcc GCC_QUPV3_WRAP_1_S_AHB_CLK>;
+			iommus = <&apps_smmu 0xc3 0x0>;
+			#address-cells = <2>;
+			#size-cells = <2>;
+			ranges;
+			status = "disabled";
+
+			i2c6: i2c@4c80000 {
+				compatible = "qcom,geni-i2c";
+				reg = <0x0 0x04c80000 0x0 0x4000>;
+				clock-names = "se";
+				clocks = <&gcc GCC_QUPV3_WRAP1_S0_CLK>;
+				interrupts = <GIC_SPI 507 IRQ_TYPE_LEVEL_HIGH>;
+				dmas = <&gpi_dma1 0 0 QCOM_GPI_I2C>,
+				       <&gpi_dma1 1 0 QCOM_GPI_I2C>;
+				dma-names = "tx", "rx";
+				#address-cells = <1>;
+				#size-cells = <0>;
+				status = "disabled";
+			};
+
+			spi6: spi@4c80000 {
+				compatible = "qcom,geni-spi";
+				reg = <0x0 0x04c80000 0x0 0x4000>;
+				clock-names = "se";
+				clocks = <&gcc GCC_QUPV3_WRAP1_S0_CLK>;
+				interrupts = <GIC_SPI 507 IRQ_TYPE_LEVEL_HIGH>;
+				power-domains = <&rpmpd SM6375_VDDCX>;
+				operating-points-v2 = <&qup_opp_table>;
+				dmas = <&gpi_dma1 0 0 QCOM_GPI_SPI>,
+				       <&gpi_dma1 1 0 QCOM_GPI_SPI>;
+				dma-names = "tx", "rx";
+				#address-cells = <1>;
+				#size-cells = <0>;
+				status = "disabled";
+			};
+
+			i2c7: i2c@4c84000 {
+				compatible = "qcom,geni-i2c";
+				reg = <0x0 0x04c84000 0x0 0x4000>;
+				clock-names = "se";
+				clocks = <&gcc GCC_QUPV3_WRAP1_S1_CLK>;
+				interrupts = <GIC_SPI 508 IRQ_TYPE_LEVEL_HIGH>;
+				dmas = <&gpi_dma1 0 1 QCOM_GPI_I2C>,
+				       <&gpi_dma1 1 1 QCOM_GPI_I2C>;
+				dma-names = "tx", "rx";
+				#address-cells = <1>;
+				#size-cells = <0>;
+				status = "disabled";
+			};
+
+			spi7: spi@4c84000 {
+				compatible = "qcom,geni-spi";
+				reg = <0x0 0x04c84000 0x0 0x4000>;
+				clock-names = "se";
+				clocks = <&gcc GCC_QUPV3_WRAP1_S1_CLK>;
+				interrupts = <GIC_SPI 508 IRQ_TYPE_LEVEL_HIGH>;
+				power-domains = <&rpmpd SM6375_VDDCX>;
+				operating-points-v2 = <&qup_opp_table>;
+				dmas = <&gpi_dma1 0 1 QCOM_GPI_SPI>,
+				       <&gpi_dma1 1 1 QCOM_GPI_SPI>;
+				dma-names = "tx", "rx";
+				#address-cells = <1>;
+				#size-cells = <0>;
+				status = "disabled";
+			};
+
+			i2c8: i2c@4c88000 {
+				compatible = "qcom,geni-i2c";
+				reg = <0x0 0x04c88000 0x0 0x4000>;
+				clock-names = "se";
+				clocks = <&gcc GCC_QUPV3_WRAP1_S2_CLK>;
+				interrupts = <GIC_SPI 509 IRQ_TYPE_LEVEL_HIGH>;
+				pinctrl-names = "default";
+				pinctrl-0 = <&qup_i2c8_default>;
+				dmas = <&gpi_dma1 0 2 QCOM_GPI_I2C>,
+				       <&gpi_dma1 1 2 QCOM_GPI_I2C>;
+				dma-names = "tx", "rx";
+				#address-cells = <1>;
+				#size-cells = <0>;
+				status = "disabled";
+			};
+
+			spi8: spi@4c88000 {
+				compatible = "qcom,geni-spi";
+				reg = <0x0 0x04c88000 0x0 0x4000>;
+				clock-names = "se";
+				clocks = <&gcc GCC_QUPV3_WRAP1_S2_CLK>;
+				interrupts = <GIC_SPI 509 IRQ_TYPE_LEVEL_HIGH>;
+				power-domains = <&rpmpd SM6375_VDDCX>;
+				operating-points-v2 = <&qup_opp_table>;
+				dmas = <&gpi_dma1 0 2 QCOM_GPI_SPI>,
+				       <&gpi_dma1 1 2 QCOM_GPI_SPI>;
+				dma-names = "tx", "rx";
+				#address-cells = <1>;
+				#size-cells = <0>;
+				status = "disabled";
+			};
+
+			i2c9: i2c@4c8c000 {
+				compatible = "qcom,geni-i2c";
+				reg = <0x0 0x04c8c000 0x0 0x4000>;
+				clock-names = "se";
+				clocks = <&gcc GCC_QUPV3_WRAP1_S3_CLK>;
+				interrupts = <GIC_SPI 510 IRQ_TYPE_LEVEL_HIGH>;
+				dmas = <&gpi_dma1 0 3 QCOM_GPI_I2C>,
+				       <&gpi_dma1 1 3 QCOM_GPI_I2C>;
+				dma-names = "tx", "rx";
+				#address-cells = <1>;
+				#size-cells = <0>;
+				status = "disabled";
+			};
+
+			spi9: spi@4c8c000 {
+				compatible = "qcom,geni-spi";
+				reg = <0x0 0x04c8c000 0x0 0x4000>;
+				clock-names = "se";
+				clocks = <&gcc GCC_QUPV3_WRAP1_S3_CLK>;
+				interrupts = <GIC_SPI 510 IRQ_TYPE_LEVEL_HIGH>;
+				power-domains = <&rpmpd SM6375_VDDCX>;
+				operating-points-v2 = <&qup_opp_table>;
+				dmas = <&gpi_dma1 0 3 QCOM_GPI_SPI>,
+				       <&gpi_dma1 1 3 QCOM_GPI_SPI>;
+				dma-names = "tx", "rx";
+				#address-cells = <1>;
+				#size-cells = <0>;
+				status = "disabled";
+			};
+
+			i2c10: i2c@4c90000 {
+				compatible = "qcom,geni-i2c";
+				reg = <0x0 0x04c90000 0x0 0x4000>;
+				clock-names = "se";
+				clocks = <&gcc GCC_QUPV3_WRAP1_S4_CLK>;
+				interrupts = <GIC_SPI 511 IRQ_TYPE_LEVEL_HIGH>;
+				pinctrl-names = "default";
+				pinctrl-0 = <&qup_i2c10_default>;
+				dmas = <&gpi_dma1 0 4 QCOM_GPI_I2C>,
+				       <&gpi_dma1 1 4 QCOM_GPI_I2C>;
+				dma-names = "tx", "rx";
+				#address-cells = <1>;
+				#size-cells = <0>;
+				status = "disabled";
+			};
+
+			spi10: spi@4c90000 {
+				compatible = "qcom,geni-spi";
+				reg = <0x0 0x04c90000 0x0 0x4000>;
+				clock-names = "se";
+				clocks = <&gcc GCC_QUPV3_WRAP1_S4_CLK>;
+				interrupts = <GIC_SPI 511 IRQ_TYPE_LEVEL_HIGH>;
+				power-domains = <&rpmpd SM6375_VDDCX>;
+				operating-points-v2 = <&qup_opp_table>;
+				dmas = <&gpi_dma1 0 4 QCOM_GPI_SPI>,
+				       <&gpi_dma1 1 4 QCOM_GPI_SPI>;
+				dma-names = "tx", "rx";
+				#address-cells = <1>;
+				#size-cells = <0>;
+				status = "disabled";
+			};
+		};
+
 		usb_1: usb@4ef8800 {
 			compatible = "qcom,sm6375-dwc3", "qcom,dwc3";
 			reg = <0 0x04ef8800 0 0x400>;
-- 
2.38.1


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

* [PATCH v2 6/9] arm64: dts: qcom: sm6375-pdx225: Enable QUPs & GPI DMA
       [not found] <20221114104222.36329-1-konrad.dybcio@linaro.org>
                   ` (4 preceding siblings ...)
  2022-11-14 10:42 ` [PATCH v2 5/9] arm64: dts: qcom: sm6375: Add QUPs and corresponding SPI/I2C hosts Konrad Dybcio
@ 2022-11-14 10:42 ` Konrad Dybcio
  2022-11-14 10:42 ` [PATCH v2 7/9] arm64: dts: qcom: sm6375-pdx225: Add PMIC peripherals Konrad Dybcio
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 21+ messages in thread
From: Konrad Dybcio @ 2022-11-14 10:42 UTC (permalink / raw)
  To: linux-arm-msm, andersson, agross, krzysztof.kozlowski
  Cc: patches, Konrad Dybcio, Konrad Dybcio, Rob Herring,
	Krzysztof Kozlowski, devicetree, linux-kernel

Enable QUPs & GPI DMA on the Xperia 10 IV.

Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
---
No changes since v1.

 .../qcom/sm6375-sony-xperia-murray-pdx225.dts    | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sm6375-sony-xperia-murray-pdx225.dts b/arch/arm64/boot/dts/qcom/sm6375-sony-xperia-murray-pdx225.dts
index 450d4a557df1..6a0f4c0bf7ad 100644
--- a/arch/arm64/boot/dts/qcom/sm6375-sony-xperia-murray-pdx225.dts
+++ b/arch/arm64/boot/dts/qcom/sm6375-sony-xperia-murray-pdx225.dts
@@ -65,6 +65,22 @@ vph_pwr: vph-pwr-regulator {
 	};
 };
 
+&gpi_dma0 {
+	status = "okay";
+};
+
+&gpi_dma1 {
+	status = "okay";
+};
+
+&qupv3_id_0 {
+	status = "okay";
+};
+
+&qupv3_id_1 {
+	status = "okay";
+};
+
 &tlmm {
 	gpio-reserved-ranges = <13 4>;
 };
-- 
2.38.1


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

* [PATCH v2 7/9] arm64: dts: qcom: sm6375-pdx225: Add PMIC peripherals
       [not found] <20221114104222.36329-1-konrad.dybcio@linaro.org>
                   ` (5 preceding siblings ...)
  2022-11-14 10:42 ` [PATCH v2 6/9] arm64: dts: qcom: sm6375-pdx225: Enable QUPs & GPI DMA Konrad Dybcio
@ 2022-11-14 10:42 ` Konrad Dybcio
  2022-11-14 10:42 ` [PATCH v2 8/9] arm64: dts: qcom: sm6375-pdx225: Configure SMD RPM regulators Konrad Dybcio
  2022-11-14 10:42 ` [PATCH v2 9/9] arm64: dts: qcom: sm6375-pdx225: Configure Samsung touchscreen Konrad Dybcio
  8 siblings, 0 replies; 21+ messages in thread
From: Konrad Dybcio @ 2022-11-14 10:42 UTC (permalink / raw)
  To: linux-arm-msm, andersson, agross, krzysztof.kozlowski
  Cc: patches, Konrad Dybcio, Konrad Dybcio, Rob Herring,
	Krzysztof Kozlowski, devicetree, linux-kernel

Add and enable PMIC peripherals for PM6125, PMR735a and PMK8350 on
the Xperia 10 IV.

Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
---
Changes since v1:
- configure PMK8350 SID

 .../qcom/sm6375-sony-xperia-murray-pdx225.dts | 25 +++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sm6375-sony-xperia-murray-pdx225.dts b/arch/arm64/boot/dts/qcom/sm6375-sony-xperia-murray-pdx225.dts
index 6a0f4c0bf7ad..c830124cb483 100644
--- a/arch/arm64/boot/dts/qcom/sm6375-sony-xperia-murray-pdx225.dts
+++ b/arch/arm64/boot/dts/qcom/sm6375-sony-xperia-murray-pdx225.dts
@@ -5,10 +5,18 @@
 
 /dts-v1/;
 
+/* PMK8350 is configured to use SID6 instead of 0 */
+#define PMK8350_SID 6
+
 #include <dt-bindings/gpio/gpio.h>
 #include "sm6375.dtsi"
+#include "pm6125.dtsi"
+#include "pmk8350.dtsi"
 #include "pmr735a.dtsi"
 
+/* PM6125 PON is used and we can't have duplicate labels */
+/delete-node/ &pmk8350_pon;
+
 / {
 	model = "Sony Xperia 10 IV";
 	compatible = "sony,pdx225", "qcom,sm6375";
@@ -73,6 +81,23 @@ &gpi_dma1 {
 	status = "okay";
 };
 
+&pmk8350_adc_tm {
+	status = "okay";
+};
+
+&pmk8350_rtc {
+	status = "okay";
+};
+
+&pon_pwrkey {
+	status = "okay";
+};
+
+&pon_resin {
+	linux,code = <KEY_VOLUMEUP>;
+	status = "okay";
+};
+
 &qupv3_id_0 {
 	status = "okay";
 };
-- 
2.38.1


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

* [PATCH v2 8/9] arm64: dts: qcom: sm6375-pdx225: Configure SMD RPM regulators
       [not found] <20221114104222.36329-1-konrad.dybcio@linaro.org>
                   ` (6 preceding siblings ...)
  2022-11-14 10:42 ` [PATCH v2 7/9] arm64: dts: qcom: sm6375-pdx225: Add PMIC peripherals Konrad Dybcio
@ 2022-11-14 10:42 ` Konrad Dybcio
  2022-11-14 10:42 ` [PATCH v2 9/9] arm64: dts: qcom: sm6375-pdx225: Configure Samsung touchscreen Konrad Dybcio
  8 siblings, 0 replies; 21+ messages in thread
From: Konrad Dybcio @ 2022-11-14 10:42 UTC (permalink / raw)
  To: linux-arm-msm, andersson, agross, krzysztof.kozlowski
  Cc: patches, Konrad Dybcio, Konrad Dybcio, Rob Herring,
	Krzysztof Kozlowski, devicetree, linux-kernel

Configure regulators present on the Xperia 10 IV that are reachable
via SMD RPM.

Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
---
Changes since v1:
- sort the node properly (alphabet is hard, I know..)

 .../qcom/sm6375-sony-xperia-murray-pdx225.dts | 182 ++++++++++++++++++
 1 file changed, 182 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sm6375-sony-xperia-murray-pdx225.dts b/arch/arm64/boot/dts/qcom/sm6375-sony-xperia-murray-pdx225.dts
index c830124cb483..0f1ddfa28c89 100644
--- a/arch/arm64/boot/dts/qcom/sm6375-sony-xperia-murray-pdx225.dts
+++ b/arch/arm64/boot/dts/qcom/sm6375-sony-xperia-murray-pdx225.dts
@@ -106,6 +106,188 @@ &qupv3_id_1 {
 	status = "okay";
 };
 
+&rpm_requests {
+	regulators-0 {
+		compatible = "qcom,rpm-pm6125-regulators";
+
+		pm6125_s5: s5 {
+			regulator-min-microvolt = <382000>;
+			regulator-max-microvolt = <1120000>;
+		};
+
+		pm6125_s6: s6 {
+			regulator-min-microvolt = <320000>;
+			regulator-max-microvolt = <1374000>;
+		};
+
+		pm6125_s7: s7 {
+			regulator-min-microvolt = <1574000>;
+			regulator-max-microvolt = <2040000>;
+		};
+
+		/*
+		 * S8 is VDD_GFX
+		 * L1 is VDD_LPI_CX
+		 */
+
+		pm6125_l2: l2 {
+			regulator-min-microvolt = <1170000>;
+			regulator-max-microvolt = <1304000>;
+		};
+
+		pm6125_l3: l3 {
+			regulator-min-microvolt = <1100000>;
+			regulator-max-microvolt = <1300000>;
+		};
+
+		pm6125_l4: l4 {
+			regulator-min-microvolt = <1100000>;
+			regulator-max-microvolt = <1300000>;
+		};
+
+		pm6125_l5: l5 {
+			regulator-min-microvolt = <1650000>;
+			regulator-max-microvolt = <3050000>;
+		};
+
+		pm6125_l6: l6 {
+			regulator-min-microvolt = <1080000>;
+			regulator-max-microvolt = <1304000>;
+		};
+
+		pm6125_l7: l7 {
+			regulator-min-microvolt = <720000>;
+			regulator-max-microvolt = <1050000>;
+		};
+
+		pm6125_l8: l8 {
+			regulator-min-microvolt = <1100000>;
+			regulator-max-microvolt = <1304000>;
+		};
+
+		pm6125_l9: l9 {
+			regulator-min-microvolt = <1504000>;
+			regulator-max-microvolt = <2000000>;
+		};
+
+		pm6125_l10: l10 {
+			regulator-min-microvolt = <1620000>;
+			regulator-max-microvolt = <1980000>;
+		};
+
+		pm6125_l11: l11 {
+			regulator-min-microvolt = <1620000>;
+			regulator-max-microvolt = <1980000>;
+		};
+
+		pm6125_l12: l12 {
+			regulator-min-microvolt = <1620000>;
+			regulator-max-microvolt = <2000000>;
+		};
+
+		pm6125_l13: l13 {
+			regulator-min-microvolt = <1650000>;
+			regulator-max-microvolt = <1980000>;
+		};
+
+		pm6125_l14: l14 {
+			regulator-min-microvolt = <1700000>;
+			regulator-max-microvolt = <1900000>;
+		};
+
+		pm6125_l15: l15 {
+			regulator-min-microvolt = <1650000>;
+			regulator-max-microvolt = <3544000>;
+		};
+
+		pm6125_l16: l16 {
+			regulator-min-microvolt = <1620000>;
+			regulator-max-microvolt = <1980000>;
+		};
+
+		/* L17 is VDD_LPI_MX */
+
+		pm6125_l18: l18 {
+			regulator-min-microvolt = <830000>;
+			regulator-max-microvolt = <920000>;
+		};
+
+		pm6125_l19: l19 {
+			regulator-min-microvolt = <1624000>;
+			regulator-max-microvolt = <3304000>;
+		};
+
+		pm6125_l20: l20 {
+			regulator-min-microvolt = <1624000>;
+			regulator-max-microvolt = <3304000>;
+		};
+
+		pm6125_l21: l21 {
+			regulator-min-microvolt = <3000000>;
+			regulator-max-microvolt = <3400000>;
+		};
+
+		pm6125_l22: l22 {
+			regulator-min-microvolt = <2704000>;
+			regulator-max-microvolt = <3544000>;
+		};
+
+		pm6125_l23: l23 {
+			regulator-min-microvolt = <3000000>;
+			regulator-max-microvolt = <3400000>;
+		};
+
+		pm6125_l24: l24 {
+			regulator-min-microvolt = <2704000>;
+			regulator-max-microvolt = <3544000>;
+		};
+	};
+
+	regulators-1 {
+		compatible = "qcom,rpm-pmr735a-regulators";
+
+		/*
+		 * S1 is VDD_MX
+		 * S2 is VDD_CX
+		 */
+
+		pmr735a_l1: l1 {
+			regulator-min-microvolt = <570000>;
+			regulator-max-microvolt = <650000>;
+		};
+
+		pmr735a_l2: l2 {
+			regulator-min-microvolt = <352000>;
+			regulator-max-microvolt = <796000>;
+		};
+
+		pmr735a_l3: l3 {
+			regulator-min-microvolt = <1000000>;
+			regulator-max-microvolt = <1200000>;
+		};
+
+		pmr735a_l4: l4 {
+			regulator-min-microvolt = <1504000>;
+			regulator-max-microvolt = <2000000>;
+		};
+
+		pmr735a_l5: l5 {
+			regulator-min-microvolt = <751000>;
+			regulator-max-microvolt = <824000>;
+		};
+
+		pmr735a_l6: l6 {
+			regulator-min-microvolt = <504000>;
+			regulator-max-microvolt = <868000>;
+		};
+
+		pmr735a_l7: l7 {
+			regulator-min-microvolt = <2700000>;
+			regulator-max-microvolt = <3544000>;
+		};
+	};
+};
+
 &tlmm {
 	gpio-reserved-ranges = <13 4>;
 };
-- 
2.38.1


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

* [PATCH v2 9/9] arm64: dts: qcom: sm6375-pdx225: Configure Samsung touchscreen
       [not found] <20221114104222.36329-1-konrad.dybcio@linaro.org>
                   ` (7 preceding siblings ...)
  2022-11-14 10:42 ` [PATCH v2 8/9] arm64: dts: qcom: sm6375-pdx225: Configure SMD RPM regulators Konrad Dybcio
@ 2022-11-14 10:42 ` Konrad Dybcio
  8 siblings, 0 replies; 21+ messages in thread
From: Konrad Dybcio @ 2022-11-14 10:42 UTC (permalink / raw)
  To: linux-arm-msm, andersson, agross, krzysztof.kozlowski
  Cc: patches, Konrad Dybcio, Konrad Dybcio, Rob Herring,
	Krzysztof Kozlowski, devicetree, linux-kernel

Add a pretty bog-standard-for-Xperias-for-the-past-3-years
touchscreen setup.

The OEM that built the Xperia 10 IV for SONY decided to use some
kind of a GPIO regulator that needs to be enabled at all times
for both the touch panel and the display panel to function.

Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
---
No changes since v1.

 .../qcom/sm6375-sony-xperia-murray-pdx225.dts | 31 +++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sm6375-sony-xperia-murray-pdx225.dts b/arch/arm64/boot/dts/qcom/sm6375-sony-xperia-murray-pdx225.dts
index 0f1ddfa28c89..d18167bcb41f 100644
--- a/arch/arm64/boot/dts/qcom/sm6375-sony-xperia-murray-pdx225.dts
+++ b/arch/arm64/boot/dts/qcom/sm6375-sony-xperia-murray-pdx225.dts
@@ -81,6 +81,23 @@ &gpi_dma1 {
 	status = "okay";
 };
 
+&i2c8 {
+	clock-frequency = <400000>;
+	status = "okay";
+
+	touchscreen@48 {
+		compatible = "samsung,s6sy761";
+		reg = <0x48>;
+		interrupt-parent = <&tlmm>;
+		interrupts = <22 0x2008>;
+
+		vdd-supply = <&pm6125_l13>;
+
+		pinctrl-names = "default";
+		pinctrl-0 = <&ts_int_default &ts_avdd_default>;
+	};
+};
+
 &pmk8350_adc_tm {
 	status = "okay";
 };
@@ -290,6 +307,20 @@ pmr735a_l7: l7 {
 
 &tlmm {
 	gpio-reserved-ranges = <13 4>;
+
+	ts_int_default: ts-int-default-state {
+		pins = "gpio22";
+		function = "gpio";
+		drive-strength = <8>;
+		bias-pull-up;
+	};
+
+	ts_avdd_default: ts-avdd-default-state {
+		pins = "gpio59";
+		function = "gpio";
+		drive-strength = <8>;
+		output-high;
+	};
 };
 
 &usb_1 {
-- 
2.38.1


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

* Re: [PATCH v2 1/9] dt-bindings: arm-smmu: Allow up to 3 power-domains
  2022-11-14 10:42 ` [PATCH v2 1/9] dt-bindings: arm-smmu: Allow up to 3 power-domains Konrad Dybcio
@ 2022-11-14 11:01   ` Krzysztof Kozlowski
  2022-11-14 11:17     ` Konrad Dybcio
  2022-11-14 14:19   ` Rob Herring
  1 sibling, 1 reply; 21+ messages in thread
From: Krzysztof Kozlowski @ 2022-11-14 11:01 UTC (permalink / raw)
  To: Konrad Dybcio, linux-arm-msm, andersson, agross
  Cc: patches, Will Deacon, Robin Murphy, Joerg Roedel, Rob Herring,
	Krzysztof Kozlowski, linux-arm-kernel, iommu, devicetree,
	linux-kernel

On 14/11/2022 11:42, Konrad Dybcio wrote:
> Some SMMUs require that a vote is held on as much as 3 separate PDs
> (hello Qualcomm). Allow it in bindings.
> 
> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
> ---
> Changes since v1:
> - Add minItems
> 
>  Documentation/devicetree/bindings/iommu/arm,smmu.yaml | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/devicetree/bindings/iommu/arm,smmu.yaml b/Documentation/devicetree/bindings/iommu/arm,smmu.yaml
> index 9066e6df1ba1..82bc696de662 100644
> --- a/Documentation/devicetree/bindings/iommu/arm,smmu.yaml
> +++ b/Documentation/devicetree/bindings/iommu/arm,smmu.yaml
> @@ -159,7 +159,8 @@ properties:
>            through the TCU's programming interface.
>  
>    power-domains:
> -    maxItems: 1
> +    minItems: 0

It cannot be 0.

minItems: 1

Anyway you still need to restrict it per variant, as I said in previous
version.

Best regards,
Krzysztof


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

* Re: [PATCH v2 1/9] dt-bindings: arm-smmu: Allow up to 3 power-domains
  2022-11-14 11:01   ` Krzysztof Kozlowski
@ 2022-11-14 11:17     ` Konrad Dybcio
  2022-11-14 13:00       ` Krzysztof Kozlowski
  0 siblings, 1 reply; 21+ messages in thread
From: Konrad Dybcio @ 2022-11-14 11:17 UTC (permalink / raw)
  To: Krzysztof Kozlowski, linux-arm-msm, andersson, agross
  Cc: patches, Will Deacon, Robin Murphy, Joerg Roedel, Rob Herring,
	Krzysztof Kozlowski, linux-arm-kernel, iommu, devicetree,
	linux-kernel


On 14/11/2022 12:01, Krzysztof Kozlowski wrote:
> On 14/11/2022 11:42, Konrad Dybcio wrote:
>> Some SMMUs require that a vote is held on as much as 3 separate PDs
>> (hello Qualcomm). Allow it in bindings.
>>
>> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
>> ---
>> Changes since v1:
>> - Add minItems
>>
>>   Documentation/devicetree/bindings/iommu/arm,smmu.yaml | 3 ++-
>>   1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/Documentation/devicetree/bindings/iommu/arm,smmu.yaml b/Documentation/devicetree/bindings/iommu/arm,smmu.yaml
>> index 9066e6df1ba1..82bc696de662 100644
>> --- a/Documentation/devicetree/bindings/iommu/arm,smmu.yaml
>> +++ b/Documentation/devicetree/bindings/iommu/arm,smmu.yaml
>> @@ -159,7 +159,8 @@ properties:
>>             through the TCU's programming interface.
>>   
>>     power-domains:
>> -    maxItems: 1
>> +    minItems: 0
> It cannot be 0.
>
> minItems: 1
>
> Anyway you still need to restrict it per variant, as I said in previous
> version.

Hm.. I'm not entirely sure what you mean.. Should I add a list of 
compatibles
that are allowed to have 3 power-domains and leave it as it was before 
in the
'else' case?


Konrad

>
> Best regards,
> Krzysztof
>

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

* Re: [PATCH v2 1/9] dt-bindings: arm-smmu: Allow up to 3 power-domains
  2022-11-14 11:17     ` Konrad Dybcio
@ 2022-11-14 13:00       ` Krzysztof Kozlowski
  2022-11-14 15:53         ` Konrad Dybcio
  0 siblings, 1 reply; 21+ messages in thread
From: Krzysztof Kozlowski @ 2022-11-14 13:00 UTC (permalink / raw)
  To: Konrad Dybcio, linux-arm-msm, andersson, agross
  Cc: patches, Will Deacon, Robin Murphy, Joerg Roedel, Rob Herring,
	Krzysztof Kozlowski, linux-arm-kernel, iommu, devicetree,
	linux-kernel

On 14/11/2022 12:17, Konrad Dybcio wrote:
> 
> On 14/11/2022 12:01, Krzysztof Kozlowski wrote:
>> On 14/11/2022 11:42, Konrad Dybcio wrote:
>>> Some SMMUs require that a vote is held on as much as 3 separate PDs
>>> (hello Qualcomm). Allow it in bindings.
>>>
>>> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
>>> ---
>>> Changes since v1:
>>> - Add minItems
>>>
>>>   Documentation/devicetree/bindings/iommu/arm,smmu.yaml | 3 ++-
>>>   1 file changed, 2 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/Documentation/devicetree/bindings/iommu/arm,smmu.yaml b/Documentation/devicetree/bindings/iommu/arm,smmu.yaml
>>> index 9066e6df1ba1..82bc696de662 100644
>>> --- a/Documentation/devicetree/bindings/iommu/arm,smmu.yaml
>>> +++ b/Documentation/devicetree/bindings/iommu/arm,smmu.yaml
>>> @@ -159,7 +159,8 @@ properties:
>>>             through the TCU's programming interface.
>>>   
>>>     power-domains:
>>> -    maxItems: 1
>>> +    minItems: 0
>> It cannot be 0.
>>
>> minItems: 1
>>
>> Anyway you still need to restrict it per variant, as I said in previous
>> version.
> 
> Hm.. I'm not entirely sure what you mean.. Should I add a list of 
> compatibles

Yes and limit it to maxItems: 1 for "else".

> that are allowed to have 3 power-domains and leave it as it was before 
> in the
> 'else' case?

Best regards,
Krzysztof


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

* Re: [PATCH v2 1/9] dt-bindings: arm-smmu: Allow up to 3 power-domains
  2022-11-14 10:42 ` [PATCH v2 1/9] dt-bindings: arm-smmu: Allow up to 3 power-domains Konrad Dybcio
  2022-11-14 11:01   ` Krzysztof Kozlowski
@ 2022-11-14 14:19   ` Rob Herring
  1 sibling, 0 replies; 21+ messages in thread
From: Rob Herring @ 2022-11-14 14:19 UTC (permalink / raw)
  To: Konrad Dybcio
  Cc: Robin Murphy, Will Deacon, Joerg Roedel, patches, Rob Herring,
	krzysztof.kozlowski, Krzysztof Kozlowski, linux-kernel,
	devicetree, linux-arm-msm, agross, andersson, linux-arm-kernel,
	iommu


On Mon, 14 Nov 2022 11:42:14 +0100, Konrad Dybcio wrote:
> Some SMMUs require that a vote is held on as much as 3 separate PDs
> (hello Qualcomm). Allow it in bindings.
> 
> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
> ---
> Changes since v1:
> - Add minItems
> 
>  Documentation/devicetree/bindings/iommu/arm,smmu.yaml | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 

My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check'
on your patch (DT_CHECKER_FLAGS is new in v5.13):

yamllint warnings/errors:

dtschema/dtc warnings/errors:
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/iommu/arm,smmu.yaml: properties:power-domains:minItems: 0 is less than the minimum of 1
	from schema $id: http://devicetree.org/meta-schemas/keywords.yaml#
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/iommu/arm,smmu.yaml: properties:power-domains: 'anyOf' conditional failed, one must be fixed:
	'minItems' is not one of ['maxItems', 'description', 'deprecated']
		hint: Only "maxItems" is required for a single entry if there are no constraints defined for the values.
	'minItems' is not one of ['description', 'deprecated', 'const', 'enum', 'minimum', 'maximum', 'multipleOf', 'default', '$ref', 'oneOf']
	'maxItems' is not one of ['description', 'deprecated', 'const', 'enum', 'minimum', 'maximum', 'multipleOf', 'default', '$ref', 'oneOf']
	1 was expected
		hint: Only "maxItems" is required for a single entry if there are no constraints defined for the values.
	0 is less than the minimum of 1
		hint: Arrays must be described with a combination of minItems/maxItems/items
	hint: cell array properties must define how many entries and what the entries are when there is more than one entry.
	from schema $id: http://devicetree.org/meta-schemas/power-domain.yaml#

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/patch/

This check can fail if there are any dependencies. The base for a patch
series is generally the most recent rc1.

If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure 'yamllint' is installed and dt-schema is up to
date:

pip3 install dtschema --upgrade

Please check and re-submit.


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

* Re: [PATCH v2 1/9] dt-bindings: arm-smmu: Allow up to 3 power-domains
  2022-11-14 13:00       ` Krzysztof Kozlowski
@ 2022-11-14 15:53         ` Konrad Dybcio
  2022-11-14 16:58           ` Krzysztof Kozlowski
  0 siblings, 1 reply; 21+ messages in thread
From: Konrad Dybcio @ 2022-11-14 15:53 UTC (permalink / raw)
  To: Krzysztof Kozlowski, linux-arm-msm, andersson, agross
  Cc: patches, Will Deacon, Robin Murphy, Joerg Roedel, Rob Herring,
	Krzysztof Kozlowski, linux-arm-kernel, iommu, devicetree,
	linux-kernel


On 14/11/2022 14:00, Krzysztof Kozlowski wrote:
> On 14/11/2022 12:17, Konrad Dybcio wrote:
>> On 14/11/2022 12:01, Krzysztof Kozlowski wrote:
>>> On 14/11/2022 11:42, Konrad Dybcio wrote:
>>>> Some SMMUs require that a vote is held on as much as 3 separate PDs
>>>> (hello Qualcomm). Allow it in bindings.
>>>>
>>>> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
>>>> ---
>>>> Changes since v1:
>>>> - Add minItems
>>>>
>>>>    Documentation/devicetree/bindings/iommu/arm,smmu.yaml | 3 ++-
>>>>    1 file changed, 2 insertions(+), 1 deletion(-)
>>>>
>>>> diff --git a/Documentation/devicetree/bindings/iommu/arm,smmu.yaml b/Documentation/devicetree/bindings/iommu/arm,smmu.yaml
>>>> index 9066e6df1ba1..82bc696de662 100644
>>>> --- a/Documentation/devicetree/bindings/iommu/arm,smmu.yaml
>>>> +++ b/Documentation/devicetree/bindings/iommu/arm,smmu.yaml
>>>> @@ -159,7 +159,8 @@ properties:
>>>>              through the TCU's programming interface.
>>>>    
>>>>      power-domains:
>>>> -    maxItems: 1
>>>> +    minItems: 0
>>> It cannot be 0.
>>>
>>> minItems: 1
>>>
>>> Anyway you still need to restrict it per variant, as I said in previous
>>> version.
>> Hm.. I'm not entirely sure what you mean.. Should I add a list of
>> compatibles
> Yes and limit it to maxItems: 1 for "else".

I tried adding:



   - if:
       properties:
         compatible:
           contains:
             enum:
               - qcom,sm6375-smmu-500
     then:
       properties:
         power-domains:
           minItems: 3
           maxItems: 3
     else:
       properties:
         power-domains:
           maxItems: 1


Right under the nvidia reg if-else in the allOf, but dtbs_check throws 
errors like:


/home/konrad/linux/arch/arm64/boot/dts/qcom/msm8998-sony-xperia-yoshino-poplar.dtb: 
iommu@5040000: 'power-domains' does not match any of the regexes: 
'pinctrl-[0-9]+'


Any clues as to why?


Konrad

>
>> that are allowed to have 3 power-domains and leave it as it was before
>> in the
>> 'else' case?
> Best regards,
> Krzysztof
>

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

* Re: [PATCH v2 1/9] dt-bindings: arm-smmu: Allow up to 3 power-domains
  2022-11-14 15:53         ` Konrad Dybcio
@ 2022-11-14 16:58           ` Krzysztof Kozlowski
  2022-11-15 12:54             ` Konrad Dybcio
  0 siblings, 1 reply; 21+ messages in thread
From: Krzysztof Kozlowski @ 2022-11-14 16:58 UTC (permalink / raw)
  To: Konrad Dybcio, linux-arm-msm, andersson, agross
  Cc: patches, Will Deacon, Robin Murphy, Joerg Roedel, Rob Herring,
	Krzysztof Kozlowski, linux-arm-kernel, iommu, devicetree,
	linux-kernel

On 14/11/2022 16:53, Konrad Dybcio wrote:
> 
> On 14/11/2022 14:00, Krzysztof Kozlowski wrote:
>> On 14/11/2022 12:17, Konrad Dybcio wrote:
>>> On 14/11/2022 12:01, Krzysztof Kozlowski wrote:
>>>> On 14/11/2022 11:42, Konrad Dybcio wrote:
>>>>> Some SMMUs require that a vote is held on as much as 3 separate PDs
>>>>> (hello Qualcomm). Allow it in bindings.
>>>>>
>>>>> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
>>>>> ---
>>>>> Changes since v1:
>>>>> - Add minItems
>>>>>
>>>>>    Documentation/devicetree/bindings/iommu/arm,smmu.yaml | 3 ++-
>>>>>    1 file changed, 2 insertions(+), 1 deletion(-)
>>>>>
>>>>> diff --git a/Documentation/devicetree/bindings/iommu/arm,smmu.yaml b/Documentation/devicetree/bindings/iommu/arm,smmu.yaml
>>>>> index 9066e6df1ba1..82bc696de662 100644
>>>>> --- a/Documentation/devicetree/bindings/iommu/arm,smmu.yaml
>>>>> +++ b/Documentation/devicetree/bindings/iommu/arm,smmu.yaml
>>>>> @@ -159,7 +159,8 @@ properties:
>>>>>              through the TCU's programming interface.
>>>>>    
>>>>>      power-domains:
>>>>> -    maxItems: 1
>>>>> +    minItems: 0
>>>> It cannot be 0.
>>>>
>>>> minItems: 1
>>>>
>>>> Anyway you still need to restrict it per variant, as I said in previous
>>>> version.
>>> Hm.. I'm not entirely sure what you mean.. Should I add a list of
>>> compatibles
>> Yes and limit it to maxItems: 1 for "else".
> 
> I tried adding:
> 
> 
> 
>    - if:
>        properties:
>          compatible:
>            contains:
>              enum:
>                - qcom,sm6375-smmu-500
>      then:
>        properties:
>          power-domains:
>            minItems: 3
>            maxItems: 3
>      else:
>        properties:
>          power-domains:
>            maxItems: 1
> 
> 
> Right under the nvidia reg if-else in the allOf, but dtbs_check throws 
> errors like:
> 
> 
> /home/konrad/linux/arch/arm64/boot/dts/qcom/msm8998-sony-xperia-yoshino-poplar.dtb: 
> iommu@5040000: 'power-domains' does not match any of the regexes: 
> 'pinctrl-[0-9]+'
> 
> 
> Any clues as to why?

I don't know what code do you have there, but generic pattern is:

https://elixir.bootlin.com/linux/v5.19-rc6/source/Documentation/devicetree/bindings/clock/samsung,exynos7-clock.yaml#L38

Best regards,
Krzysztof


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

* Re: [PATCH v2 1/9] dt-bindings: arm-smmu: Allow up to 3 power-domains
  2022-11-14 16:58           ` Krzysztof Kozlowski
@ 2022-11-15 12:54             ` Konrad Dybcio
  2022-11-15 13:00               ` Krzysztof Kozlowski
  0 siblings, 1 reply; 21+ messages in thread
From: Konrad Dybcio @ 2022-11-15 12:54 UTC (permalink / raw)
  To: Krzysztof Kozlowski, linux-arm-msm, andersson, agross
  Cc: patches, Will Deacon, Robin Murphy, Joerg Roedel, Rob Herring,
	Krzysztof Kozlowski, linux-arm-kernel, iommu, devicetree,
	linux-kernel



On 14/11/2022 17:58, Krzysztof Kozlowski wrote:
> On 14/11/2022 16:53, Konrad Dybcio wrote:
>>
>> On 14/11/2022 14:00, Krzysztof Kozlowski wrote:
>>> On 14/11/2022 12:17, Konrad Dybcio wrote:
>>>> On 14/11/2022 12:01, Krzysztof Kozlowski wrote:
>>>>> On 14/11/2022 11:42, Konrad Dybcio wrote:
>>>>>> Some SMMUs require that a vote is held on as much as 3 separate PDs
>>>>>> (hello Qualcomm). Allow it in bindings.
>>>>>>
>>>>>> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
>>>>>> ---
>>>>>> Changes since v1:
>>>>>> - Add minItems
>>>>>>
>>>>>>     Documentation/devicetree/bindings/iommu/arm,smmu.yaml | 3 ++-
>>>>>>     1 file changed, 2 insertions(+), 1 deletion(-)
>>>>>>
>>>>>> diff --git a/Documentation/devicetree/bindings/iommu/arm,smmu.yaml b/Documentation/devicetree/bindings/iommu/arm,smmu.yaml
>>>>>> index 9066e6df1ba1..82bc696de662 100644
>>>>>> --- a/Documentation/devicetree/bindings/iommu/arm,smmu.yaml
>>>>>> +++ b/Documentation/devicetree/bindings/iommu/arm,smmu.yaml
>>>>>> @@ -159,7 +159,8 @@ properties:
>>>>>>               through the TCU's programming interface.
>>>>>>     
>>>>>>       power-domains:
>>>>>> -    maxItems: 1
>>>>>> +    minItems: 0
>>>>> It cannot be 0.
>>>>>
>>>>> minItems: 1
>>>>>
>>>>> Anyway you still need to restrict it per variant, as I said in previous
>>>>> version.
>>>> Hm.. I'm not entirely sure what you mean.. Should I add a list of
>>>> compatibles
>>> Yes and limit it to maxItems: 1 for "else".
>>
>> I tried adding:
>>
>>
>>
>>     - if:
>>         properties:
>>           compatible:
>>             contains:
>>               enum:
>>                 - qcom,sm6375-smmu-500
>>       then:
>>         properties:
>>           power-domains:
>>             minItems: 3
>>             maxItems: 3
>>       else:
>>         properties:
>>           power-domains:
>>             maxItems: 1
>>
>>
>> Right under the nvidia reg if-else in the allOf, but dtbs_check throws
>> errors like:
>>
>>
>> /home/konrad/linux/arch/arm64/boot/dts/qcom/msm8998-sony-xperia-yoshino-poplar.dtb:
>> iommu@5040000: 'power-domains' does not match any of the regexes:
>> 'pinctrl-[0-9]+'
>>
>>
>> Any clues as to why?
> 
> I don't know what code do you have there, but generic pattern is:
> 
> https://elixir.bootlin.com/linux/v5.19-rc6/source/Documentation/devicetree/bindings/clock/samsung,exynos7-clock.yaml#L38
> 
I tried many things, but I still don't seem to get a hang of it.. Here's 
my current diff rebased on top of Dmitry's recent cleanups (available at 
[1])


diff --git a/Documentation/devicetree/bindings/iommu/arm,smmu.yaml 
b/Documentation/devicetree/bindings/iommu/arm,smmu.yaml
index 28f5720824cd..55759aebc4a0 100644
--- a/Documentation/devicetree/bindings/iommu/arm,smmu.yaml
+++ b/Documentation/devicetree/bindings/iommu/arm,smmu.yaml
@@ -200,7 +200,7 @@ properties:
      maxItems: 7

    power-domains:
-    maxItems: 1
+    maxItems: 3

    nvidia,memory-controller:
      description: |
@@ -364,6 +364,26 @@ allOf:
              - description: interface clock required to access smmu's 
registers
                  through the TCU's programming interface.

+  - if:
+      properties:
+        compatible:
+          contains:
+            const: qcom,sm6375-smmu-500
+    then:
+      properties:
+        power-domains:
+          items:
+            - description: SNoC MMU TBU RT GDSC
+            - description: SNoC MMU TBU NRT GDSC
+            - description: SNoC TURING MMU TBU0 GDSC
+
+      required:
+        - power-domains
+    else:
+      properties:
+        power-domains:
+          maxItems: 1
+
  examples:
    - |+
      /* SMMU with stream matching or stream indexing */


In my eyes, this should work, but I still get errors like:

/home/konrad/linux/arch/arm64/boot/dts/qcom/sm8250-hdk.dtb: 
iommu@3da0000: power-domains: [[108, 0]] is too short

as if the else: path was never taken..

[1] 
https://git.kernel.org/pub/scm/linux/kernel/git/will/linux.git/log/?h=for-joerg/arm-smmu/bindings

Konrad
> Best regards,
> Krzysztof
> 

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

* Re: [PATCH v2 1/9] dt-bindings: arm-smmu: Allow up to 3 power-domains
  2022-11-15 12:54             ` Konrad Dybcio
@ 2022-11-15 13:00               ` Krzysztof Kozlowski
  2022-11-15 13:06                 ` Konrad Dybcio
  0 siblings, 1 reply; 21+ messages in thread
From: Krzysztof Kozlowski @ 2022-11-15 13:00 UTC (permalink / raw)
  To: Konrad Dybcio, linux-arm-msm, andersson, agross
  Cc: patches, Will Deacon, Robin Murphy, Joerg Roedel, Rob Herring,
	Krzysztof Kozlowski, linux-arm-kernel, iommu, devicetree,
	linux-kernel

On 15/11/2022 13:54, Konrad Dybcio wrote:
> 
> 
> On 14/11/2022 17:58, Krzysztof Kozlowski wrote:
>> On 14/11/2022 16:53, Konrad Dybcio wrote:
>>>
>>> On 14/11/2022 14:00, Krzysztof Kozlowski wrote:
>>>> On 14/11/2022 12:17, Konrad Dybcio wrote:
>>>>> On 14/11/2022 12:01, Krzysztof Kozlowski wrote:
>>>>>> On 14/11/2022 11:42, Konrad Dybcio wrote:
>>>>>>> Some SMMUs require that a vote is held on as much as 3 separate PDs
>>>>>>> (hello Qualcomm). Allow it in bindings.
>>>>>>>
>>>>>>> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
>>>>>>> ---
>>>>>>> Changes since v1:
>>>>>>> - Add minItems
>>>>>>>
>>>>>>>     Documentation/devicetree/bindings/iommu/arm,smmu.yaml | 3 ++-
>>>>>>>     1 file changed, 2 insertions(+), 1 deletion(-)
>>>>>>>
>>>>>>> diff --git a/Documentation/devicetree/bindings/iommu/arm,smmu.yaml b/Documentation/devicetree/bindings/iommu/arm,smmu.yaml
>>>>>>> index 9066e6df1ba1..82bc696de662 100644
>>>>>>> --- a/Documentation/devicetree/bindings/iommu/arm,smmu.yaml
>>>>>>> +++ b/Documentation/devicetree/bindings/iommu/arm,smmu.yaml
>>>>>>> @@ -159,7 +159,8 @@ properties:
>>>>>>>               through the TCU's programming interface.
>>>>>>>     
>>>>>>>       power-domains:
>>>>>>> -    maxItems: 1
>>>>>>> +    minItems: 0
>>>>>> It cannot be 0.
>>>>>>
>>>>>> minItems: 1
>>>>>>
>>>>>> Anyway you still need to restrict it per variant, as I said in previous
>>>>>> version.
>>>>> Hm.. I'm not entirely sure what you mean.. Should I add a list of
>>>>> compatibles
>>>> Yes and limit it to maxItems: 1 for "else".
>>>
>>> I tried adding:
>>>
>>>
>>>
>>>     - if:
>>>         properties:
>>>           compatible:
>>>             contains:
>>>               enum:
>>>                 - qcom,sm6375-smmu-500
>>>       then:
>>>         properties:
>>>           power-domains:
>>>             minItems: 3
>>>             maxItems: 3
>>>       else:
>>>         properties:
>>>           power-domains:
>>>             maxItems: 1
>>>
>>>
>>> Right under the nvidia reg if-else in the allOf, but dtbs_check throws
>>> errors like:
>>>
>>>
>>> /home/konrad/linux/arch/arm64/boot/dts/qcom/msm8998-sony-xperia-yoshino-poplar.dtb:
>>> iommu@5040000: 'power-domains' does not match any of the regexes:
>>> 'pinctrl-[0-9]+'
>>>
>>>
>>> Any clues as to why?
>>
>> I don't know what code do you have there, but generic pattern is:
>>
>> https://elixir.bootlin.com/linux/v5.19-rc6/source/Documentation/devicetree/bindings/clock/samsung,exynos7-clock.yaml#L38
>>
> I tried many things, but I still don't seem to get a hang of it.. Here's 
> my current diff rebased on top of Dmitry's recent cleanups (available at 
> [1])
> 
> 
> diff --git a/Documentation/devicetree/bindings/iommu/arm,smmu.yaml 
> b/Documentation/devicetree/bindings/iommu/arm,smmu.yaml
> index 28f5720824cd..55759aebc4a0 100644
> --- a/Documentation/devicetree/bindings/iommu/arm,smmu.yaml
> +++ b/Documentation/devicetree/bindings/iommu/arm,smmu.yaml
> @@ -200,7 +200,7 @@ properties:
>       maxItems: 7
> 
>     power-domains:

As I mentioned before - minItems: 1.

Just like the link I gave you.

> -    maxItems: 1
> +    maxItems: 3
> 
>     nvidia,memory-controller:
>       description: |
> @@ -364,6 +364,26 @@ allOf:
>               - description: interface clock required to access smmu's 
> registers
>                   through the TCU's programming interface.
> 
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            const: qcom,sm6375-smmu-500
> +    then:
> +      properties:
> +        power-domains:
> +          items:
> +            - description: SNoC MMU TBU RT GDSC
> +            - description: SNoC MMU TBU NRT GDSC
> +            - description: SNoC TURING MMU TBU0 GDSC
> +
> +      required:
> +        - power-domains
> +    else:
> +      properties:
> +        power-domains:
> +          maxItems: 1
> +
>   examples:
>     - |+
>       /* SMMU with stream matching or stream indexing */
> 
> 
> In my eyes, this should work, but I still get errors like:
> 
> /home/konrad/linux/arch/arm64/boot/dts/qcom/sm8250-hdk.dtb: 
> iommu@3da0000: power-domains: [[108, 0]] is too short
> 
> as if the else: path was never taken..

It was, but the top-level property said that minItems=3 (implicitly), so
it is too short.

Best regards,
Krzysztof


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

* Re: [PATCH v2 1/9] dt-bindings: arm-smmu: Allow up to 3 power-domains
  2022-11-15 13:00               ` Krzysztof Kozlowski
@ 2022-11-15 13:06                 ` Konrad Dybcio
  2022-11-15 13:43                   ` Robin Murphy
  2022-11-15 13:48                   ` Krzysztof Kozlowski
  0 siblings, 2 replies; 21+ messages in thread
From: Konrad Dybcio @ 2022-11-15 13:06 UTC (permalink / raw)
  To: Krzysztof Kozlowski, linux-arm-msm, andersson, agross
  Cc: patches, Will Deacon, Robin Murphy, Joerg Roedel, Rob Herring,
	Krzysztof Kozlowski, linux-arm-kernel, iommu, devicetree,
	linux-kernel



On 15/11/2022 14:00, Krzysztof Kozlowski wrote:
> On 15/11/2022 13:54, Konrad Dybcio wrote:
>>
>>
>> On 14/11/2022 17:58, Krzysztof Kozlowski wrote:
>>> On 14/11/2022 16:53, Konrad Dybcio wrote:
>>>>
>>>> On 14/11/2022 14:00, Krzysztof Kozlowski wrote:
>>>>> On 14/11/2022 12:17, Konrad Dybcio wrote:
>>>>>> On 14/11/2022 12:01, Krzysztof Kozlowski wrote:
>>>>>>> On 14/11/2022 11:42, Konrad Dybcio wrote:
>>>>>>>> Some SMMUs require that a vote is held on as much as 3 separate PDs
>>>>>>>> (hello Qualcomm). Allow it in bindings.
>>>>>>>>
>>>>>>>> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
>>>>>>>> ---
>>>>>>>> Changes since v1:
>>>>>>>> - Add minItems
>>>>>>>>
>>>>>>>>      Documentation/devicetree/bindings/iommu/arm,smmu.yaml | 3 ++-
>>>>>>>>      1 file changed, 2 insertions(+), 1 deletion(-)
>>>>>>>>
>>>>>>>> diff --git a/Documentation/devicetree/bindings/iommu/arm,smmu.yaml b/Documentation/devicetree/bindings/iommu/arm,smmu.yaml
>>>>>>>> index 9066e6df1ba1..82bc696de662 100644
>>>>>>>> --- a/Documentation/devicetree/bindings/iommu/arm,smmu.yaml
>>>>>>>> +++ b/Documentation/devicetree/bindings/iommu/arm,smmu.yaml
>>>>>>>> @@ -159,7 +159,8 @@ properties:
>>>>>>>>                through the TCU's programming interface.
>>>>>>>>      
>>>>>>>>        power-domains:
>>>>>>>> -    maxItems: 1
>>>>>>>> +    minItems: 0
>>>>>>> It cannot be 0.
>>>>>>>
>>>>>>> minItems: 1
>>>>>>>
>>>>>>> Anyway you still need to restrict it per variant, as I said in previous
>>>>>>> version.
>>>>>> Hm.. I'm not entirely sure what you mean.. Should I add a list of
>>>>>> compatibles
>>>>> Yes and limit it to maxItems: 1 for "else".
>>>>
>>>> I tried adding:
>>>>
>>>>
>>>>
>>>>      - if:
>>>>          properties:
>>>>            compatible:
>>>>              contains:
>>>>                enum:
>>>>                  - qcom,sm6375-smmu-500
>>>>        then:
>>>>          properties:
>>>>            power-domains:
>>>>              minItems: 3
>>>>              maxItems: 3
>>>>        else:
>>>>          properties:
>>>>            power-domains:
>>>>              maxItems: 1
>>>>
>>>>
>>>> Right under the nvidia reg if-else in the allOf, but dtbs_check throws
>>>> errors like:
>>>>
>>>>
>>>> /home/konrad/linux/arch/arm64/boot/dts/qcom/msm8998-sony-xperia-yoshino-poplar.dtb:
>>>> iommu@5040000: 'power-domains' does not match any of the regexes:
>>>> 'pinctrl-[0-9]+'
>>>>
>>>>
>>>> Any clues as to why?
>>>
>>> I don't know what code do you have there, but generic pattern is:
>>>
>>> https://elixir.bootlin.com/linux/v5.19-rc6/source/Documentation/devicetree/bindings/clock/samsung,exynos7-clock.yaml#L38
>>>
>> I tried many things, but I still don't seem to get a hang of it.. Here's
>> my current diff rebased on top of Dmitry's recent cleanups (available at
>> [1])
>>
>>
>> diff --git a/Documentation/devicetree/bindings/iommu/arm,smmu.yaml
>> b/Documentation/devicetree/bindings/iommu/arm,smmu.yaml
>> index 28f5720824cd..55759aebc4a0 100644
>> --- a/Documentation/devicetree/bindings/iommu/arm,smmu.yaml
>> +++ b/Documentation/devicetree/bindings/iommu/arm,smmu.yaml
>> @@ -200,7 +200,7 @@ properties:
>>        maxItems: 7
>>
>>      power-domains:
> 
> As I mentioned before - minItems: 1.
But not all SMMUs require a power domain :/

> 
> Just like the link I gave you.
> 
>> -    maxItems: 1
>> +    maxItems: 3
>>
>>      nvidia,memory-controller:
>>        description: |
>> @@ -364,6 +364,26 @@ allOf:
>>                - description: interface clock required to access smmu's
>> registers
>>                    through the TCU's programming interface.
>>
>> +  - if:
>> +      properties:
>> +        compatible:
>> +          contains:
>> +            const: qcom,sm6375-smmu-500
>> +    then:
>> +      properties:
>> +        power-domains:
>> +          items:
>> +            - description: SNoC MMU TBU RT GDSC
>> +            - description: SNoC MMU TBU NRT GDSC
>> +            - description: SNoC TURING MMU TBU0 GDSC
>> +
>> +      required:
>> +        - power-domains
>> +    else:
>> +      properties:
>> +        power-domains:
>> +          maxItems: 1
>> +
>>    examples:
>>      - |+
>>        /* SMMU with stream matching or stream indexing */
>>
>>
>> In my eyes, this should work, but I still get errors like:
>>
>> /home/konrad/linux/arch/arm64/boot/dts/qcom/sm8250-hdk.dtb:
>> iommu@3da0000: power-domains: [[108, 0]] is too short
>>
>> as if the else: path was never taken..
> 
> It was, but the top-level property said that minItems=3 (implicitly), so
> it is too short.
So the top-level properties take precedence over the ones that come from 
the if-then-else?? Ugh.

Konrad
> 
> Best regards,
> Krzysztof
> 

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

* Re: [PATCH v2 1/9] dt-bindings: arm-smmu: Allow up to 3 power-domains
  2022-11-15 13:06                 ` Konrad Dybcio
@ 2022-11-15 13:43                   ` Robin Murphy
  2022-11-15 15:04                     ` Konrad Dybcio
  2022-11-15 13:48                   ` Krzysztof Kozlowski
  1 sibling, 1 reply; 21+ messages in thread
From: Robin Murphy @ 2022-11-15 13:43 UTC (permalink / raw)
  To: Konrad Dybcio, Krzysztof Kozlowski, linux-arm-msm, andersson, agross
  Cc: patches, Will Deacon, Joerg Roedel, Rob Herring,
	Krzysztof Kozlowski, linux-arm-kernel, iommu, devicetree,
	linux-kernel

On 2022-11-15 13:06, Konrad Dybcio wrote:
> 
> 
> On 15/11/2022 14:00, Krzysztof Kozlowski wrote:
>> On 15/11/2022 13:54, Konrad Dybcio wrote:
>>>
>>>
>>> On 14/11/2022 17:58, Krzysztof Kozlowski wrote:
>>>> On 14/11/2022 16:53, Konrad Dybcio wrote:
>>>>>
>>>>> On 14/11/2022 14:00, Krzysztof Kozlowski wrote:
>>>>>> On 14/11/2022 12:17, Konrad Dybcio wrote:
>>>>>>> On 14/11/2022 12:01, Krzysztof Kozlowski wrote:
>>>>>>>> On 14/11/2022 11:42, Konrad Dybcio wrote:
>>>>>>>>> Some SMMUs require that a vote is held on as much as 3 separate 
>>>>>>>>> PDs
>>>>>>>>> (hello Qualcomm). Allow it in bindings.
>>>>>>>>>
>>>>>>>>> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
>>>>>>>>> ---
>>>>>>>>> Changes since v1:
>>>>>>>>> - Add minItems
>>>>>>>>>
>>>>>>>>>      Documentation/devicetree/bindings/iommu/arm,smmu.yaml | 3 ++-
>>>>>>>>>      1 file changed, 2 insertions(+), 1 deletion(-)
>>>>>>>>>
>>>>>>>>> diff --git 
>>>>>>>>> a/Documentation/devicetree/bindings/iommu/arm,smmu.yaml 
>>>>>>>>> b/Documentation/devicetree/bindings/iommu/arm,smmu.yaml
>>>>>>>>> index 9066e6df1ba1..82bc696de662 100644
>>>>>>>>> --- a/Documentation/devicetree/bindings/iommu/arm,smmu.yaml
>>>>>>>>> +++ b/Documentation/devicetree/bindings/iommu/arm,smmu.yaml
>>>>>>>>> @@ -159,7 +159,8 @@ properties:
>>>>>>>>>                through the TCU's programming interface.
>>>>>>>>>        power-domains:
>>>>>>>>> -    maxItems: 1
>>>>>>>>> +    minItems: 0
>>>>>>>> It cannot be 0.
>>>>>>>>
>>>>>>>> minItems: 1
>>>>>>>>
>>>>>>>> Anyway you still need to restrict it per variant, as I said in 
>>>>>>>> previous
>>>>>>>> version.
>>>>>>> Hm.. I'm not entirely sure what you mean.. Should I add a list of
>>>>>>> compatibles
>>>>>> Yes and limit it to maxItems: 1 for "else".
>>>>>
>>>>> I tried adding:
>>>>>
>>>>>
>>>>>
>>>>>      - if:
>>>>>          properties:
>>>>>            compatible:
>>>>>              contains:
>>>>>                enum:
>>>>>                  - qcom,sm6375-smmu-500
>>>>>        then:
>>>>>          properties:
>>>>>            power-domains:
>>>>>              minItems: 3
>>>>>              maxItems: 3
>>>>>        else:
>>>>>          properties:
>>>>>            power-domains:
>>>>>              maxItems: 1
>>>>>
>>>>>
>>>>> Right under the nvidia reg if-else in the allOf, but dtbs_check throws
>>>>> errors like:
>>>>>
>>>>>
>>>>> /home/konrad/linux/arch/arm64/boot/dts/qcom/msm8998-sony-xperia-yoshino-poplar.dtb:
>>>>> iommu@5040000: 'power-domains' does not match any of the regexes:
>>>>> 'pinctrl-[0-9]+'
>>>>>
>>>>>
>>>>> Any clues as to why?
>>>>
>>>> I don't know what code do you have there, but generic pattern is:
>>>>
>>>> https://elixir.bootlin.com/linux/v5.19-rc6/source/Documentation/devicetree/bindings/clock/samsung,exynos7-clock.yaml#L38
>>>>
>>> I tried many things, but I still don't seem to get a hang of it.. Here's
>>> my current diff rebased on top of Dmitry's recent cleanups (available at
>>> [1])
>>>
>>>
>>> diff --git a/Documentation/devicetree/bindings/iommu/arm,smmu.yaml
>>> b/Documentation/devicetree/bindings/iommu/arm,smmu.yaml
>>> index 28f5720824cd..55759aebc4a0 100644
>>> --- a/Documentation/devicetree/bindings/iommu/arm,smmu.yaml
>>> +++ b/Documentation/devicetree/bindings/iommu/arm,smmu.yaml
>>> @@ -200,7 +200,7 @@ properties:
>>>        maxItems: 7
>>>
>>>      power-domains:
>>
>> As I mentioned before - minItems: 1.
> But not all SMMUs require a power domain :/

Right, so it's not a required property. However if it *is* present, then 
it needs to reference at least one power domain, because having an empty 
property, i.e.:

	power-domains = <>;

or
	power-domains;

makes no sense whatsoever.

Thanks,
Robin.

> 
>>
>> Just like the link I gave you.
>>
>>> -    maxItems: 1
>>> +    maxItems: 3
>>>
>>>      nvidia,memory-controller:
>>>        description: |
>>> @@ -364,6 +364,26 @@ allOf:
>>>                - description: interface clock required to access smmu's
>>> registers
>>>                    through the TCU's programming interface.
>>>
>>> +  - if:
>>> +      properties:
>>> +        compatible:
>>> +          contains:
>>> +            const: qcom,sm6375-smmu-500
>>> +    then:
>>> +      properties:
>>> +        power-domains:
>>> +          items:
>>> +            - description: SNoC MMU TBU RT GDSC
>>> +            - description: SNoC MMU TBU NRT GDSC
>>> +            - description: SNoC TURING MMU TBU0 GDSC
>>> +
>>> +      required:
>>> +        - power-domains
>>> +    else:
>>> +      properties:
>>> +        power-domains:
>>> +          maxItems: 1
>>> +
>>>    examples:
>>>      - |+
>>>        /* SMMU with stream matching or stream indexing */
>>>
>>>
>>> In my eyes, this should work, but I still get errors like:
>>>
>>> /home/konrad/linux/arch/arm64/boot/dts/qcom/sm8250-hdk.dtb:
>>> iommu@3da0000: power-domains: [[108, 0]] is too short
>>>
>>> as if the else: path was never taken..
>>
>> It was, but the top-level property said that minItems=3 (implicitly), so
>> it is too short.
> So the top-level properties take precedence over the ones that come from 
> the if-then-else?? Ugh.
> 
> Konrad
>>
>> Best regards,
>> Krzysztof
>>

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

* Re: [PATCH v2 1/9] dt-bindings: arm-smmu: Allow up to 3 power-domains
  2022-11-15 13:06                 ` Konrad Dybcio
  2022-11-15 13:43                   ` Robin Murphy
@ 2022-11-15 13:48                   ` Krzysztof Kozlowski
  1 sibling, 0 replies; 21+ messages in thread
From: Krzysztof Kozlowski @ 2022-11-15 13:48 UTC (permalink / raw)
  To: Konrad Dybcio, linux-arm-msm, andersson, agross
  Cc: patches, Will Deacon, Robin Murphy, Joerg Roedel, Rob Herring,
	Krzysztof Kozlowski, linux-arm-kernel, iommu, devicetree,
	linux-kernel

On 15/11/2022 14:06, Konrad Dybcio wrote:>> diff --git
a/Documentation/devicetree/bindings/iommu/arm,smmu.yaml
>>> b/Documentation/devicetree/bindings/iommu/arm,smmu.yaml
>>> index 28f5720824cd..55759aebc4a0 100644
>>> --- a/Documentation/devicetree/bindings/iommu/arm,smmu.yaml
>>> +++ b/Documentation/devicetree/bindings/iommu/arm,smmu.yaml
>>> @@ -200,7 +200,7 @@ properties:
>>>        maxItems: 7
>>>
>>>      power-domains:
>>
>> As I mentioned before - minItems: 1.
> But not all SMMUs require a power domain :/

It does not matter. This does not require power-domains.

> 
>>
>> Just like the link I gave you.
>>
>>> -    maxItems: 1
>>> +    maxItems: 3
>>>
>>>      nvidia,memory-controller:
>>>        description: |
>>> @@ -364,6 +364,26 @@ allOf:
>>>                - description: interface clock required to access smmu's
>>> registers
>>>                    through the TCU's programming interface.
>>>
>>> +  - if:
>>> +      properties:
>>> +        compatible:
>>> +          contains:
>>> +            const: qcom,sm6375-smmu-500
>>> +    then:
>>> +      properties:
>>> +        power-domains:
>>> +          items:
>>> +            - description: SNoC MMU TBU RT GDSC
>>> +            - description: SNoC MMU TBU NRT GDSC
>>> +            - description: SNoC TURING MMU TBU0 GDSC
>>> +
>>> +      required:
>>> +        - power-domains
>>> +    else:
>>> +      properties:
>>> +        power-domains:
>>> +          maxItems: 1
>>> +
>>>    examples:
>>>      - |+
>>>        /* SMMU with stream matching or stream indexing */
>>>
>>>
>>> In my eyes, this should work, but I still get errors like:
>>>
>>> /home/konrad/linux/arch/arm64/boot/dts/qcom/sm8250-hdk.dtb:
>>> iommu@3da0000: power-domains: [[108, 0]] is too short
>>>
>>> as if the else: path was never taken..
>>
>> It was, but the top-level property said that minItems=3 (implicitly), so
>> it is too short.
> So the top-level properties take precedence over the ones that come from 
> the if-then-else?? Ugh.

It's a sum of them. Top level is expected to define the widest
constraints and if-then-else narrows them per variants.

Best regards,
Krzysztof


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

* Re: [PATCH v2 1/9] dt-bindings: arm-smmu: Allow up to 3 power-domains
  2022-11-15 13:43                   ` Robin Murphy
@ 2022-11-15 15:04                     ` Konrad Dybcio
  0 siblings, 0 replies; 21+ messages in thread
From: Konrad Dybcio @ 2022-11-15 15:04 UTC (permalink / raw)
  To: Robin Murphy, Krzysztof Kozlowski, linux-arm-msm, andersson, agross
  Cc: patches, Will Deacon, Joerg Roedel, Rob Herring,
	Krzysztof Kozlowski, linux-arm-kernel, iommu, devicetree,
	linux-kernel



On 15/11/2022 14:43, Robin Murphy wrote:
> On 2022-11-15 13:06, Konrad Dybcio wrote:
>>
>>
>> On 15/11/2022 14:00, Krzysztof Kozlowski wrote:
>>> On 15/11/2022 13:54, Konrad Dybcio wrote:
>>>>
>>>>
>>>> On 14/11/2022 17:58, Krzysztof Kozlowski wrote:
>>>>> On 14/11/2022 16:53, Konrad Dybcio wrote:
>>>>>>
>>>>>> On 14/11/2022 14:00, Krzysztof Kozlowski wrote:
>>>>>>> On 14/11/2022 12:17, Konrad Dybcio wrote:
>>>>>>>> On 14/11/2022 12:01, Krzysztof Kozlowski wrote:
>>>>>>>>> On 14/11/2022 11:42, Konrad Dybcio wrote:
>>>>>>>>>> Some SMMUs require that a vote is held on as much as 3 
>>>>>>>>>> separate PDs
>>>>>>>>>> (hello Qualcomm). Allow it in bindings.
>>>>>>>>>>
>>>>>>>>>> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
>>>>>>>>>> ---
>>>>>>>>>> Changes since v1:
>>>>>>>>>> - Add minItems
>>>>>>>>>>
>>>>>>>>>>      Documentation/devicetree/bindings/iommu/arm,smmu.yaml | 3 
>>>>>>>>>> ++-
>>>>>>>>>>      1 file changed, 2 insertions(+), 1 deletion(-)
>>>>>>>>>>
>>>>>>>>>> diff --git 
>>>>>>>>>> a/Documentation/devicetree/bindings/iommu/arm,smmu.yaml 
>>>>>>>>>> b/Documentation/devicetree/bindings/iommu/arm,smmu.yaml
>>>>>>>>>> index 9066e6df1ba1..82bc696de662 100644
>>>>>>>>>> --- a/Documentation/devicetree/bindings/iommu/arm,smmu.yaml
>>>>>>>>>> +++ b/Documentation/devicetree/bindings/iommu/arm,smmu.yaml
>>>>>>>>>> @@ -159,7 +159,8 @@ properties:
>>>>>>>>>>                through the TCU's programming interface.
>>>>>>>>>>        power-domains:
>>>>>>>>>> -    maxItems: 1
>>>>>>>>>> +    minItems: 0
>>>>>>>>> It cannot be 0.
>>>>>>>>>
>>>>>>>>> minItems: 1
>>>>>>>>>
>>>>>>>>> Anyway you still need to restrict it per variant, as I said in 
>>>>>>>>> previous
>>>>>>>>> version.
>>>>>>>> Hm.. I'm not entirely sure what you mean.. Should I add a list of
>>>>>>>> compatibles
>>>>>>> Yes and limit it to maxItems: 1 for "else".
>>>>>>
>>>>>> I tried adding:
>>>>>>
>>>>>>
>>>>>>
>>>>>>      - if:
>>>>>>          properties:
>>>>>>            compatible:
>>>>>>              contains:
>>>>>>                enum:
>>>>>>                  - qcom,sm6375-smmu-500
>>>>>>        then:
>>>>>>          properties:
>>>>>>            power-domains:
>>>>>>              minItems: 3
>>>>>>              maxItems: 3
>>>>>>        else:
>>>>>>          properties:
>>>>>>            power-domains:
>>>>>>              maxItems: 1
>>>>>>
>>>>>>
>>>>>> Right under the nvidia reg if-else in the allOf, but dtbs_check 
>>>>>> throws
>>>>>> errors like:
>>>>>>
>>>>>>
>>>>>> /home/konrad/linux/arch/arm64/boot/dts/qcom/msm8998-sony-xperia-yoshino-poplar.dtb:
>>>>>> iommu@5040000: 'power-domains' does not match any of the regexes:
>>>>>> 'pinctrl-[0-9]+'
>>>>>>
>>>>>>
>>>>>> Any clues as to why?
>>>>>
>>>>> I don't know what code do you have there, but generic pattern is:
>>>>>
>>>>> https://elixir.bootlin.com/linux/v5.19-rc6/source/Documentation/devicetree/bindings/clock/samsung,exynos7-clock.yaml#L38
>>>>>
>>>> I tried many things, but I still don't seem to get a hang of it.. 
>>>> Here's
>>>> my current diff rebased on top of Dmitry's recent cleanups 
>>>> (available at
>>>> [1])
>>>>
>>>>
>>>> diff --git a/Documentation/devicetree/bindings/iommu/arm,smmu.yaml
>>>> b/Documentation/devicetree/bindings/iommu/arm,smmu.yaml
>>>> index 28f5720824cd..55759aebc4a0 100644
>>>> --- a/Documentation/devicetree/bindings/iommu/arm,smmu.yaml
>>>> +++ b/Documentation/devicetree/bindings/iommu/arm,smmu.yaml
>>>> @@ -200,7 +200,7 @@ properties:
>>>>        maxItems: 7
>>>>
>>>>      power-domains:
>>>
>>> As I mentioned before - minItems: 1.
>> But not all SMMUs require a power domain :/
> 
> Right, so it's not a required property. However if it *is* present, then 
> it needs to reference at least one power domain, because having an empty 
> property, i.e.:
> 
>      power-domains = <>;
> 
> or
>      power-domains;
> 
> makes no sense whatsoever.
> 
> Thanks,
> Robin.
OHHHH!

That was the missing piece that made it click for me!
Thanks Krzysztof, Robin for guiding me through this.

Konrad
> 
>>
>>>
>>> Just like the link I gave you.
>>>
>>>> -    maxItems: 1
>>>> +    maxItems: 3
>>>>
>>>>      nvidia,memory-controller:
>>>>        description: |
>>>> @@ -364,6 +364,26 @@ allOf:
>>>>                - description: interface clock required to access smmu's
>>>> registers
>>>>                    through the TCU's programming interface.
>>>>
>>>> +  - if:
>>>> +      properties:
>>>> +        compatible:
>>>> +          contains:
>>>> +            const: qcom,sm6375-smmu-500
>>>> +    then:
>>>> +      properties:
>>>> +        power-domains:
>>>> +          items:
>>>> +            - description: SNoC MMU TBU RT GDSC
>>>> +            - description: SNoC MMU TBU NRT GDSC
>>>> +            - description: SNoC TURING MMU TBU0 GDSC
>>>> +
>>>> +      required:
>>>> +        - power-domains
>>>> +    else:
>>>> +      properties:
>>>> +        power-domains:
>>>> +          maxItems: 1
>>>> +
>>>>    examples:
>>>>      - |+
>>>>        /* SMMU with stream matching or stream indexing */
>>>>
>>>>
>>>> In my eyes, this should work, but I still get errors like:
>>>>
>>>> /home/konrad/linux/arch/arm64/boot/dts/qcom/sm8250-hdk.dtb:
>>>> iommu@3da0000: power-domains: [[108, 0]] is too short
>>>>
>>>> as if the else: path was never taken..
>>>
>>> It was, but the top-level property said that minItems=3 (implicitly), so
>>> it is too short.
>> So the top-level properties take precedence over the ones that come 
>> from the if-then-else?? Ugh.
>>
>> Konrad
>>>
>>> Best regards,
>>> Krzysztof
>>>

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

end of thread, other threads:[~2022-11-15 15:04 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20221114104222.36329-1-konrad.dybcio@linaro.org>
2022-11-14 10:42 ` [PATCH v2 1/9] dt-bindings: arm-smmu: Allow up to 3 power-domains Konrad Dybcio
2022-11-14 11:01   ` Krzysztof Kozlowski
2022-11-14 11:17     ` Konrad Dybcio
2022-11-14 13:00       ` Krzysztof Kozlowski
2022-11-14 15:53         ` Konrad Dybcio
2022-11-14 16:58           ` Krzysztof Kozlowski
2022-11-15 12:54             ` Konrad Dybcio
2022-11-15 13:00               ` Krzysztof Kozlowski
2022-11-15 13:06                 ` Konrad Dybcio
2022-11-15 13:43                   ` Robin Murphy
2022-11-15 15:04                     ` Konrad Dybcio
2022-11-15 13:48                   ` Krzysztof Kozlowski
2022-11-14 14:19   ` Rob Herring
2022-11-14 10:42 ` [PATCH v2 2/9] arm64: dts: qcom: pmk8350: Allow specifying arbitrary SID Konrad Dybcio
2022-11-14 10:42 ` [PATCH v2 3/9] arm64: dts: qcom: sm6375: Add GPI DMA nodes Konrad Dybcio
2022-11-14 10:42 ` [PATCH v2 4/9] arm64: dts: qcom: sm6375: Add pin configs for some QUP configurations Konrad Dybcio
2022-11-14 10:42 ` [PATCH v2 5/9] arm64: dts: qcom: sm6375: Add QUPs and corresponding SPI/I2C hosts Konrad Dybcio
2022-11-14 10:42 ` [PATCH v2 6/9] arm64: dts: qcom: sm6375-pdx225: Enable QUPs & GPI DMA Konrad Dybcio
2022-11-14 10:42 ` [PATCH v2 7/9] arm64: dts: qcom: sm6375-pdx225: Add PMIC peripherals Konrad Dybcio
2022-11-14 10:42 ` [PATCH v2 8/9] arm64: dts: qcom: sm6375-pdx225: Configure SMD RPM regulators Konrad Dybcio
2022-11-14 10:42 ` [PATCH v2 9/9] arm64: dts: qcom: sm6375-pdx225: Configure Samsung touchscreen Konrad Dybcio

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