Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp592973rwb; Tue, 4 Oct 2022 08:06:29 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4OLTYcqVvUGOZ/VrgFpBEK8LGdJW+4pAdr6Eh4l81ru1iKiOOV3yJ77yJlk+47Wfd+oMXW X-Received: by 2002:a50:fb0f:0:b0:458:df03:c3aa with SMTP id d15-20020a50fb0f000000b00458df03c3aamr11159627edq.83.1664895989058; Tue, 04 Oct 2022 08:06:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664895989; cv=none; d=google.com; s=arc-20160816; b=FG2KHgynhHa3hJSB3EdtkSYBvQA0/iYfC6uUxHrnlHqV0X9qUXmYwG6KflohspqYyS GqX1izpSD6sHEm8PdKSJB7YKP8z49h359KXZ+w2QA4A7CSjZjfEPeUD+SSFvVYrQrOJa aH7EOulfxfCGAWACscAqp9gv9Mj6Jveis4Ym8/4MlN/QJ7XNKGnaRBmcLh1wlSEj8Hg7 u/V+UPZXy46HZDILjwV8ZE7rnXctEllrAmma4nXe8HSrivQpqhlq5oxmfuBukUgvrSX8 oL8nS/lmz1c31WYyxF170lzPV2vdQXjRc+su0c2BcxZokTJmZ/5IU2JoIUhwQseQJQks y1Gg== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=0BTuidPnsRK9veYLcODq/GekOuyhAp/Ir63dYwPstjg=; b=jBvLoV0wO5tnvorxpg1LlyVbrRocwXglZ4PShB7Ag60v/F4Ey07kqWAyMsHT0opRQg /QLLPFRFNsT0n2lHCwYEUdfATybSwa1KsZ4+60d1KmTfNr9qU2YMZOisMMd+j1VzC+Mm AwSc8TdifBu3wkC1ZOmlw+ytIjfTQd1QLkdYNTKUKOUcZcSPJq2//RBb/OFuE3tOZxhE DPpKYPurtRLxq9JapAKgh8fbsGcz1xchubkRMNfVvDm5hKU7IREaVRUxOozErg3xDAqh AT2HpHs0mF2L/47Wk3qmkJFnRhVVKUF50oRP30O0gfx81ZdOXbpuvWxJcU8X/LlMbXf0 sAQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@xff.cz header.s=mail header.b="o/RSqcqX"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=xff.cz Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c15-20020a05640227cf00b00456fd2bb890si13143958ede.564.2022.10.04.08.06.02; Tue, 04 Oct 2022 08:06:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@xff.cz header.s=mail header.b="o/RSqcqX"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=xff.cz Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229906AbiJDOnT (ORCPT + 99 others); Tue, 4 Oct 2022 10:43:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49168 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229648AbiJDOnQ (ORCPT ); Tue, 4 Oct 2022 10:43:16 -0400 Received: from vps.xff.cz (vps.xff.cz [195.181.215.36]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AF3191D0C4; Tue, 4 Oct 2022 07:43:14 -0700 (PDT) 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 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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