1 From a2e6d1c03908eccf76b9305c4a493230a36035c0 Mon Sep 17 00:00:00 2001
2 From: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
3 Date: Fri, 10 Jan 2020 18:29:35 +0100
4 Subject: [PATCH] ARM: dts: bcm283x: Unify CMA configuration
6 commit c5a1e5375d19bd4001c59dc5d482ac5b1ba51cbf upstream.
8 With the introduction of the Raspberry Pi 4 we were forced to explicitly
9 configure CMA's location, since arm64 defaults it into the ZONE_DMA32
10 memory area, which is not good enough to perform DMA operations on that
11 device. To bypass this limitation a dedicated CMA DT node was created,
12 explicitly indicating the acceptable memory range and size.
14 That said, compatibility between boards is a must on the Raspberry Pi
15 ecosystem so this creates a common CMA DT node so as for DT overlays to
16 be able to update CMA's properties regardless of the board being used.
18 Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
19 Reviewed-by: Phil Elwell <phil@raspberrypi.org>
20 Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
22 arch/arm/boot/dts/bcm2711.dtsi | 32 +++++++++++++-------------------
23 arch/arm/boot/dts/bcm283x.dtsi | 13 +++++++++++++
24 2 files changed, 26 insertions(+), 19 deletions(-)
26 --- a/arch/arm/boot/dts/bcm2711.dtsi
27 +++ b/arch/arm/boot/dts/bcm2711.dtsi
30 interrupt-parent = <&gicv2>;
33 - #address-cells = <2>;
38 - * arm64 reserves the CMA by default somewhere in ZONE_DMA32,
39 - * that's not good enough for the BCM2711 as some devices can
40 - * only address the lower 1G of memory (ZONE_DMA).
43 - compatible = "shared-dma-pool";
44 - size = <0x2000000>; /* 32MB */
45 - alloc-ranges = <0x0 0x00000000 0x40000000>;
52 compatible = "brcm,bcm2711-vc5";
59 + #address-cells = <2>;
64 + * arm64 reserves the CMA by default somewhere in ZONE_DMA32,
65 + * that's not good enough for the BCM2711 as some devices can
66 + * only address the lower 1G of memory (ZONE_DMA).
68 + alloc-ranges = <0x0 0x00000000 0x40000000>;
72 compatible = "brcm,bcm2711-i2c", "brcm,bcm2835-i2c";
73 interrupts = <GIC_SPI 117 IRQ_TYPE_LEVEL_HIGH>;
74 --- a/arch/arm/boot/dts/bcm283x.dtsi
75 +++ b/arch/arm/boot/dts/bcm283x.dtsi
77 stdout-path = "serial0:115200n8";
80 + rmem: reserved-memory {
81 + #address-cells = <1>;
86 + compatible = "shared-dma-pool";
87 + size = <0x4000000>; /* 64MB */
94 cpu_thermal: cpu-thermal {
95 polling-delay-passive = <0>;