ARM: dts: bcm283x: Unify CMA configuration
authorNicolas Saenz Julienne <nsaenzjulienne@suse.de>
Fri, 10 Jan 2020 17:29:35 +0000 (18:29 +0100)
committerFlorian Fainelli <f.fainelli@gmail.com>
Wed, 15 Jan 2020 23:41:00 +0000 (15:41 -0800)
With the introduction of the Raspberry Pi 4 we were forced to explicitly
configure CMA's location, since arm64 defaults it into the ZONE_DMA32
memory area, which is not good enough to perform DMA operations on that
device. To bypass this limitation a dedicated CMA DT node was created,
explicitly indicating the acceptable memory range and size.

That said, compatibility between boards is a must on the Raspberry Pi
ecosystem so this creates a common CMA DT node so as for DT overlays to
be able to update CMA's properties regardless of the board being used.

Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Reviewed-by: Phil Elwell <phil@raspberrypi.org>
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
arch/arm/boot/dts/bcm2711.dtsi
arch/arm/boot/dts/bcm283x.dtsi

index ccf917d..5ff4ddc 100644 (file)
 
        interrupt-parent = <&gicv2>;
 
-       reserved-memory {
-               #address-cells = <2>;
-               #size-cells = <1>;
-               ranges;
-
-               /*
-                * arm64 reserves the CMA by default somewhere in ZONE_DMA32,
-                * that's not good enough for the BCM2711 as some devices can
-                * only address the lower 1G of memory (ZONE_DMA).
-                */
-               linux,cma {
-                       compatible = "shared-dma-pool";
-                       size = <0x2000000>; /* 32MB */
-                       alloc-ranges = <0x0 0x00000000 0x40000000>;
-                       reusable;
-                       linux,cma-default;
-               };
-       };
-
-
        soc {
                /*
                 * Defined ranges:
        };
 };
 
+&rmem {
+       #address-cells = <2>;
+};
+
+&cma {
+       /*
+        * arm64 reserves the CMA by default somewhere in ZONE_DMA32,
+        * that's not good enough for the BCM2711 as some devices can
+        * only address the lower 1G of memory (ZONE_DMA).
+        */
+       alloc-ranges = <0x0 0x00000000 0x40000000>;
+};
+
 &i2c0 {
        compatible = "brcm,bcm2711-i2c", "brcm,bcm2835-i2c";
        interrupts = <GIC_SPI 117 IRQ_TYPE_LEVEL_HIGH>;
index 5219339..9fb0418 100644 (file)
                stdout-path = "serial0:115200n8";
        };
 
+       rmem: reserved-memory {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               ranges;
+
+               cma: linux,cma {
+                       compatible = "shared-dma-pool";
+                       size = <0x4000000>; /* 64MB */
+                       reusable;
+                       linux,cma-default;
+               };
+       };
+
        thermal-zones {
                cpu_thermal: cpu-thermal {
                        polling-delay-passive = <0>;