[PATCH v3 25/28] dmaengine: bcm2835: Add BCM2712 40-bit DMA support
From: Andrea della Porta
Date: Mon Nov 23 2026 - 09:55:20 EST
BCM2712 has six DMA channels (6 to 11) with the same programming model
as the BCM2711 40-bit channels.
These channels see both the RAM and the peripherals at their CPU
physical address. The bus they sit on maps them 1:1, so device trees
without dma-ranges are handled by the same fallback as the legacy
channels, i.e. by reverting the ranges of the parent bus.
The remaining channels (0 to 5) use the legacy control block format,
extended with the upper address bits stored in the stride field, and are
not supported for now. The downstream device tree describes them with
the same compatible, in a separate node: such a node is rejected thanks
to the channel mask of the platform data.
Link: https://github.com/raspberrypi/linux/commit/99c26cc709c0e3658c3f8d78cfb856cc20bdd0e3
Signed-off-by: Andrea della Porta <andrea.porta@xxxxxxxx>
---
drivers/dma/bcm2835-dma.c | 30 ++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+)
diff --git a/drivers/dma/bcm2835-dma.c b/drivers/dma/bcm2835-dma.c
index a98ea67d3406..cf435dfb04dc 100644
--- a/drivers/dma/bcm2835-dma.c
+++ b/drivers/dma/bcm2835-dma.c
@@ -1545,8 +1545,38 @@ static const struct bcm2835_dma_cfg bcm2711_data = {
.chan_mask = GENMASK(14, 11),
};
+static const struct bcm2835_dma_cfg bcm2712_data = {
+ .cs_reg = BCM2711_DMA40_CS,
+ .cb_reg = BCM2711_DMA40_CB,
+
+ .int_mask = BCM2711_DMA40_INT,
+ .active_mask = BCM2711_DMA40_ACTIVE,
+
+ .dma_mask = DMA_BIT_MASK(40),
+
+ .cb_get_length = bcm2711_dma_cb_get_length,
+ .cb_get_addr = bcm2711_dma_cb_get_addr,
+ .cb_init = bcm2711_dma_cb_init,
+ .cb_set_src = bcm2711_dma_cb_set_src,
+ .cb_set_dst = bcm2711_dma_cb_set_dst,
+ .cb_set_next = bcm2711_dma_cb_set_next,
+ .cb_set_length = bcm2711_dma_cb_set_length,
+ .cb_append_extra = bcm2711_dma_cb_append_extra,
+
+ .to_cb_addr = bcm2711_dma_to_cb_addr,
+
+ .read_addr = bcm2711_dma_read_addr,
+ .cs_flags = bcm2711_dma_cs_flags,
+ .abort = bcm2711_dma_abort_chan,
+
+ /* the parent bus maps the peripherals 1:1 on BCM2712 */
+ .legacy_bus_addr = bcm2835_dma_legacy_bus_addr,
+ .chan_mask = GENMASK(11, 6),
+};
+
static const struct of_device_id bcm2835_dma_of_match[] = {
{ .compatible = "brcm,bcm2711-dma", .data = &bcm2711_data },
+ { .compatible = "brcm,bcm2712-dma", .data = &bcm2712_data },
{ .compatible = "brcm,bcm2835-dma", .data = &bcm2835_data },
{},
};
--
2.51.0