From patchwork Fri Dec 8 06:25:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Edwards X-Patchwork-Id: 175609 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp5273827vqy; Thu, 7 Dec 2023 22:25:31 -0800 (PST) X-Google-Smtp-Source: AGHT+IFq5LilfSkgZl1WYXscyAhM7HWcIAs+LYKJYFjRsaLlFrHEJtAOssr+bP/qFQfiDAPrUhkC X-Received: by 2002:a05:6a00:1887:b0:6ce:784a:579 with SMTP id x7-20020a056a00188700b006ce784a0579mr3924263pfh.21.1702016731670; Thu, 07 Dec 2023 22:25:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702016731; cv=none; d=google.com; s=arc-20160816; b=whUf+jblwzRJ25Fnwk7/ncnMyiRhmLtJUhV7AayF69xHjv6b9nJonhZOtpoYhZkQ3a ywAPKa1Dmrtyl60MQmsojzPF3Cz5+amXSo663FdxnYuhqoEKUuc45tSjaJhiKcF5Ldeo 9acRMPb05jrShSIHQmsggdg75HczisFjro7zCT/xVrhwzCSav+HpzMmlG6CIpnSRcGsD BzqJu4nfBupjLOo6pttafHlfzfaTqlFl4Dc1J6YoHDeEPxHAk4rPBhmbP+WLzG+wfvon dFKGJzyZ0LsJ8prBOBlEvQt46e2gRf7kJ4sUCrSagF3gnV3H2W04OYILQa1ucZ5rQKY4 rNkQ== 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=zFpM3a3kO+H6eKxWi2Fxy+Ey6betIA4rnEu4oUHt5AI=; fh=WsPG8bmoeVdJ+mTvc3JfGT690EmTY9Rsmm35P0eF47I=; b=YsVVPHWQ6nKGA9PUIcQove94sAelTN/TGa1jSCBVfUT7OtsTx7sUOhaApRrW7C6ubh 6QQffsJgE+aYSYdkj4Y5GRlAEUnSDcNJ0k621w4W5Sf0AMbzFdogsMtJb7vStAML3uzG 8EyEkV64OQO8uVJ5DnfiibXcugAZ9LxfijrxHXbzwxQcMWBFRCprXYWAZ0RtqQoEZvl4 Th4M+WK6YU9twWPBuXnQECu76HFNSa/V6NgFH+XEvu832fsvhV+IlXbZqxNzDe9Gh8+W fSjnlRUPjAUa6OVwXmBZc11xpjvw5YezxDC4kRNqGfYDnj5e9T1VTa0VVr6xDtl5IJUG 1U+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=F+nUt65a; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id it24-20020a056a00459800b006ce707e00d3si996575pfb.241.2023.12.07.22.25.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Dec 2023 22:25:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=F+nUt65a; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id DAFCE836C00F; Thu, 7 Dec 2023 22:25:28 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232875AbjLHGZT (ORCPT + 99 others); Fri, 8 Dec 2023 01:25:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38052 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229531AbjLHGZR (ORCPT ); Fri, 8 Dec 2023 01:25:17 -0500 Received: from mail-io1-xd29.google.com (mail-io1-xd29.google.com [IPv6:2607:f8b0:4864:20::d29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4B2411723; Thu, 7 Dec 2023 22:25:24 -0800 (PST) Received: by mail-io1-xd29.google.com with SMTP id ca18e2360f4ac-7b70db00e64so15180039f.2; Thu, 07 Dec 2023 22:25:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702016723; x=1702621523; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=zFpM3a3kO+H6eKxWi2Fxy+Ey6betIA4rnEu4oUHt5AI=; b=F+nUt65aNaTGMqw0755syQrKfVb7ik07xoj9ZBf56NiSd9xw/igbD1RO/HSvTO0Uvp wkN+eyANJtBgJ7euFABTMS/EpMC+HG4KOgf7QQzeEdm6YrYCzWdQ/hRZDY4wMs9odOSj KyaGIwumkoV3m5PfeHkL7+nCqXyXPIr5HG8pJu2sVy8H0WyNPcWy9nIlBmQfWNFJP3Jc wqXCpC7TF5jPGlbn2u4RNuFMamyqfzxVTt/eQ1N4H0rSCrSZN6giFQm8raCb3MbNH02J +HiQcBILS6rBqyeAAB2SWmSTorQioED4WOs5qcAjBcjggSnO0pIl+m5rzfouMi0M0k+7 F7Xg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702016723; x=1702621523; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=zFpM3a3kO+H6eKxWi2Fxy+Ey6betIA4rnEu4oUHt5AI=; b=UmiNUPG2toGDYSQaaczlg1hgJGnsVU0zn8gIipsyK8iRgD8DOObmrNnpAodtlIjZIu jzjRBypiMmd8q3FmslIB1/6aqUQvj2lH9q0TjkxQ6IzODHtLyoSvrMxPSys/JvRAUhAu 6NMl6DGYnVbHVDRCx4ezrH9WdHuvY5jMHyXCTqWkh95ELuGaeqvohHznm8WNimV7B6b5 Id+2mbBeUObCcNY8elz/YxbWWxoTzjXxJQqyp578aDqIz4sqKHiTtpeaLTThLNYjPPlC lwAxKDkELYDqothQGjoONRvQb2SRBoWHqR0rF2B5uO0gmDxtyAUeIPqmuA6k5ahpTD8P uCrw== X-Gm-Message-State: AOJu0YyhJ0fe6F6yJvMwEHVSXFHdh2bHr7DBAgqH35bYm7M1o5L2RF8v 9y9i/PsDvhTAXNQMfaBZ+RM= X-Received: by 2002:a6b:6a14:0:b0:7b4:28f8:d8 with SMTP id x20-20020a6b6a14000000b007b428f800d8mr4136516iog.33.1702016723587; Thu, 07 Dec 2023 22:25:23 -0800 (PST) Received: from celestia.nettie.lan ([2001:470:42c4:101:de4c:e3ab:ccaa:1887]) by smtp.gmail.com with ESMTPSA id h25-20020a02cd39000000b0042acf934cbasm301894jaq.72.2023.12.07.22.25.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Dec 2023 22:25:23 -0800 (PST) From: Sam Edwards X-Google-Original-From: Sam Edwards To: Heiko Stuebner , Rob Herring Cc: linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, =?utf-8?q?Daniel_?= =?utf-8?q?Kukie=C5=82a?= , Sven Rademakers , Joshua Riek , Sam Edwards Subject: [PATCH v2] arm64: dts: rockchip: Add PCIe pinctrls to Turing RK1 Date: Thu, 7 Dec 2023 23:25:10 -0700 Message-ID: <20231208062510.893392-1-CFSworks@gmail.com> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, 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 morse.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 (morse.vger.email [0.0.0.0]); Thu, 07 Dec 2023 22:25:29 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784693896269762050 X-GMAIL-MSGID: 1784693896269762050 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 --- Hi list, Compared to v1, v2 removes the `reset-gpios` properties as well -- this should give control of the PCIe resets exclusively to the PCIe cores. (And even if the `reset-gpios` props had no effect in v1, it'd be confusing to have them there.) Note that it is OK for the pcie2x1l1 node to refer to pcie30x1m1_pins. The pcie2x1l1 device is *in fact* a PCIe 3.0 controller, and the pcie30x1m1_pins pinmux setting is so-named to reflect this. The pcie2x1l1 node is so-named because Linux does not (currently) support routing it to a PCIe 3.0 PHY; so in practice it is effectively a PCIe 2.0 controller, for the time being. Cheers and thank you for your time, Sam --- .../boot/dts/rockchip/rk3588-turing-rk1.dtsi | 16 ++-------------- 1 file changed, 2 insertions(+), 14 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..875446fdb67e 100644 --- a/arch/arm64/boot/dts/rockchip/rk3588-turing-rk1.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3588-turing-rk1.dtsi @@ -214,8 +214,7 @@ rgmii_phy: ethernet-phy@1 { &pcie2x1l1 { linux,pci-domain = <1>; pinctrl-names = "default"; - pinctrl-0 = <&pcie2_reset>; - reset-gpios = <&gpio4 RK_PA2 GPIO_ACTIVE_HIGH>; + pinctrl-0 = <&pcie30x1m1_pins>; status = "okay"; }; @@ -226,8 +225,7 @@ &pcie30phy { &pcie3x4 { linux,pci-domain = <0>; pinctrl-names = "default"; - pinctrl-0 = <&pcie3_reset>; - reset-gpios = <&gpio4 RK_PB6 GPIO_ACTIVE_HIGH>; + pinctrl-0 = <&pcie30x4m1_pins>; vpcie3v3-supply = <&vcc3v3_pcie30>; status = "okay"; }; @@ -245,17 +243,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>; };