Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp1590195rdb; Thu, 7 Dec 2023 03:44:04 -0800 (PST) X-Google-Smtp-Source: AGHT+IEvo5FFYwYButkSbrubmqAVIOQ/p+M8Fb5q8pfv1fWULb/hws8/ZvVbAs3aauJoRuLRuVQV X-Received: by 2002:a05:6808:10cd:b0:3b5:6604:a8ba with SMTP id s13-20020a05680810cd00b003b56604a8bamr3039529ois.36.1701949444024; Thu, 07 Dec 2023 03:44:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701949443; cv=none; d=google.com; s=arc-20160816; b=e4Oz0dybmzOf2EvAmxlsMNIb7zI7xRT0C0Mc0g8ZtkYSCaei3o4a3NJp137RauvnLD yX+dfpQtH2XSthxxIPJ3uQYp0FuDWxfA/QbH6EOrghaAFPDSK7nKSCQPZA1OuW3H8bho Hy2vQsPKgK8Lpc4LPNxfg0gATRk5EM8RviqWNIsnLLIXZtNIQPT1IRaFnZ7KIVYC2iGQ n3G4KvP0phNatj6iV+0NX6jUdrVUrfi0377FfqXSlhBHs2NUsR4BsfCAi3nPikQjxmpn J/w2FpDgz9WBBcsTpgQH+FJE7FMZREjRwXEfEwY89/6uxbdU5oVCu41RID6/RPE/kokM xbPw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=9z5eXgndvtEwtlJVfKRAi873WULrAi1+Wb6ZtgRbOBA=; fh=rvvM+Jtn0qXhre/mFLj2ypEDKOfTZvvAZneWJJR0lZg=; b=eLcF3YXb2b5UbJRpeJJLec9mTPI5eN/vd0Y/7gcsE9EaaMTSz9W3+kybw048yM+mUQ LNIz4bOKVYXdPge71d+9izhCaOIqI6oRth5jjpZMsMedLXFYWaufmppZEud7OF3qrJnP 3Bxl1pQLUSDpNX9niyAw3zei30hfBn4eHtHDda41qiBFwk8A0GZAJ2SBXFRnv8m19Vdf 7R1ivtqxputyTkJetaCs5TPe74xSOihgq9WaL/rWuFdupQq2I/02nOp5trniB2YCino2 EUrfr+4EDKHjtfwdNRVG/vgZQ+c6ZYyv3Qagv/TACqeN39ibZLpNlMbUq0gs3dB0Z0AQ vYJQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=sntech.de Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id bu8-20020a056a00410800b006cd82b4d0c4si1106999pfb.89.2023.12.07.03.44.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Dec 2023 03:44:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=sntech.de Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 3E4D08027B65; Thu, 7 Dec 2023 03:44:00 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1379042AbjLGLlI convert rfc822-to-8bit (ORCPT + 99 others); Thu, 7 Dec 2023 06:41:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44454 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1379020AbjLGLlG (ORCPT ); Thu, 7 Dec 2023 06:41:06 -0500 Received: from gloria.sntech.de (gloria.sntech.de [185.11.138.130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 58063A3; Thu, 7 Dec 2023 03:41:10 -0800 (PST) Received: from i53875b61.versanet.de ([83.135.91.97] helo=diego.localnet) by gloria.sntech.de with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rBCkW-000248-Ve; Thu, 07 Dec 2023 12:41:01 +0100 From: Heiko =?ISO-8859-1?Q?St=FCbner?= To: Rob Herring , Sam Edwards Cc: linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Daniel =?utf-8?B?S3VraWXFgmE=?= , Sven Rademakers , Joshua Riek Subject: Re: [RESEND PATCH] arm64: dts: rockchip: Add PCIe pinctrls to Turing RK1 Date: Thu, 07 Dec 2023 12:41:00 +0100 Message-ID: <2369165.PYKUYFuaPT@diego> In-Reply-To: References: <20231205202900.4617-1-CFSworks@gmail.com> <3331042.e9J7NaK4W3@diego> MIME-Version: 1.0 Content-Transfer-Encoding: 8BIT Content-Type: text/plain; charset="iso-8859-1" X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Thu, 07 Dec 2023 03:44:00 -0800 (PST) Am Mittwoch, 6. Dezember 2023, 19:26:40 CET schrieb Sam Edwards: > > On 12/6/23 07:55, Heiko St?bner wrote: > > Am Dienstag, 5. Dezember 2023, 21:28:59 CET schrieb Sam Edwards: > >> The RK3588 PCIe 3.0 controller seems to have unpredictable behavior when > >> no CLKREQ/PERST/WAKE pins are configured in the pinmux. In particular, it > >> will sometimes (varying between specific RK3588 chips, not over time) shut > >> off the DBI block, and reads to this range will instead stall > >> indefinitely. > >> > >> When this happens, it will prevent Linux from booting altogether. The > >> PCIe driver will stall the CPU core once it attempts to read the version > >> information from the DBI range. > >> > >> Fix this boot hang by adding the correct pinctrl configuration to the > >> PCIe 3.0 device node, which is the proper thing to do anyway. While > >> we're at it, also add the necessary configuration to the PCIe 2.0 node, > >> which may or may not fix the equivalent problem over there -- but is the > >> proper thing to do anyway. :) > >> > >> Fixes: 2806a69f3fef6 ("arm64: dts: rockchip: Add Turing RK1 SoM support") > >> Signed-off-by: Sam Edwards > >> --- > >> .../arm64/boot/dts/rockchip/rk3588-turing-rk1.dtsi | 14 ++------------ > >> 1 file changed, 2 insertions(+), 12 deletions(-) > >> > >> diff --git a/arch/arm64/boot/dts/rockchip/rk3588-turing-rk1.dtsi b/arch/arm64/boot/dts/rockchip/rk3588-turing-rk1.dtsi > >> index 9570b34aca2e..129f14dbd42f 100644 > >> --- a/arch/arm64/boot/dts/rockchip/rk3588-turing-rk1.dtsi > >> +++ b/arch/arm64/boot/dts/rockchip/rk3588-turing-rk1.dtsi > >> @@ -214,7 +214,7 @@ rgmii_phy: ethernet-phy@1 { > >> &pcie2x1l1 { > >> linux,pci-domain = <1>; > >> pinctrl-names = "default"; > >> - pinctrl-0 = <&pcie2_reset>; > >> + pinctrl-0 = <&pcie30x1m1_pins>; > >> reset-gpios = <&gpio4 RK_PA2 GPIO_ACTIVE_HIGH>; > >> status = "okay"; > >> }; > >> @@ -226,7 +226,7 @@ &pcie30phy { > >> &pcie3x4 { > >> linux,pci-domain = <0>; > >> pinctrl-names = "default"; > >> - pinctrl-0 = <&pcie3_reset>; > >> + pinctrl-0 = <&pcie30x4m1_pins>; > > Hi Heiko, > > > > > also, why are you throwing out the pinctrl for the reset pin. > > That seems not related to the regular pins and you could instead just do > > > > + pinctrl-0 = <&pcie30x4m1_pins>, <&pcie3_reset>; > > The pcie30x4m1_pins def does include pinmuxing `4 RK_PB6` to the DW > controller already. The v2 patch should probably instead remove the > reset-gpios property, since an out-of-band GPIO reset is not needed when > the controller can do it. yep, also because of the reset-gpios the pinctrl/gpio driver will mux the pin to gpio function even though the pinctrl would've set if the pcie- function before that. So I'm really in favor of not mixing the two concepts :-) When setting the pins, the reset-gpio should be gone and vice-versa. > I'm still looking into the story with the PCIe 2.0 pins, since 2.0x1's > PERST# is definitely 4A2. I'll ask around and try to find out where the > corresponding CLKREQ# is going. Yeah, I tried reading up in the TRM but it was really hard following which pin-group actually goes to which controller and the naming definitly does not help :-) . Heiko > >> reset-gpios = <&gpio4 RK_PB6 GPIO_ACTIVE_HIGH>; > >> vpcie3v3-supply = <&vcc3v3_pcie30>; > >> status = "okay"; > >> @@ -245,17 +245,7 @@ hym8563_int: hym8563-int { > >> }; > >> }; > >> > >> - pcie2 { > >> - pcie2_reset: pcie2-reset { > >> - rockchip,pins = <4 RK_PA2 RK_FUNC_GPIO &pcfg_pull_none>; > >> - }; > >> - }; > >> - > >> pcie3 { > >> - pcie3_reset: pcie3-reset { > >> - rockchip,pins = <4 RK_PB6 RK_FUNC_GPIO &pcfg_pull_none>; > >> - }; > >> - > >> vcc3v3_pcie30_en: pcie3-reg { > >> rockchip,pins = <2 RK_PC5 RK_FUNC_GPIO &pcfg_pull_none>; > >> }; > >> > > > > > > > > >