Skip to contentSkip to conversation

riscv: sophgo: allow DMA multiplexer set channel number for DMA controller

PATCH Applied Inochi Amaoto 3 participants 8 messages May 11 – Jul 29

Subsystems (5)
lore
Share & tools
lore

Inochi Amaoto

author maintainer
#0 lore raw

v6 cover riscv: sophgo: allow DMA multiplexer set channel number for DMA controller

As the DMA controller on Sophgo CV1800 series SoC only has 8 channels, the SoC provides a dma multiplexer to reuse the DMA channel. However, the dma multiplexer also controlls the DMA interrupt multiplexer, which means that the dma multiplexer needs to know the channel number.

Change the DMA phandle args parsing logic so it can use handshake number as channel number if necessary.

This patch series add fallback compatiable according to the disscussion.

Change from v5:
- https://lore.kernel.org/all/[email protected]
1. Add dt-bindings patch for fallback compatiable
2. patch 2: Adapt the binding change.

Change from v4:
- https://lore.kernel.org/all/[email protected]/
1. drop patch 1 and patch 2 as they are merged
2. Add ABI break statement and clarification for this patch.

Change from v3:
- https://lore.kernel.org/all/[email protected]/
1. rebase to v7.0-rc1
2. patch 1: Apply Conor's tag
3. patch 2: Apply Frank's tag

Change from v2:
- https://lore.kernel.org/all/[email protected]/
1. patch 2: rename "AXI_DMA_FLAG_HANDSHAKE_AS_CHAN" to "ARG0_AS_CHAN"

Change from v1:
- https://lore.kernel.org/all/[email protected]/
1. rebase to v6.19-rc1
2. patch 1: remove a comment placed in wrong place.
3. patch 2: fix typo in comments.
4. patch 2: initialize chan as NULL in dw_axi_dma_of_xlate.

Inochi Amaoto (2):
dt-bindings: dma: snps,dw-axi-dmac: Add fallback compatible for

    CV1800B

riscv: dts: sophgo: cv180x: Allow the DMA multiplexer to set channel
number for DMA controller

 Documentation/devicetree/bindings/dma/snps,dw-axi-dmac.yaml | 5 +++--
 arch/riscv/boot/dts/sophgo/cv180x.dtsi                      | 2 +-
 2 files changed, 4 insertions(+), 3 deletions(-)

--
2.54.0

author maintainer
#1 lore raw

PATCH v6 1/2 dt-bindings: dma: snps,dw-axi-dmac: Add fallback compatible for CV1800B

The previous version of the binding change only add compatible string without adding the fallback compatible, this breaks backward compatibility. Add the needed fallback compatible to fix this.

Fixes be3e2a0419c6 ("dt-bindings: dma: snps,dw-axi-dmac: Add CV1800B compatible")
---
 Documentation/devicetree/bindings/dma/snps,dw-axi-dmac.yaml | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
Documentation/devicetree/bindings/dma/snps,dw-axi-dmac.yaml +3 -2
index 804514732dbe..0a30a455b0ee 100644
@@ -21,11 +21,12 @@ properties:
       - enum:
           - snps,axi-dma-1.01a
           - intel,kmb-axi-dma
-          - sophgo,cv1800b-axi-dma
           - starfive,jh7110-axi-dma
           - starfive,jh8100-axi-dma
       - items:
-          - const: altr,agilex5-axi-dma
+          - enum:
+              - altr,agilex5-axi-dma
+              - sophgo,cv1800b-axi-dma
           - const: snps,axi-dma-1.01a
 
   reg:
Signature · 1 line
2.54.0
#2 lore raw

Re: [PATCH v6 1/2] dt-bindings: dma: snps,dw-axi-dmac: Add fallback compatible for CV1800B

Quoted 4 lines · Inochi Amaoto

The previous version of the binding change only add compatible string without adding the fallback compatible, this breaks backward compatibility. Add the needed fallback compatible to fix this.

I don't understand how adding a specific comaptible affected backwards compatibility. Did the dts originally use the snps compatible before the device specific one was added?

Quoted 29 lines
Fixes be3e2a0419c6 ("dt-bindings: dma: snps,dw-axi-dmac: Add CV1800B compatible")
---
 Documentation/devicetree/bindings/dma/snps,dw-axi-dmac.yaml | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
Documentation/devicetree/bindings/dma/snps,dw-axi-dmac.yaml +3 -2
index 804514732dbe..0a30a455b0ee 100644
@@ -21,11 +21,12 @@ properties:
       - enum:
           - snps,axi-dma-1.01a
           - intel,kmb-axi-dma
-          - sophgo,cv1800b-axi-dma
           - starfive,jh7110-axi-dma
           - starfive,jh8100-axi-dma
       - items:
-          - const: altr,agilex5-axi-dma
+          - enum:
+              - altr,agilex5-axi-dma
+              - sophgo,cv1800b-axi-dma
           - const: snps,axi-dma-1.01a
 
   reg:
Signature · 1 line
2.54.0
author maintainer
#3 lore raw

Re: [PATCH v6 1/2] dt-bindings: dma: snps,dw-axi-dmac: Add fallback compatible for CV1800B

Quoted 10 lines · Conor Dooley
Quoted 4 lines · Inochi Amaoto

The previous version of the binding change only add compatible string without adding the fallback compatible, this breaks backward compatibility. Add the needed fallback compatible to fix this.

I don't understand how adding a specific comaptible affected backwards compatibility. Did the dts originally use the snps compatible before the device specific one was added?

Yes, the device is already in DTS, and since I find an quirk for it. A new compatible with fallback is necessary.

Regards,
Inochi

Quoted 29 lines
Quoted 29 lines
Fixes be3e2a0419c6 ("dt-bindings: dma: snps,dw-axi-dmac: Add CV1800B compatible")
---
 Documentation/devicetree/bindings/dma/snps,dw-axi-dmac.yaml | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
Documentation/devicetree/bindings/dma/snps,dw-axi-dmac.yaml +3 -2
index 804514732dbe..0a30a455b0ee 100644
@@ -21,11 +21,12 @@ properties:
       - enum:
           - snps,axi-dma-1.01a
           - intel,kmb-axi-dma
-          - sophgo,cv1800b-axi-dma
           - starfive,jh7110-axi-dma
           - starfive,jh8100-axi-dma
       - items:
-          - const: altr,agilex5-axi-dma
+          - enum:
+              - altr,agilex5-axi-dma
+              - sophgo,cv1800b-axi-dma
           - const: snps,axi-dma-1.01a
 
   reg:
Signature · 1 line
2.54.0
Acked-by
#4 lore raw

Re: [PATCH v6 1/2] dt-bindings: dma: snps,dw-axi-dmac: Add fallback compatible for CV1800B

Quoted 7 lines · Inochi Amaoto
Quoted 6 lines · Conor Dooley
Quoted 4 lines · Inochi Amaoto

The previous version of the binding change only add compatible string without adding the fallback compatible, this breaks backward compatibility. Add the needed fallback compatible to fix this.

Quoted 7 lines
Quoted 4 lines

I don't understand how adding a specific comaptible affected backwards compatibility. Did the dts originally use the snps compatible before the device specific one was added?

Yes, the device is already in DTS, and since I find an quirk for it. A new compatible with fallback is necessary.

pw-bot: not-applicable

author maintainer
#5 lore raw

PATCH v6 2/2 riscv: dts: sophgo: cv180x: Allow the DMA multiplexer to set channel number for DMA controller

In reply to Inochi Amaoto

Change the DMA controller compatible to the sophgo,cv1800b-axi-dma, which supports setting DMA channel number in DMA phandle args.

This dts change does not break backward compatibility as a fallback compatiable string is added.

Fixes 514951a81a5e ("riscv: dts: sophgo: cv18xx: add DMA controller")
---
 arch/riscv/boot/dts/sophgo/cv180x.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/riscv/boot/dts/sophgo/cv180x.dtsi +1 -1
index 06b0ce5a2db7..ecafdee79ac8 100644
@@ -417,7 +417,7 @@ sdhci1: mmc@4320000 {
 		};
 
 		dmac: dma-controller@4330000 {
-			compatible = "snps,axi-dma-1.01a";
+			compatible = "sophgo,cv1800b-axi-dma", "snps,axi-dma-1.01a";
 			reg = <0x04330000 0x1000>;
 			interrupts = <SOC_PERIPHERAL_IRQ(13) IRQ_TYPE_LEVEL_HIGH>;
 			clocks = <&clk CLK_SDMA_AXI>, <&clk CLK_SDMA_AXI>;
Signature · 1 line
2.54.0
maintainer Applied
#6 lore raw

Re: (subset) [PATCH v6 0/2] riscv: sophgo: allow DMA multiplexer set channel number for DMA controller

In reply to Inochi Amaoto
Quoted 9 lines · Inochi Amaoto

As the DMA controller on Sophgo CV1800 series SoC only has 8 channels, the SoC provides a dma multiplexer to reuse the DMA channel. However, the dma multiplexer also controlls the DMA interrupt multiplexer, which means that the dma multiplexer needs to know the channel number.

Change the DMA phandle args parsing logic so it can use handshake number as channel number if necessary.

[...]

Applied, thanks!

[1/2] dt-bindings: dma: snps,dw-axi-dmac: Add fallback compatible for CV1800B

      commit: 7524fe142b5a772f8421aeee2132cf7e21a00103

Best regards,

Signature · 1 line
~Vinod
author maintainer Applied
#7 lore raw

Re: (subset) [PATCH v6 0/2] riscv: sophgo: allow DMA multiplexer set channel number for DMA controller

In reply to Inochi Amaoto
Quoted 9 lines · Inochi Amaoto

As the DMA controller on Sophgo CV1800 series SoC only has 8 channels, the SoC provides a dma multiplexer to reuse the DMA channel. However, the dma multiplexer also controlls the DMA interrupt multiplexer, which means that the dma multiplexer needs to know the channel number.

Change the DMA phandle args parsing logic so it can use handshake number as channel number if necessary.

[...]

Applied to dt/riscv, thanks!

[2/2] riscv: dts: sophgo: cv180x: Allow the DMA multiplexer to set channel number for DMA controller

      https://github.com/sophgo/linux/commit/3c698b64db0145fb5edc3f19e4170b41b4508281

Thanks,
Inochi