Devicetree
 help / color / mirror / Atom feed
From: Frank Li <Frank.li@oss.nxp.com>
To: Binbin Zhou <zhoubb.aaron@gmail.com>
Cc: Binbin Zhou <zhoubinbin@loongson.cn>,
	Huacai Chen <chenhuacai@loongson.cn>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>, Vinod Koul <vkoul@kernel.org>,
	Frank Li <Frank.Li@kernel.org>,
	dmaengine@vger.kernel.org, Huacai Chen <chenhuacai@kernel.org>,
	devicetree@vger.kernel.org,
	Keguang Zhang <keguang.zhang@gmail.com>
Subject: Re: [PATCH 2/3] dt-bindings: dma: loongson: Add Loongson-2K0300 DMA mux support
Date: Fri, 2 Oct 2026 09:47:41 -0500	[thread overview]
Message-ID: <ar_EDV7FMDBr7xCp@SMW015318> (raw)
In-Reply-To: <CAMpQs4KOvjvOku+DEMzr+OdfRNQAm9QoXnG3B93ZJs78ax5NQA@mail.gmail.com>

On Fri, Oct 02, 2026 at 10:00:11PM +0800, Binbin Zhou wrote:
> Hi Frank:
>
> Thanks for your reply.
>
> On Thu, Oct 1, 2026 at 5:44 AM Frank Li <Frank.li@oss.nxp.com> wrote:
> >
> > On Tue, Sep 22, 2026 at 05:25:43PM +0800, Binbin Zhou wrote:
> > > 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.yaml
> > >
> > > diff --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?
>
> Yes, according to the description of this register’s bit fields in the
> manual, DMA channels are not mapped arbitrarily.
>
> We can broadly categorize them as follows:
> 1. First, most peripherals that use this DMA controller request
> adjacent DMA channels (TX/RX) in pairs.
> Let’s take I2S as an example.
> Bits [17:16] at address `0x16000138` controls the I2S DMA channel mapping:
> 00: Channels 0, 1
> 01: Channels 2, 3
> 10: Channels 4, 5
> 11: Channels 6, 7
> 2. The SM/DES/AES module uses only channels 0 and 1, corresponding to
> the bit field values 00 and 01, respectively.
> 3. The can/adc module is single-channel, so each bit in the
> corresponding bit field corresponds to channels 0–7.

Does channel dynmatic allocated or have to static assign, if channel dynmatic
allocated, needn't arg2. If static assign, it'd better descript clean about
restriction between arg1 and arg2.

Frank

>
> >
> > Frank
> > > +      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
> > >
>
> --
> Thanks.
> Binbin

  reply	other threads:[~2026-10-02 14:47 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-22  9:25 [PATCH 0/3] Add Loongson-2K0300 APB DMA mux support Binbin Zhou
2026-09-22  9:25 ` [PATCH 1/3] dt-bindings: dma: loongson: Add Loongson-2 DMA mux request IDs Binbin Zhou
2026-09-22  9:34   ` sashiko-bot
2026-09-30 21:52   ` Frank Li
2026-09-22  9:25 ` [PATCH 2/3] dt-bindings: dma: loongson: Add Loongson-2K0300 DMA mux support Binbin Zhou
2026-09-30 21:44   ` Frank Li
2026-10-02 14:00     ` Binbin Zhou
2026-10-02 14:47       ` Frank Li [this message]
2026-10-04  6:27         ` Binbin Zhou
2026-09-22  9:25 ` [PATCH 3/3] dmaengine: loongson: Add Loongson-2K0300 APB DMA mux driver Binbin Zhou
2026-09-22  9:36   ` sashiko-bot
2026-09-23  4:17   ` Huacai Chen
2026-09-30 21:56   ` Frank Li
2026-09-22 16:45 ` [PATCH 0/3] Add Loongson-2K0300 APB DMA mux support Frank Li
2026-09-23  5:53   ` Binbin Zhou

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ar_EDV7FMDBr7xCp@SMW015318 \
    --to=frank.li@oss.nxp.com \
    --cc=Frank.Li@kernel.org \
    --cc=chenhuacai@kernel.org \
    --cc=chenhuacai@loongson.cn \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dmaengine@vger.kernel.org \
    --cc=keguang.zhang@gmail.com \
    --cc=krzk+dt@kernel.org \
    --cc=robh@kernel.org \
    --cc=vkoul@kernel.org \
    --cc=zhoubb.aaron@gmail.com \
    --cc=zhoubinbin@loongson.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox