riscv: sophgo: add dmamux support for Sophgo CV1800/SG2000 SoCs
Subsystems (4)
Inochi Amaoto
maintainerv14 cover riscv: sophgo: add dmamux support for Sophgo CV1800/SG2000 SoCs
As the syscon device of CV1800 have a usb phy subdevices. The binding of the syscon can not be complete without the usb phy is finished. As a result, the binding of syscon is removed and will be evolved in its original series after the usb phy binding is fully explored.
Changed from v13:
1. rebase to v6.16-rc1
Changed from v12:
1. remove syscon header and use local offset instead.
2. add COMPILE_TEST for coverage.
Changed from v11:
1. init all the field of the driver data.
Changed from v10:
1. binding: fixed binding id.
Changed from v9:
1. binding: rename to cv1800b-dmamux.
2. binding: remove the unused formatting.
Changed from v8:
1. change compatible name from cv1800-dmamux to cv1800b-dmamux
2. use guard to simpify spinlock process.
Changed from v7:
1. remove unused variable
Changed from v6:
1. fix copyright time.
2. driver only output mapping info in when debugging.
3. remove dma-master check in the driver init since the binding always require it.
Changed from v5:
1. remove dead binding header.
2. make "reg" required so the syscon binding can have the same example node of the dmamux binding.
Changed from v4:
1. remove the syscon binding since it can not be complete (still lack some subdevices)
2. add reg description for the binding,
3. remove the fixed channel assign for dmamux binding
3. driver adopt to the binding change. Now the driver allocates all the channel when initing and maps the request chan to the channel dynamicly.
Changed from v3:
1. fix dt-binding address issue.
Changed from v2:
1. add reg property of dmamux node in the binding of patch 2
Changed from v1:
1. fix wrong title of patch 2.
Inochi Amaoto (2):
dt-bindings: dmaengine: Add dma multiplexer for CV18XX/SG200X series
SoC
dmaengine: add driver for Sophgo CV18XX/SG200X dmamux
.../bindings/dma/sophgo,cv1800b-dmamux.yaml | 51 ++++ drivers/dma/Kconfig | 9 + drivers/dma/Makefile | 1 + drivers/dma/cv1800b-dmamux.c | 259 ++++++++++++++++++ 4 files changed, 320 insertions(+) create mode 100644 Documentation/devicetree/bindings/dma/sophgo,cv1800b-dmamux.yaml create mode 100644 drivers/dma/cv1800b-dmamux.c
--
2.49.0
Inochi Amaoto
maintainerPATCH v14 1/2 dt-bindings: dmaengine: Add dma multiplexer for CV18XX/SG200X series SoC
The DMA IP of Sophgo CV18XX/SG200X is based on a DW AXI CORE, with an additional channel remap register located in the top system control area. The DMA channel is exclusive to each core.
In addition, the DMA multiplexer is a subdevice of system controller, so this binding only contains necessary properties for the multiplexer itself.
Add the dmamux binding for CV18XX/SG200X series SoC.
--- .../bindings/dma/sophgo,cv1800b-dmamux.yaml | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 Documentation/devicetree/bindings/dma/sophgo,cv1800b-dmamux.yaml
Documentation/devicetree/bindings/dma/sophgo,cv1800b-dmamux.yaml new file +51 -0
@@ -0,0 +1,51 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/dma/sophgo,cv1800b-dmamux.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Sophgo CV1800/SG200 Series DMA multiplexer + +maintainers: + - Inochi Amaoto <[email protected]> + +description: + The DMA multiplexer of CV1800 is a subdevice of the system + controller. It support mapping 8 channels, but each channel + can be mapped only once. + +allOf: + - $ref: dma-router.yaml# + +properties: + compatible: + const: sophgo,cv1800b-dmamux + + reg: + items: + - description: DMA channal remapping register + - description: DMA channel interrupt mapping register + + '#dma-cells': + const: 2 + description: + The first cells is device id. The second one is the cpu id. + + dma-masters: + maxItems: 1 + +required: + - reg + - '#dma-cells' + - dma-masters + +additionalProperties: false + +examples: + - | + dma-router@154 { + compatible = "sophgo,cv1800b-dmamux"; + reg = <0x154 0x8>, <0x298 0x4>; + #dma-cells = <2>; + dma-masters = <&dmac>; + };
Signature · 1 line
2.49.0
Inochi Amaoto
maintainerPATCH v14 2/2 dmaengine: add driver for Sophgo CV18XX/SG200X dmamux
In reply to Inochi AmaotoSophgo CV18XX/SG200X use DW AXI CORE with a multiplexer for remapping its request lines. The multiplexer supports at most 8 request lines.
Add driver for Sophgo CV18XX/SG200X DMA multiplexer.
--- drivers/dma/Kconfig | 9 ++ drivers/dma/Makefile | 1 + drivers/dma/cv1800b-dmamux.c | 259 +++++++++++++++++++++++++++++++++++ 3 files changed, 269 insertions(+) create mode 100644 drivers/dma/cv1800b-dmamux.c
drivers/dma/Kconfig +9 -0
@@ -572,6 +572,15 @@ config PLX_DMA These are exposed via extra functions on the switch's upstream port. Each function exposes one DMA channel. +config SOPHGO_CV1800B_DMAMUX + tristate "Sophgo CV1800/SG2000 series SoC DMA multiplexer support" + depends on MFD_SYSCON + depends on ARCH_SOPHGO || COMPILE_TEST + help + Support for the DMA multiplexer on Sophgo CV1800/SG2000 + series SoCs. + Say Y here if your board have this soc. + config STE_DMA40 bool "ST-Ericsson DMA40 support" depends on ARCH_U8500
drivers/dma/Makefile +1 -0
@@ -71,6 +71,7 @@ obj-$(CONFIG_PPC_BESTCOMM) += bestcomm/ obj-$(CONFIG_PXA_DMA) += pxa_dma.o obj-$(CONFIG_RENESAS_DMA) += sh/ obj-$(CONFIG_SF_PDMA) += sf-pdma/ +obj-$(CONFIG_SOPHGO_CV1800B_DMAMUX) += cv1800b-dmamux.o obj-$(CONFIG_STE_DMA40) += ste_dma40.o ste_dma40_ll.o obj-$(CONFIG_SPRD_DMA) += sprd-dma.o obj-$(CONFIG_TXX9_DMAC) += txx9dmac.o
drivers/dma/cv1800b-dmamux.c new file +259 -0
259 lines not on this page · raw message
Signature · 1 line
2.49.0
Re: [PATCH v14 2/2] dmaengine: add driver for Sophgo CV18XX/SG200X dmamux
Thanks for the patch, Inochi!
Quoted 6 lines · Inochi Amaoto
Sophgo CV18XX/SG200X use DW AXI CORE with a multiplexer for remapping its request lines. The multiplexer supports at most 8 request lines.
Add driver for Sophgo CV18XX/SG200X DMA multiplexer.
Signed-off-by Inochi Amaoto <[email protected]>
Successfully tested with USB series in host mode on Milk-V Duo Module 01 EVB:
Quoted 6 lines
---
drivers/dma/Kconfig | 9 ++
drivers/dma/Makefile | 1 +drivers/dma/cv1800b-dmamux.c| 259 +++++++++++++++++++++++++++++++++++3 files changed, 269 insertions(+)create mode 100644
drivers/dma/cv1800b-dmamux.c
Signature · 1 line
Alexander Sverdlin.
Quoted 10 lines · Inochi Amaoto
As the syscon device of CV1800 have a usb phy subdevices. The binding of the syscon can not be complete without the usb phy is finished. As a result, the binding of syscon is removed and will be evolved in its original series after the usb phy binding is fully explored.
Changed from v13:
1. rebase to v6.16-rc1[...]
Applied, thanks!
[1/2] dt-bindings: dmaengine: Add dma multiplexer for CV18XX/SG200X series SoC
commit: 994b5709f9f83c48f607e9a52912c912b8149421
[2/2] dmaengine: add driver for Sophgo CV18XX/SG200X dmamux
commit: db7d07b5add4d839df74adab9940cf9da488313fBest regards,
Signature · 1 line
~Vinod