From mboxrd@z Thu Jan 1 00:00:00 1970 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 67EFDC433FE for ; Tue, 4 Oct 2022 14:44:41 +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=jRq85KwvpYyNCCGiu9YIZq3KTNdiUwgLtrDvctJBg6k=; b=FN2htFYvCCplC/ UFA/ZnBGP1UoWLnWDxyoVTpI0mlvBTmEBRgACm8IDHvglyI43qeX9iXUNSmsO5ZrFxjU0O9CMwszq Mj+c7FcsY7l9GP5t/xq60pBcLmQ3EnY9Nm9Wi5d1MzZedrcFpKt3j1YnarAAUN0UX8eR4xvRSCmmK QQXQwGuTDe5MyXZUFQwV8FtfEYs1MFEWauu3GSP6ByTTOmF5yiqSUYe1v9sGEcOsAMw+ioIAlMYuw HTXpVWqTLfiMKy5c1Gr55qKXcsie1EkyhGlV5+v97BOMxgO4p9L4tFYXlztAKfhmFJGlhX95Ne+hr +eyOBeybkLXSzwhgh0kA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ofj8m-009x0q-Be; Tue, 04 Oct 2022 14:43:24 +0000 Received: from vps.xff.cz ([195.181.215.36]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ofj8j-009wzV-1o; Tue, 04 Oct 2022 14:43:22 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=xff.cz; s=mail; t=1664894592; bh=99g94TiL+hFwBhUbQX5X4TMC3lCGyB73fo7yYhcTiA4=; h=From:To:Cc:Subject:Date:From; b=o/RSqcqX5mVidZgEXMSOC1i5y5uevvYOEdlYRTh36ZM0KKE34mbxp9N/fMLhZyFoP xSnnDkdHI7OPurUPgIxPwIQzdzVul6e5Hg4WEbJ39WGLuzWs3wLkrX8MoYtEefFZUm fbYdDuhpqxj3B1c44PBz3SQSxJe6KtR047UGuFfw= From: Ondrej Jirman To: linux-rockchip@lists.infradead.org Cc: Ondrej Jirman , Rob Herring , Krzysztof Kozlowski , Heiko Stuebner , Peter Geis , Michael Riesch , Nicolas Frattaroli , Sascha Hauer , Frank Wunderlich , Ezequiel Garcia , Yifeng Zhao , Johan Jonker , devicetree@vger.kernel.org (open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS), linux-arm-kernel@lists.infradead.org (moderated list:ARM/Rockchip SoC support), linux-kernel@vger.kernel.org (open list) Subject: [PATCH] arm64: dts: rockchip: rk356x: Fix PCIe register map and ranges Date: Tue, 4 Oct 2022 16:43:03 +0200 Message-Id: <20221004144304.536023-1-megi@xff.cz> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221004_074321_286778_BB2D19AB X-CRM114-Status: GOOD ( 13.83 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org I have two Realtek PCIe wifi cards connected over the 4 port PCIe bridge to Quartz64-A. The cards fail to work, when nvme SSD is connected at the same time to the bridge. Without nvme connected, cards work fine. The issue seems to be related to mixed use of devices which make use of I/O ranges and memory ranges. This mapping is designed to be more straightforward, inspired by dt-bindings docs for sample pcie3x2 node: reg = <0x3 0xc0800000 0x0 0x390000>, <0x0 0xfe280000 0x0 0x10000>, <0x3 0x80000000 0x0 0x100000>; ranges = <0x81000000 0x0 0x80800000 0x3 0x80800000 0x0 0x100000>, <0x83000000 0x0 0x80900000 0x3 0x80900000 0x0 0x3f700000>; I noticed that this is crafted so that there doesn't need to be any translation other than dropping the high dword bits, and I modified the ranges for pcie2x1 to follow the same principle. This change to the regs/ranges makes the issue go away and both nvme and wifi cards work when connected at the same time to the bridge. Signed-off-by: Ondrej Jirman --- arch/arm64/boot/dts/rockchip/rk356x.dtsi | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/arch/arm64/boot/dts/rockchip/rk356x.dtsi b/arch/arm64/boot/dts/rockchip/rk356x.dtsi index 319981c3e9f7..e88e8c4fe25b 100644 --- a/arch/arm64/boot/dts/rockchip/rk356x.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk356x.dtsi @@ -855,7 +855,8 @@ pcie2x1: pcie@fe260000 { compatible = "rockchip,rk3568-pcie"; reg = <0x3 0xc0000000 0x0 0x00400000>, <0x0 0xfe260000 0x0 0x00010000>, - <0x3 0x3f000000 0x0 0x01000000>; + <0x3 0x00000000 0x0 0x01000000>; + reg-names = "dbi", "apb", "config"; interrupts = , , @@ -884,8 +885,8 @@ pcie2x1: pcie@fe260000 { phys = <&combphy2 PHY_TYPE_PCIE>; phy-names = "pcie-phy"; power-domains = <&power RK3568_PD_PIPE>; - ranges = <0x01000000 0x0 0x3ef00000 0x3 0x3ef00000 0x0 0x00100000 - 0x02000000 0x0 0x00000000 0x3 0x00000000 0x0 0x3ef00000>; + ranges = <0x01000000 0x0 0x01000000 0x3 0x01000000 0x0 0x00100000 + 0x02000000 0x0 0x02000000 0x3 0x02000000 0x0 0x3e000000>; resets = <&cru SRST_PCIE20_POWERUP>; reset-names = "pipe"; #address-cells = <3>; -- 2.37.3 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel