[PATCH v4 19/28] ARM: dts: broadcom: Describe the peripheral window in dma-ranges

From: Andrea della Porta

Date: Fri Nov 27 2026 - 07:20:28 EST


The DMA controllers of the BCM283x family see the peripherals at their
VideoCore bus addresses, i.e. at the child addresses of the soc bus.
This translation is not described by the dma-ranges property, which only
covers the RAM, so that the DMA engine driver cannot translate the CPU
physical addresses of the peripheral FIFOs and had to rely on its
clients providing bus addresses instead.

Add the peripheral window to dma-ranges, mirroring the ranges property
(minus the ARM local peripherals, which are not reachable by the DMA
controllers), so that dma_map_resource() can do the translation.

This does not change the bus DMA limit of the devices on these buses,
which is still given by the RAM window except on BCM2835, where it is
raised from 0x5fffffff to 0x7fffffff without affecting the DMA mask
derived from it. On BCM2836/BCM2837 the highest CPU address covered by
dma-ranges grows from 0x3effffff to 0x3fffffff, which does not affect the
size of ZONE_DMA as there is no RAM above 0x3f000000.

BCM2711 is deliberately left alone: its peripherals sit at 0xfc000000 and
above, so describing them in the dma-ranges of the soc bus would raise
the highest CPU address reachable through it from 1 GiB to almost 4 GiB.
On arm64, of_dma_get_max_cpu_address() would then no longer be limited
by the soc bus, growing ZONE_DMA and the SWIOTLB buffer beyond the RAM
the legacy DMA masters can reach. The legacy DMA controller of BCM2711
keeps using the ranges fallback of the DMA engine driver, which yields
the same addresses.

Signed-off-by: Andrea della Porta <andrea.porta@xxxxxxxx>
---
arch/arm/boot/dts/broadcom/bcm2835.dtsi | 3 ++-
arch/arm/boot/dts/broadcom/bcm2836.dtsi | 3 ++-
arch/arm/boot/dts/broadcom/bcm2837.dtsi | 3 ++-
3 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/arch/arm/boot/dts/broadcom/bcm2835.dtsi b/arch/arm/boot/dts/broadcom/bcm2835.dtsi
index 15cb331febbb..3a9719e2fadc 100644
--- a/arch/arm/boot/dts/broadcom/bcm2835.dtsi
+++ b/arch/arm/boot/dts/broadcom/bcm2835.dtsi
@@ -35,7 +35,8 @@ cpu@0 {

soc {
ranges = <0x7e000000 0x20000000 0x02000000>;
- dma-ranges = <0x40000000 0x00000000 0x20000000>;
+ dma-ranges = <0x40000000 0x00000000 0x20000000>,
+ <0x7e000000 0x20000000 0x02000000>;
};

arm-pmu {
diff --git a/arch/arm/boot/dts/broadcom/bcm2836.dtsi b/arch/arm/boot/dts/broadcom/bcm2836.dtsi
index 783fe624ba68..4ab7769c056a 100644
--- a/arch/arm/boot/dts/broadcom/bcm2836.dtsi
+++ b/arch/arm/boot/dts/broadcom/bcm2836.dtsi
@@ -8,7 +8,8 @@ / {
soc {
ranges = <0x7e000000 0x3f000000 0x1000000>,
<0x40000000 0x40000000 0x00001000>;
- dma-ranges = <0xc0000000 0x00000000 0x3f000000>;
+ dma-ranges = <0xc0000000 0x00000000 0x3f000000>,
+ <0x7e000000 0x3f000000 0x01000000>;

local_intc: interrupt-controller@40000000 {
compatible = "brcm,bcm2836-l1-intc";
diff --git a/arch/arm/boot/dts/broadcom/bcm2837.dtsi b/arch/arm/boot/dts/broadcom/bcm2837.dtsi
index c281697142b1..ba44cfb07668 100644
--- a/arch/arm/boot/dts/broadcom/bcm2837.dtsi
+++ b/arch/arm/boot/dts/broadcom/bcm2837.dtsi
@@ -7,7 +7,8 @@ / {
soc {
ranges = <0x7e000000 0x3f000000 0x1000000>,
<0x40000000 0x40000000 0x00001000>;
- dma-ranges = <0xc0000000 0x00000000 0x3f000000>;
+ dma-ranges = <0xc0000000 0x00000000 0x3f000000>,
+ <0x7e000000 0x3f000000 0x01000000>;

local_intc: interrupt-controller@40000000 {
compatible = "brcm,bcm2836-l1-intc";
--
2.51.0