linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/2] arm64: dts: qcom: sm6125: Enable GPI DMA
@ 2022-12-16 23:15 Marijn Suijten
  2022-12-16 23:15 ` [PATCH v2 1/2] dt-bindings: dma: gpi: Document SM6125 compatible Marijn Suijten
  2022-12-16 23:15 ` [PATCH v2 2/2] arm64: dts: qcom: sm6125: Add GPI DMA nodes Marijn Suijten
  0 siblings, 2 replies; 6+ messages in thread
From: Marijn Suijten @ 2022-12-16 23:15 UTC (permalink / raw)
  To: phone-devel, Andy Gross, Bjorn Andersson, Vinod Koul,
	Rob Herring, Krzysztof Kozlowski
  Cc: ~postmarketos/upstreaming, AngeloGioacchino Del Regno,
	Konrad Dybcio, Martin Botka, Jami Kettunen, Marijn Suijten,
	Lux Aliaga, Konrad Dybcio, Richard Acayan, linux-arm-msm,
	dmaengine, devicetree, linux-kernel

Enable GPI DMA on SM6125 by using the new sdm845 compatible with
ee_offset 0.

Changes since v1:
- Drop driver patch in favour of using generic qcom,sdm845-gpi-dma
  compatible [1];
- Replace status = "okay" with "disabled";
- Use 3 instead of 5 dma cells;
- Reorder properties;
- Explicitly depend on APPS SMMU series to have apps_smmu label available.

v1: https://lore.kernel.org/all/20221001185526.494095-1-martin.botka@somainline.org/T/#u

Depends on:
- SM6125 APPS SMMU: https://lore.kernel.org/linux-arm-msm/20221216215819.1164973-1-marijn.suijten@somainline.org/T/#u

[1]: https://lore.kernel.org/all/20220927014846.32892-2-mailingradian@gmail.com/

Martin Botka (2):
  dt-bindings: dma: gpi: Document SM6125 compatible
  arm64: dts: qcom: sm6125: Add GPI DMA nodes

 .../devicetree/bindings/dma/qcom,gpi.yaml     |  1 +
 arch/arm64/boot/dts/qcom/sm6125.dtsi          | 37 +++++++++++++++++++
 2 files changed, 38 insertions(+)

--
2.39.0


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

* [PATCH v2 1/2] dt-bindings: dma: gpi: Document SM6125 compatible
  2022-12-16 23:15 [PATCH v2 0/2] arm64: dts: qcom: sm6125: Enable GPI DMA Marijn Suijten
@ 2022-12-16 23:15 ` Marijn Suijten
  2022-12-19  9:09   ` Krzysztof Kozlowski
  2022-12-16 23:15 ` [PATCH v2 2/2] arm64: dts: qcom: sm6125: Add GPI DMA nodes Marijn Suijten
  1 sibling, 1 reply; 6+ messages in thread
From: Marijn Suijten @ 2022-12-16 23:15 UTC (permalink / raw)
  To: phone-devel, Andy Gross, Bjorn Andersson, Vinod Koul,
	Rob Herring, Krzysztof Kozlowski
  Cc: ~postmarketos/upstreaming, AngeloGioacchino Del Regno,
	Konrad Dybcio, Martin Botka, Jami Kettunen, Marijn Suijten,
	Lux Aliaga, Konrad Dybcio, Richard Acayan, linux-arm-msm,
	dmaengine, devicetree, linux-kernel

From: Martin Botka <martin.botka@somainline.org>

Document compatibility for this GPI DMA controller on SM6125.

Signed-off-by: Martin Botka <martin.botka@somainline.org>
[Marijn: Move compatible to the list with qcom,sdm845-gpi-dma]
Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org>
---
 Documentation/devicetree/bindings/dma/qcom,gpi.yaml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/dma/qcom,gpi.yaml b/Documentation/devicetree/bindings/dma/qcom,gpi.yaml
index e7ba1c47a88e..6132f4661a29 100644
--- a/Documentation/devicetree/bindings/dma/qcom,gpi.yaml
+++ b/Documentation/devicetree/bindings/dma/qcom,gpi.yaml
@@ -33,6 +33,7 @@ properties:
       - items:
           - enum:
               - qcom,sdm670-gpi-dma
+              - qcom,sm6125-gpi-dma
               - qcom,sm8150-gpi-dma
               - qcom,sm8250-gpi-dma
           - const: qcom,sdm845-gpi-dma
-- 
2.39.0


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

* [PATCH v2 2/2] arm64: dts: qcom: sm6125: Add GPI DMA nodes
  2022-12-16 23:15 [PATCH v2 0/2] arm64: dts: qcom: sm6125: Enable GPI DMA Marijn Suijten
  2022-12-16 23:15 ` [PATCH v2 1/2] dt-bindings: dma: gpi: Document SM6125 compatible Marijn Suijten
@ 2022-12-16 23:15 ` Marijn Suijten
  2022-12-17 14:35   ` Konrad Dybcio
  1 sibling, 1 reply; 6+ messages in thread
From: Marijn Suijten @ 2022-12-16 23:15 UTC (permalink / raw)
  To: phone-devel, Andy Gross, Bjorn Andersson, Vinod Koul,
	Rob Herring, Krzysztof Kozlowski
  Cc: ~postmarketos/upstreaming, AngeloGioacchino Del Regno,
	Konrad Dybcio, Martin Botka, Jami Kettunen, Marijn Suijten,
	Lux Aliaga, Konrad Dybcio, Richard Acayan, linux-arm-msm,
	dmaengine, devicetree, linux-kernel

From: Martin Botka <martin.botka@somainline.org>

Add nodes for GPI DMA hosts on SM6125.

Signed-off-by: Martin Botka <martin.botka@somainline.org>
[Marijn: reorder properties, use sdm845 fallback compatible, disable by
 default, use 3 instead of 5 dma cells]
Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org>
---
 arch/arm64/boot/dts/qcom/sm6125.dtsi | 37 ++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sm6125.dtsi b/arch/arm64/boot/dts/qcom/sm6125.dtsi
index a205121ab4a7..abcd634c4f6d 100644
--- a/arch/arm64/boot/dts/qcom/sm6125.dtsi
+++ b/arch/arm64/boot/dts/qcom/sm6125.dtsi
@@ -5,6 +5,7 @@
 
 #include <dt-bindings/clock/qcom,gcc-sm6125.h>
 #include <dt-bindings/clock/qcom,rpmcc.h>
+#include <dt-bindings/dma/qcom-gpi.h>
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/interrupt-controller/arm-gic.h>
 #include <dt-bindings/power/qcom-rpmpd.h>
@@ -510,6 +511,42 @@ sdhc_2: mmc@4784000 {
 			status = "disabled";
 		};
 
+		gpi_dma0: dma-controller@4a00000 {
+			compatible = "qcom,sm6125-gpi-dma", "qcom,sdm845-gpi-dma";
+			reg = <0x04a00000 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>;
+			dma-channels = <8>;
+			dma-channel-mask = <0x1f>;
+			iommus = <&apps_smmu 0x0136 0x0>;
+			#dma-cells = <3>;
+			status = "disabled";
+		};
+
+		gpi_dma1: dma-controller@4c00000 {
+			compatible = "qcom,sm6125-gpi-dma", "qcom,sdm845-gpi-dma";
+			reg = <0x04c00000 0x60000>;
+			interrupts = <GIC_SPI 314 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 315 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 316 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 317 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 318 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 319 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 320 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 321 IRQ_TYPE_LEVEL_HIGH>;
+			dma-channels = <8>;
+			dma-channel-mask = <0x0f>;
+			iommus = <&apps_smmu 0x0156 0x0>;
+			#dma-cells = <3>;
+			status = "disabled";
+		};
+
 		usb3: usb@4ef8800 {
 			compatible = "qcom,sm6125-dwc3", "qcom,dwc3";
 			reg = <0x04ef8800 0x400>;
-- 
2.39.0


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

* Re: [PATCH v2 2/2] arm64: dts: qcom: sm6125: Add GPI DMA nodes
  2022-12-16 23:15 ` [PATCH v2 2/2] arm64: dts: qcom: sm6125: Add GPI DMA nodes Marijn Suijten
@ 2022-12-17 14:35   ` Konrad Dybcio
  2022-12-18 10:23     ` Marijn Suijten
  0 siblings, 1 reply; 6+ messages in thread
From: Konrad Dybcio @ 2022-12-17 14:35 UTC (permalink / raw)
  To: Marijn Suijten, phone-devel, Andy Gross, Bjorn Andersson,
	Vinod Koul, Rob Herring, Krzysztof Kozlowski
  Cc: ~postmarketos/upstreaming, AngeloGioacchino Del Regno,
	Konrad Dybcio, Martin Botka, Jami Kettunen, Lux Aliaga,
	Richard Acayan, linux-arm-msm, dmaengine, devicetree,
	linux-kernel



On 17.12.2022 00:15, Marijn Suijten wrote:
> From: Martin Botka <martin.botka@somainline.org>
> 
> Add nodes for GPI DMA hosts on SM6125.
> 
> Signed-off-by: Martin Botka <martin.botka@somainline.org>
> [Marijn: reorder properties, use sdm845 fallback compatible, disable by
>  default, use 3 instead of 5 dma cells]
> Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org>
> ---
>  arch/arm64/boot/dts/qcom/sm6125.dtsi | 37 ++++++++++++++++++++++++++++
>  1 file changed, 37 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/qcom/sm6125.dtsi b/arch/arm64/boot/dts/qcom/sm6125.dtsi
> index a205121ab4a7..abcd634c4f6d 100644
> --- a/arch/arm64/boot/dts/qcom/sm6125.dtsi
> +++ b/arch/arm64/boot/dts/qcom/sm6125.dtsi
> @@ -5,6 +5,7 @@
>  
>  #include <dt-bindings/clock/qcom,gcc-sm6125.h>
>  #include <dt-bindings/clock/qcom,rpmcc.h>
> +#include <dt-bindings/dma/qcom-gpi.h>
>  #include <dt-bindings/gpio/gpio.h>
>  #include <dt-bindings/interrupt-controller/arm-gic.h>
>  #include <dt-bindings/power/qcom-rpmpd.h>
> @@ -510,6 +511,42 @@ sdhc_2: mmc@4784000 {
>  			status = "disabled";
>  		};
>  
> +		gpi_dma0: dma-controller@4a00000 {
> +			compatible = "qcom,sm6125-gpi-dma", "qcom,sdm845-gpi-dma";
> +			reg = <0x04a00000 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>;
> +			dma-channels = <8>;
> +			dma-channel-mask = <0x1f>;
> +			iommus = <&apps_smmu 0x0136 0x0>;
The stream id does not need the leading zero.
You made the mask a decimal zero in the previous patchset, please
decide on one convention. Masks are generally more useful as hex,
but for zero values I suppose zero is less noise for the same thing..

The DMA nodes however, look good otherwise.

Konrad
> +			#dma-cells = <3>;
> +			status = "disabled";
> +		};
> +
> +		gpi_dma1: dma-controller@4c00000 {
> +			compatible = "qcom,sm6125-gpi-dma", "qcom,sdm845-gpi-dma";
> +			reg = <0x04c00000 0x60000>;
> +			interrupts = <GIC_SPI 314 IRQ_TYPE_LEVEL_HIGH>,
> +				     <GIC_SPI 315 IRQ_TYPE_LEVEL_HIGH>,
> +				     <GIC_SPI 316 IRQ_TYPE_LEVEL_HIGH>,
> +				     <GIC_SPI 317 IRQ_TYPE_LEVEL_HIGH>,
> +				     <GIC_SPI 318 IRQ_TYPE_LEVEL_HIGH>,
> +				     <GIC_SPI 319 IRQ_TYPE_LEVEL_HIGH>,
> +				     <GIC_SPI 320 IRQ_TYPE_LEVEL_HIGH>,
> +				     <GIC_SPI 321 IRQ_TYPE_LEVEL_HIGH>;
> +			dma-channels = <8>;
> +			dma-channel-mask = <0x0f>;
> +			iommus = <&apps_smmu 0x0156 0x0>;
> +			#dma-cells = <3>;
> +			status = "disabled";
> +		};
> +
>  		usb3: usb@4ef8800 {
>  			compatible = "qcom,sm6125-dwc3", "qcom,dwc3";
>  			reg = <0x04ef8800 0x400>;

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

* Re: [PATCH v2 2/2] arm64: dts: qcom: sm6125: Add GPI DMA nodes
  2022-12-17 14:35   ` Konrad Dybcio
@ 2022-12-18 10:23     ` Marijn Suijten
  0 siblings, 0 replies; 6+ messages in thread
From: Marijn Suijten @ 2022-12-18 10:23 UTC (permalink / raw)
  To: Konrad Dybcio
  Cc: phone-devel, Andy Gross, Bjorn Andersson, Vinod Koul,
	Rob Herring, Krzysztof Kozlowski, ~postmarketos/upstreaming,
	AngeloGioacchino Del Regno, Konrad Dybcio, Martin Botka,
	Jami Kettunen, Lux Aliaga, Richard Acayan, linux-arm-msm,
	dmaengine, devicetree, linux-kernel

On 2022-12-17 15:35:18, Konrad Dybcio wrote:
> 
> 
> On 17.12.2022 00:15, Marijn Suijten wrote:
> > From: Martin Botka <martin.botka@somainline.org>
> > 
> > Add nodes for GPI DMA hosts on SM6125.
> > 
> > Signed-off-by: Martin Botka <martin.botka@somainline.org>
> > [Marijn: reorder properties, use sdm845 fallback compatible, disable by
> >  default, use 3 instead of 5 dma cells]
> > Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org>
> > ---
> >  arch/arm64/boot/dts/qcom/sm6125.dtsi | 37 ++++++++++++++++++++++++++++
> >  1 file changed, 37 insertions(+)
> > 
> > diff --git a/arch/arm64/boot/dts/qcom/sm6125.dtsi b/arch/arm64/boot/dts/qcom/sm6125.dtsi
> > index a205121ab4a7..abcd634c4f6d 100644
> > --- a/arch/arm64/boot/dts/qcom/sm6125.dtsi
> > +++ b/arch/arm64/boot/dts/qcom/sm6125.dtsi
> > @@ -5,6 +5,7 @@
> >  
> >  #include <dt-bindings/clock/qcom,gcc-sm6125.h>
> >  #include <dt-bindings/clock/qcom,rpmcc.h>
> > +#include <dt-bindings/dma/qcom-gpi.h>
> >  #include <dt-bindings/gpio/gpio.h>
> >  #include <dt-bindings/interrupt-controller/arm-gic.h>
> >  #include <dt-bindings/power/qcom-rpmpd.h>
> > @@ -510,6 +511,42 @@ sdhc_2: mmc@4784000 {
> >  			status = "disabled";
> >  		};
> >  
> > +		gpi_dma0: dma-controller@4a00000 {
> > +			compatible = "qcom,sm6125-gpi-dma", "qcom,sdm845-gpi-dma";
> > +			reg = <0x04a00000 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>;
> > +			dma-channels = <8>;
> > +			dma-channel-mask = <0x1f>;
> > +			iommus = <&apps_smmu 0x0136 0x0>;
> The stream id does not need the leading zero.

Good catch!  Will clean this up for V2.

> You made the mask a decimal zero in the previous patchset, please
> decide on one convention. Masks are generally more useful as hex,
> but for zero values I suppose zero is less noise for the same thing..

The _vast majority_ of qcom dts uses 0x0, I'll fix that in the previous
patch series.  Looks like I did even clean that up when directly
transplanting that patch ("Add apps_smmu with streamID to SDHCI 1/2
nodes") to sm6350 even...

> The DMA nodes however, look good otherwise.

And they work great, too!

- Marijn

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

* Re: [PATCH v2 1/2] dt-bindings: dma: gpi: Document SM6125 compatible
  2022-12-16 23:15 ` [PATCH v2 1/2] dt-bindings: dma: gpi: Document SM6125 compatible Marijn Suijten
@ 2022-12-19  9:09   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 6+ messages in thread
From: Krzysztof Kozlowski @ 2022-12-19  9:09 UTC (permalink / raw)
  To: Marijn Suijten, phone-devel, Andy Gross, Bjorn Andersson,
	Vinod Koul, Rob Herring, Krzysztof Kozlowski
  Cc: ~postmarketos/upstreaming, AngeloGioacchino Del Regno,
	Konrad Dybcio, Martin Botka, Jami Kettunen, Lux Aliaga,
	Konrad Dybcio, Richard Acayan, linux-arm-msm, dmaengine,
	devicetree, linux-kernel

On 17/12/2022 00:15, Marijn Suijten wrote:
> From: Martin Botka <martin.botka@somainline.org>
> 
> Document compatibility for this GPI DMA controller on SM6125.
> 


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

Best regards,
Krzysztof


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

end of thread, other threads:[~2022-12-19  9:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-16 23:15 [PATCH v2 0/2] arm64: dts: qcom: sm6125: Enable GPI DMA Marijn Suijten
2022-12-16 23:15 ` [PATCH v2 1/2] dt-bindings: dma: gpi: Document SM6125 compatible Marijn Suijten
2022-12-19  9:09   ` Krzysztof Kozlowski
2022-12-16 23:15 ` [PATCH v2 2/2] arm64: dts: qcom: sm6125: Add GPI DMA nodes Marijn Suijten
2022-12-17 14:35   ` Konrad Dybcio
2022-12-18 10:23     ` Marijn Suijten

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