From patchwork Wed Apr 13 16:27:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 12812216 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 50FDBC433EF for ; Wed, 13 Apr 2022 16:29:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=0DzwyWaxA4yRHFZsVO3tdDZwhmz4K1JZa3+7eveTwgE=; b=u1D5D7bf4tSosA QyH2+mxJqDB0ZrLr94Sp2P2SjZ+/4TY4lDpVjY6VZKxEb8ou8SLAUNvu5FOzP6f6rXPsRDJgR+Jqv pQwFWURBAREZg9RAveeSW7WYeN3gEA0nVLWkYtbcWLwUeqqySvS5AB2RwOgYgpLpZie79PqrUzntu 8+CTzN+85FBDXvVQNYKj7vQDCbl6j6IBO7lCeaw+X7T5JtN1tHxxcgxbQ/S5l96BCKHwjoFZ4+EyB MFYds+VLYKZFVHHi9MyOsRnpzRrbW6dnlbiNW+Dvnbvkwml1NexnTCwOdz6yl9B9p5SCMLgWyhnrU 7BKVM8R0edPUVCZzk5Gw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nefrB-001kEm-JD; Wed, 13 Apr 2022 16:28:37 +0000 Received: from mout.kundenserver.de ([212.227.126.133]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nefr7-001kEF-Kc; Wed, 13 Apr 2022 16:28:35 +0000 Received: from localhost.localdomain ([37.4.249.94]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MCoYS-1nnRIE3oA4-008v2g; Wed, 13 Apr 2022 18:28:15 +0200 From: Stefan Wahren To: Florian Fainelli , Ray Jui , Scott Branden , Rob Herring , Krzysztof Kozlowski Cc: bcm-kernel-feedback-list@broadcom.com, Nicolas Saenz Julienne , Peter Robinson , matthias.bgg@kernel.org, Marek Szyprowski , devicetree@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, Stefan Wahren Subject: [PATCH RFC] ARM: dts: bcm2711: Fix DMA constrains for newer BCM2711 boards Date: Wed, 13 Apr 2022 18:27:39 +0200 Message-Id: <20220413162739.6717-1-stefan.wahren@i2se.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Provags-ID: V03:K1:DMbliJyZHtRhT3XCf1R4ZRtgOWndXe4XF6s2L9Lk4jO4IfQbP9G jen5Fi+ZMkpox8ueSO7JEdXtGt0uhhOMg/qBJhqrSb6bwK9p7uL0B/czSbuU84kVRJCYcGG U9qcFWOBw9ozMFxNaXvTlLC/2jPnaiUzloC+r3DnMB1LQWvRqHBCiye1F0741kx9HttcwpN 8hTZ7alpDbOnNRjTRpuEw== X-UI-Out-Filterresults: notjunk:1;V03:K0:b0qKXLjwMyE=:ogLy03e69UZih+07u9Ida2 w5r8pxG+UlOsFTeJPDiv2uy1Bghv3k8+xFkCFrv2RbSZFDVe9l2eFzdWhkpLYnZb7CP26om4d 77L+3tlJD217ktW5832I/UQbyl49hV5omzfip2aCA5sHgyL0lSLt+PW2HSsLcwuwKe1oh6qX1 9T3uAXUTKVfUYYJu3nDWL4w4mHdudsK2kPbEC47cu2aQgr0k6FXt3q+QnCzR5CT3fGZb6Hkpv JZloQIngLRsnB9u2LWfa8vd8XGoJ0RGO4vpxqAQdS2l5cTik+1YnW4k+Kmq+vkF+IXxiUmBTy Ht/sfl95tsJuTtnJAFmqrm0qCK0ujWyLb9ihzGaRrUEqKZVONvJNZoUqeqIyWTu/VOV5LV4Nw aWMvmenkECSWbTGq/KMBs69dUoEJjmBnPvoFCwYeVrOQtGkcwzYuxJAYMmBgHGmO+ihTMmIXM lLk55ivphGzDtWAWCPdgZOm4gJhacY/iyd/98k2RPF80wiZ19tB3eqD7ljqCCMLxiBlbV8Z77 lIYf3NifLKrmQmOAkoIWl2JPpw2d94sT/sdCGTUW//YHgqWEapu+hpBAEyztsQboG3CxWY3rD mDVD8z6YYJ0ADMIhC/+93Am5dk3mS35m2hQmghhTQJ3D0ouftm5TA2JOxt0bPSs4LE61Q/TyP G1StcQUB2qGITj3AFEmH2u4kFsnO3nhkMs+/Ss96t7wQU17X/qmQKZ4JbOJdnfq8pNrhcq8fg TvwVbbhzR7DhVOrk X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220413_092834_009785_9FC0D5FE X-CRM114-Status: GOOD ( 17.71 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The commit 3d2cbb644836 ("ARM: dts: bcm2711: Move emmc2 into its own bus") assumed that all bootloader pass the FDT modified by the firmware to the kernel. But this is not always the case (e.g. Fedora) and cause boot issues for boards with a BCM2711 C0 SoC (RPi 400, CM4, newer RPi 4 B) which does have different DMA constraints. Since we are not able to detect the SoC revision, let's assume a BCM2711 C0 SoC for bcm2711.dtsi and move the restricted DMA constrains to a separate RPi 4 B board file just for the old SoC revision. Fixes: 3d2cbb644836 ("ARM: dts: bcm2711: Move emmc2 into its own bus") Signed-off-by: Stefan Wahren --- arch/arm/boot/dts/Makefile | 1 + arch/arm/boot/dts/bcm2711-rpi-4-b-b0.dts | 22 ++++++++++++++++++++++ arch/arm/boot/dts/bcm2711.dtsi | 11 +++-------- 3 files changed, 26 insertions(+), 8 deletions(-) create mode 100644 arch/arm/boot/dts/bcm2711-rpi-4-b-b0.dts diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile index 7c16f8a2b738..560d36ba1041 100644 --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile @@ -96,6 +96,7 @@ dtb-$(CONFIG_ARCH_BCM2835) += \ bcm2837-rpi-zero-2-w.dtb \ bcm2711-rpi-400.dtb \ bcm2711-rpi-4-b.dtb \ + bcm2711-rpi-4-b-b0.dtb \ bcm2711-rpi-cm4-io.dtb \ bcm2835-rpi-zero.dtb \ bcm2835-rpi-zero-w.dtb diff --git a/arch/arm/boot/dts/bcm2711-rpi-4-b-b0.dts b/arch/arm/boot/dts/bcm2711-rpi-4-b-b0.dts new file mode 100644 index 000000000000..c53ed510392f --- /dev/null +++ b/arch/arm/boot/dts/bcm2711-rpi-4-b-b0.dts @@ -0,0 +1,22 @@ +// SPDX-License-Identifier: GPL-2.0 +/dts-v1/; +#include "bcm2711-rpi-4-b.dts" + +&emmc2bus { + /* + * emmc2 on initial SoC revision (only assembled on RPi 4 B) + * has different DMA constraints. + */ + dma-ranges = <0x0 0xc0000000 0x0 0x00000000 0x40000000>; +}; + +&pcie0 { + /* + * The wrapper around the PCIe block has a bug + * preventing it from accessing beyond the first 3GB of + * memory. + */ + dma-ranges = <0x02000000 0x0 0x00000000 0x0 0x00000000 + 0x0 0xc0000000>; +}; + diff --git a/arch/arm/boot/dts/bcm2711.dtsi b/arch/arm/boot/dts/bcm2711.dtsi index 89af57482bc8..c307c45385a0 100644 --- a/arch/arm/boot/dts/bcm2711.dtsi +++ b/arch/arm/boot/dts/bcm2711.dtsi @@ -420,7 +420,7 @@ emmc2bus: emmc2bus { #size-cells = <1>; ranges = <0x0 0x7e000000 0x0 0xfe000000 0x01800000>; - dma-ranges = <0x0 0xc0000000 0x0 0x00000000 0x40000000>; + dma-ranges = <0x0 0x00000000 0x0 0x00000000 0xfc000000>; emmc2: mmc@7e340000 { compatible = "brcm,bcm2711-emmc2"; @@ -574,13 +574,8 @@ IRQ_TYPE_LEVEL_HIGH>, ranges = <0x02000000 0x0 0xf8000000 0x6 0x00000000 0x0 0x04000000>; - /* - * The wrapper around the PCIe block has a bug - * preventing it from accessing beyond the first 3GB of - * memory. - */ - dma-ranges = <0x02000000 0x0 0x00000000 0x0 0x00000000 - 0x0 0xc0000000>; + dma-ranges = <0x02000000 0x4 0x00000000 0x0 0x00000000 + 0x1 0x00000000>; brcm,enable-ssc; };