From: Binbin Zhou <zhoubinbin@loongson.cn>
To: Binbin Zhou <zhoubb.aaron@gmail.com>,
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
Cc: Huacai Chen <chenhuacai@kernel.org>,
Xuerui Wang <kernel@xen0n.name>,
loongarch@lists.linux.dev, devicetree@vger.kernel.org,
Keguang Zhang <keguang.zhang@gmail.com>,
Binbin Zhou <zhoubinbin@loongson.cn>
Subject: [PATCH v2 0/3] Add Loongson-2K0300 APB DMA mux support
Date: Fri, 9 Oct 2026 17:19:31 +0800 [thread overview]
Message-ID: <cover.1791535540.git.zhoubinbin@loongson.cn> (raw)
Hi all:
Loongson-2K0300 integrates a CMC DMA controller with 8 physical
channels. Peripheral DMA requests are not hard-wired to these channels;
they are routed through the CHIP_CTRL13/14/15 DMA_MAP fields.
This series adds support for that DMA request router.
Patch 1 adds the DT binding constants for the peripheral request IDs.
Patch 2 adds the DT binding documentation for the DMA mux.
Patch 3 adds the driver, Kconfig symbol and Makefile entry.
The driver registers with of_dma_router_register(). In the route
allocation callback it validates the <request> <channel> <flags>
specifier, programs the SoC-specific route register, and forwards
<channel> <flags> to the parent CMC DMA controller.
Thanks.
Binbin.
=========
V2:
Patch(1/3):
- Drop LS2K0300_DMA_REQ_MAX as it is not part of the ABI;
Patch(2/3):
- More detailed description of `dma-cells`;
- Add the `dma_requests` constraint
Patch(3/3):
- Drop loongson2_dmamux_map->shift;
- Move of_parse_phandle() into loongson2_dmamux_route_allocate() avoid
UAF;
- Drop loongson2_dmamux->dma_np;
- Check dma_requests;
- Add devm_add_action_or_reset() instead of .remove();
- Replace `metux()` with `spinlock()`, which has lower overhead;
- Add loongson2_dmamux_route_free().
Link to V1:
https://lore.kernel.org/all/cover.1790068409.git.zhoubinbin@loongson.cn/
Binbin Zhou (3):
dt-bindings: dma: loongson: Add Loongson-2 DMA mux request IDs
dt-bindings: dma: loongson: Add Loongson-2K0300 DMA mux support
dmaengine: loongson: Add Loongson-2K0300 APB DMA mux driver
.../dma/loongson,ls2k0300-dmamux.yaml | 72 ++++
MAINTAINERS | 3 +
drivers/dma/loongson/Makefile | 1 +
drivers/dma/loongson/loongson2-apb-dmamux.c | 398 ++++++++++++++++++
.../dt-bindings/dma/loongson,ls2k-dmamux.h | 53 +++
5 files changed, 527 insertions(+)
create mode 100644 Documentation/devicetree/bindings/dma/loongson,ls2k0300-dmamux.yaml
create mode 100644 drivers/dma/loongson/loongson2-apb-dmamux.c
create mode 100644 include/dt-bindings/dma/loongson,ls2k-dmamux.h
base-commit: 1d8ae2003de08f61095e4e928b1b8cce6c23cabd
--
2.52.0
next reply other threads:[~2026-10-09 9:19 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-09 9:19 Binbin Zhou [this message]
2026-10-09 9:19 ` [PATCH v2 1/3] dt-bindings: dma: loongson: Add Loongson-2 DMA mux request IDs Binbin Zhou
2026-10-09 14:38 ` Conor Dooley
2026-10-09 9:19 ` [PATCH v2 2/3] dt-bindings: dma: loongson: Add Loongson-2K0300 DMA mux support Binbin Zhou
2026-10-09 14:43 ` Conor Dooley
2026-10-09 9:19 ` [PATCH v2 3/3] dmaengine: loongson: Add Loongson-2K0300 APB DMA mux driver 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=cover.1791535540.git.zhoubinbin@loongson.cn \
--to=zhoubinbin@loongson.cn \
--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=kernel@xen0n.name \
--cc=krzk+dt@kernel.org \
--cc=loongarch@lists.linux.dev \
--cc=robh@kernel.org \
--cc=vkoul@kernel.org \
--cc=zhoubb.aaron@gmail.com \
/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