Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp956611ybl; Fri, 10 Jan 2020 09:30:55 -0800 (PST) X-Google-Smtp-Source: APXvYqzWBcDZdDXBUgammZgqpvgk7ZAXgzCvfvoJiDdLtaASjMdtwJELAVkObwNhzq75xOJiiob/ X-Received: by 2002:aca:fdd1:: with SMTP id b200mr2917347oii.133.1578677455609; Fri, 10 Jan 2020 09:30:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578677455; cv=none; d=google.com; s=arc-20160816; b=xqTF8BGQO945Dc2H47d7An8vM+Z6x9nQO3fbLDMwf/oWwLPB+bm6+GV7KRK7swb2gI hV7vvOT1atx9GykltDCTKE2QJS2T0c+8ia938I5JHz/s/HCbERikZmLf0mRzfeYtdYZ8 upGYQ7Ne2voRgZ0lhpv64FlLreT6RJ24m28DD72an4xvkQCxsbdG/g2mUPR9//at4kEq 6IOPuD19SfnCgGNAFLJDLvGD4TunK3FnD1EVNvHR7gQecFGcQzunlua86l5SIg5KeaZw HPMgo7YtvnGng+LaJVJKxBdYfje9Qef/2CqqbojpLCMCo2xshgroi1e2dPiTGdYJ0oJc qCDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=+4jFmoXNVD403VVbNVnawRjBIvItmdnC2gzgjCT/Aks=; b=fb+cxTHHK0BhCqU4n/rMb+v9OQbnl1oCp+2AaRBWD4ucyR+S+uHHMhLOkGwnXuTkFr Tbsdor6eG4o2XRfgjkSIW8QYhKWlRfpqZK+GmatmvjMOBDmXNMHida4JFUoIJqDmcrsk jLbDXIQ8S+TsTOjQaXMXzQkHKL0A3uqKbpgfR27EGCIVqlKQhJlSb5M0bAz3CKRBPqS+ Uf9eEQKj972nUjHp+u7Td0s3EUqd3ju2ZftXBiW1I7MXhCs6eYgbbFF4ZpaJLFTgMvdT NcKdVBvt+VWYKp1X7XEN82YxPmEmGv3P6NaAPUOEaGs4wHTmOqPuYDGgeHOoazsAuw/G EGKw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h24si1293608oie.151.2020.01.10.09.30.44; Fri, 10 Jan 2020 09:30:55 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727834AbgAJR3t (ORCPT + 99 others); Fri, 10 Jan 2020 12:29:49 -0500 Received: from mx2.suse.de ([195.135.220.15]:57040 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726636AbgAJR3s (ORCPT ); Fri, 10 Jan 2020 12:29:48 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id DEAABB25C; Fri, 10 Jan 2020 17:29:46 +0000 (UTC) From: Nicolas Saenz Julienne To: Rob Herring , Mark Rutland , Nicolas Saenz Julienne , Florian Fainelli , Ray Jui , Scott Branden , bcm-kernel-feedback-list@broadcom.com, Stefan Wahren Cc: phil@raspberrypi.org, devicetree@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] ARM: dts: bcm283x: Unify CMA configuration Date: Fri, 10 Jan 2020 18:29:35 +0100 Message-Id: <20200110172935.19709-1-nsaenzjulienne@suse.de> X-Mailer: git-send-email 2.24.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- If this doesn't make it into v5.5 I'd be tempted to add: Fixes: d98a8dbdaec6 ("ARM: dts: bcm2711: force CMA into first GB of memory") arch/arm/boot/dts/bcm2711.dtsi | 33 +++++++++++++-------------------- arch/arm/boot/dts/bcm283x.dtsi | 13 +++++++++++++ 2 files changed, 26 insertions(+), 20 deletions(-) diff --git a/arch/arm/boot/dts/bcm2711.dtsi b/arch/arm/boot/dts/bcm2711.dtsi index 8687534d4528..c8e4041308e0 100644 --- a/arch/arm/boot/dts/bcm2711.dtsi +++ b/arch/arm/boot/dts/bcm2711.dtsi @@ -12,26 +12,6 @@ / { 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: @@ -869,6 +849,19 @@ pin-rts { }; }; +&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 = ; diff --git a/arch/arm/boot/dts/bcm283x.dtsi b/arch/arm/boot/dts/bcm283x.dtsi index 839491628e87..6128baed83c2 100644 --- a/arch/arm/boot/dts/bcm283x.dtsi +++ b/arch/arm/boot/dts/bcm283x.dtsi @@ -30,6 +30,19 @@ chosen { 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>; -- 2.24.1