Re: [PATCH 2/3] dt-bindings: dma: loongson: Add Loongson-2K0300 DMA mux support
From: Frank Li <hidden>
Date: 2026-09-30 21:44:39
Also in:
dmaengine
On Tue, Sep 22, 2026 at 05:25:43PM +0800, Binbin Zhou wrote:
quoted hunk ↗ jump to hunk
The DMA mux on Loongson-2K0300 is not a standalone hardware block. It is implemented as part of the chip configuration registers CHIP_CTRL13/14/15, which route peripheral DMA requests to the physical channels of the CMC DMA controller. Document this as a DMA router. The #dma-cells = <3> specifier contains the peripheral request ID, the target CMC DMA channel, and channel configuration flags forwarded to the parent DMA controller. Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn> --- .../dma/loongson,ls2k0300-dmamux.yaml | 49 +++++++++++++++++++ MAINTAINERS | 1 + 2 files changed, 50 insertions(+) create mode 100644 Documentation/devicetree/bindings/dma/loongson,ls2k0300-dmamux.yamldiff --git a/Documentation/devicetree/bindings/dma/loongson,ls2k0300-dmamux.yaml b/Documentation/devicetree/bindings/dma/loongson,ls2k0300-dmamux.yaml new file mode 100644 index 000000000000..12b8f8af51e9 --- /dev/null +++ b/Documentation/devicetree/bindings/dma/loongson,ls2k0300-dmamux.yaml@@ -0,0 +1,49 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/dma/loongson,ls2k0300-dmamux.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Loongson-2 APB DMA MUX (DMA request router) + +maintainers: + - Binbin Zhou <zhoubinbin@loongson.cn> + +allOf: + - $ref: /schemas/dma/dma-router.yaml# + +properties: + compatible: + const: loongson,ls2k0300-dmamux + + reg: + maxItems: 1 + + '#dma-cells': + const: 3 + description: | + Each cell represents the following: + 1. The peripheral request id (see + include/dt-bindings/dma/loongson,ls2k-dmamux.h) + 2. The physical CMC DMA channel (0-7) that is passed to the real + DMA controller
Do you have restriction between request id and channel? Does any request id route to any channel? Frank
quoted hunk ↗ jump to hunk
+ 3. Bitfield representing DMA channel configuration that is passed + to the real DMA controller + +required: + - compatible + - reg + +unevaluatedProperties: false + +examples: + - | + #include <dt-bindings/dma/loongson,ls2k-dmamux.h> + dma-router@16000134 { + compatible = "loongson,ls2k0300-dmamux"; + reg = <0x16000134 0xc>; + #dma-cells = <3>; + dma-masters = <&dma>; + dma-requests = <22>; + }; +...diff --git a/MAINTAINERS b/MAINTAINERS index b021fb623446..dc976938c58c 100644 --- a/MAINTAINERS +++ b/MAINTAINERS@@ -15344,6 +15344,7 @@ M: Binbin Zhou <zhoubinbin@loongson.cn> L: dmaengine@vger.kernel.org S: Maintained F: Documentation/devicetree/bindings/dma/loongson,ls2k0300-dma.yaml +F: Documentation/devicetree/bindings/dma/loongson,ls2k0300-dmamux.yaml F: Documentation/devicetree/bindings/dma/loongson,ls2x-apbdma.yaml F: drivers/dma/loongson/loongson2-apb-cmc-dma.c F: drivers/dma/loongson/loongson2-apb-dma.c --2.52.0