Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp3725101pxb; Mon, 4 Oct 2021 08:18:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxeYDPyb6nEuLOgeI0kPlLoZL5FppDCfWpIfEB1KTWLvqB6RpON0EVn7uTGnoTcrfN+vdYx X-Received: by 2002:a62:6543:0:b0:44c:61a0:555a with SMTP id z64-20020a626543000000b0044c61a0555amr5680606pfb.14.1633360710803; Mon, 04 Oct 2021 08:18:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633360710; cv=none; d=google.com; s=arc-20160816; b=OQQghpRYc+L+R3X5Rc3pbUOMjloP74hQSdHpzCjPulBNlW1rub3HNIjQKyDotfnGwG mDeTK9WD5Ut/XNy+GT/81TTu0xs7tAJIMOio/G7ayXOmk6neYlZEToaOPdzjp2e5khYi aek8EKyKpuuwfQVJCkKFz8nQNjiIl4Mn6aa07rXKaxapZTFJq4+nJWyO6tNhMQV96i+f Xc+Eloyujv1dMrPwNQ/f8hvBneVs8znCpASDRK+6MjNfb0a3IWWZaxkyUm8RenYfBFcV +HCFQHygloMJ+kriVN6tG1Zj57CZLnNQojAIrGQ5bvoU8AkhC5e38Zfd+PY8UHvuMdPG hgOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=copS05oC3BvbxMuB7WJJKQ7tBTbihm43wyzBaqSB7r0=; b=iiiI+MXbvSt5vJKJe70NZrDAAuzmpz0gU2oDCS6rr5Wu3WI6a5GEbrLno2lmSvK5RH 4N8l2Y2zIU5yDeEBl7yanrUSOgvn3xhQDNjceE9arWTBRmPGWUMBNelBHLnHmb84KrFG Sj3X0mOfbW0k6mZTMlDjNWVIE4YnBT/vPNdbmQ7PonDo2f1Tu+HKO4sejyJ/jjva3P7R T1TYC4b20XgMvj2/uA72CpvsIIk8LjP6bLtupA84asg3b4a8q7Rmz6iQqYQ0FaFD+iO+ 8YCsdwKs/4ufUjnHtxS2rFpF+eG7XNDc3rWeZSeuK1SAGy7+kCNCvkqaHCdE/sujqQLG MchQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=RtTbpj54; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q18si1732633pjp.61.2021.10.04.08.18.16; Mon, 04 Oct 2021 08:18:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=RtTbpj54; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235108AbhJDNG6 (ORCPT + 99 others); Mon, 4 Oct 2021 09:06:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:39400 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235018AbhJDNFG (ORCPT ); Mon, 4 Oct 2021 09:05:06 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id B9EDF619E9; Mon, 4 Oct 2021 13:00:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1633352443; bh=m5g8pHrcOarWNrs9l5je+BWEigSOH/iE0hdKrktRD8I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RtTbpj54N9/c0QFOrfrVx9XYwGdaprUDVRzJW7x80KS8fIO42Qo+WHUg6FQs75ZuS rUUy4+UBj4jTtANVXiG90uHCGDCb1GtZbhabaA/LaLlUnzQ7jDEgTyp1dYFH4Tx9Qr uVEHxiCxYDpnS7ZnVvEmJMmFVoYLLF5blNFgABKs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?UTF-8?q?Pali=20Roh=C3=A1r?= , Gregory CLEMENT Subject: [PATCH 4.14 37/75] arm64: dts: marvell: armada-37xx: Extend PCIe MEM space Date: Mon, 4 Oct 2021 14:52:12 +0200 Message-Id: <20211004125032.762503330@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211004125031.530773667@linuxfoundation.org> References: <20211004125031.530773667@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Pali Rohár commit 514ef1e62d6521c2199d192b1c71b79d2aa21d5a upstream. Current PCIe MEM space of size 16 MB is not enough for some combination of PCIe cards (e.g. NVMe disk together with ath11k wifi card). ARM Trusted Firmware for Armada 3700 platform already assigns 128 MB for PCIe window, so extend PCIe MEM space to the end of 128 MB PCIe window which allows to allocate more PCIe BARs for more PCIe cards. Without this change some combination of PCIe cards cannot be used and kernel show error messages in dmesg during initialization: pci 0000:00:00.0: BAR 8: no space for [mem size 0x01800000] pci 0000:00:00.0: BAR 8: failed to assign [mem size 0x01800000] pci 0000:00:00.0: BAR 6: assigned [mem 0xe8000000-0xe80007ff pref] pci 0000:01:00.0: BAR 8: no space for [mem size 0x01800000] pci 0000:01:00.0: BAR 8: failed to assign [mem size 0x01800000] pci 0000:02:03.0: BAR 8: no space for [mem size 0x01000000] pci 0000:02:03.0: BAR 8: failed to assign [mem size 0x01000000] pci 0000:02:07.0: BAR 8: no space for [mem size 0x00100000] pci 0000:02:07.0: BAR 8: failed to assign [mem size 0x00100000] pci 0000:03:00.0: BAR 0: no space for [mem size 0x01000000 64bit] pci 0000:03:00.0: BAR 0: failed to assign [mem size 0x01000000 64bit] Due to bugs in U-Boot port for Turris Mox, the second range in Turris Mox kernel DTS file for PCIe must start at 16 MB offset. Otherwise U-Boot crashes during loading of kernel DTB file. This bug is present only in U-Boot code for Turris Mox and therefore other Armada 3700 devices are not affected by this bug. Bug is fixed in U-Boot version 2021.07. To not break booting new kernels on existing versions of U-Boot on Turris Mox, use first 16 MB range for IO and second range with rest of PCIe window for MEM. Signed-off-by: Pali Rohár Fixes: 76f6386b25cc ("arm64: dts: marvell: Add Aardvark PCIe support for Armada 3700") Signed-off-by: Gregory CLEMENT Signed-off-by: Greg Kroah-Hartman --- arch/arm64/boot/dts/marvell/armada-37xx.dtsi | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) --- a/arch/arm64/boot/dts/marvell/armada-37xx.dtsi +++ b/arch/arm64/boot/dts/marvell/armada-37xx.dtsi @@ -347,8 +347,15 @@ #interrupt-cells = <1>; msi-parent = <&pcie0>; msi-controller; - ranges = <0x82000000 0 0xe8000000 0 0xe8000000 0 0x1000000 /* Port 0 MEM */ - 0x81000000 0 0xe9000000 0 0xe9000000 0 0x10000>; /* Port 0 IO*/ + /* + * The 128 MiB address range [0xe8000000-0xf0000000] is + * dedicated for PCIe and can be assigned to 8 windows + * with size a power of two. Use one 64 KiB window for + * IO at the end and the remaining seven windows + * (totaling 127 MiB) for MEM. + */ + ranges = <0x82000000 0 0xe8000000 0 0xe8000000 0 0x07f00000 /* Port 0 MEM */ + 0x81000000 0 0xefff0000 0 0xefff0000 0 0x00010000>; /* Port 0 IO */ interrupt-map-mask = <0 0 0 7>; interrupt-map = <0 0 0 1 &pcie_intc 0>, <0 0 0 2 &pcie_intc 1>,