From nobody Sat Sep 07 01:48:12 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X0wwY2rcmz5WSTh; Sat, 07 Sep 2024 01:48:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X0wwY1MSsz4kNW; Sat, 7 Sep 2024 01:48:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725673693; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kqelDlpvxqVeN/k14Czmwh7+8im5a8EPo0j3eN8R1kQ=; b=Ljiv7wjotO+JedP7AAuEWH1exh2Vtevwpxb7YKL/k8biDVAvfZSU2pTBkwkZAog81s+z8b fDlZqGW5uhWYFpsaQpklCqu2qToIYT4+mLk/uk7PDoDmOgVxevOY6iH144bdpdmMKxxsZE nXGdiqfSJuGJSORO+mpRHMXUJKvhBcJgqAnU2uuhAQoAypVdzq2of/AoESPxu7WqoSAWER npQnm/QvsOHQ8Fh7i7UMgNOORKeZT6183dUJ2lVgP9KcDLEv2BSE4tBnGsdsw+a/TC5KWy ZktuPRsxD5RZfq/pByLvVRUMh4wWmbecb/e3+7QD5nSEXOD2HbakAjmhnOyOoQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725673693; a=rsa-sha256; cv=none; b=Ke/hraYrW5PCpfbZirUVeHbjCIU0ZCI38vgxqp0AilIkxwQONLq8SUnB/E11V2tc/B+2hF 8aeu+Cfa83vyFTia3X+ABP9O9gW7xJ8iIeVu+NRAyO0idyhxXoTA3BtMgDGoCWoSTfGaIu OrqQTL/OTjK0AoW4nx0I19MEDL7yIEOKIsGJVlOVsV89KFun/teHk/oCj7NbDuGW/L/GRm Gk1eBlyJbacn/8AjJMQz0z4Q5OsIlWDfoKgiSySZIjicwhdMa0LiP+B01jGDG0nGyhGhHG BOHEKzCSv8MFLP8OHtmHR52wPktw1W8degJBqCKs6L/KMX3ugK0kJ88mJdRQSg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725673693; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kqelDlpvxqVeN/k14Czmwh7+8im5a8EPo0j3eN8R1kQ=; b=xeYiYJn9PXe5+MVL4WhuDCxKbXM8dn+sj07g27PgkRkIWkHujWmWs0eUZlfrwpydF8wj96 sNEwphg4/cw3YFmJ+ZNEZhRw4EVxrYaOkUVHS64EWT6X+FktqYsyeIaKugITpkeHhJzUTL JEGD6KFQtyDlRFMFQ2O7EkyYzCYzwEARlzMx59V2YyBaUhtj3SaN9TS4wTK2GMLqRPhbHw fDIitvL9pXlqld8BwvkZTWQRIz1ID6te8a9/dPI4JSMlxSFML63OVaK/XCNg8SD9x/mLcZ fwh9dmf48gKmMX6+1Fqr6T8DmbhRaEgwe/mHa3X2Kdu5UiG1tGRNHgrhf8TmXg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X0wwY0kkLzGJj; Sat, 7 Sep 2024 01:48:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4871mCtT042321; Sat, 7 Sep 2024 01:48:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4871mChf042318; Sat, 7 Sep 2024 01:48:12 GMT (envelope-from git) Date: Sat, 7 Sep 2024 01:48:12 GMT Message-Id: <202409070148.4871mChf042318@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: 9ae4c66bff69 - stable/14 - fu740_pci_dw: Fix PERST delay and keep asserted for rest of reset sequence List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 9ae4c66bff6927dc6fcc855f1aa539a2115b21bd Auto-Submitted: auto-generated The branch stable/14 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=9ae4c66bff6927dc6fcc855f1aa539a2115b21bd commit 9ae4c66bff6927dc6fcc855f1aa539a2115b21bd Author: Jessica Clarke AuthorDate: 2024-06-02 20:42:18 +0000 Commit: Jessica Clarke CommitDate: 2024-09-07 01:47:00 +0000 fu740_pci_dw: Fix PERST delay and keep asserted for rest of reset sequence DELAY takes microseconds not milliseconds, so 100 was too low. Moreover, when enabling hw.pci.clear_pcib, PCI emeration would still stop at one of the first bridges, but by asserting PERST for the rest of the reset sequence that appears to be reliably addressed. Fixes: 896e217a0eae ("fu740_pci_dw: Add SiFive FU740 PCIe controller driver") (cherry picked from commit 28aaa58fa64ecb89d47f0a8396954ad8ca82d8ef) --- sys/riscv/sifive/fu740_pci_dw.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sys/riscv/sifive/fu740_pci_dw.c b/sys/riscv/sifive/fu740_pci_dw.c index fe741f4bb6e6..eff23a294985 100644 --- a/sys/riscv/sifive/fu740_pci_dw.c +++ b/sys/riscv/sifive/fu740_pci_dw.c @@ -216,12 +216,6 @@ fupci_phy_init(struct fupci_softc *sc) return (error); } - /* Hold PERST for 100ms as per the PCIe spec */ - DELAY(100); - - /* Deassert PERST_N */ - FUDW_MGMT_WRITE(sc, FUDW_MGMT_PERST_N, 1); - /* Deassert core power-on reset (active low) */ error = gpio_pin_set_active(sc->porst_pin, true); if (error != 0) { @@ -281,6 +275,12 @@ fupci_phy_init(struct fupci_softc *sc) /* Put the controller in Root Complex mode */ FUDW_MGMT_WRITE(sc, FUDW_MGMT_DEVICE_TYPE, FUDW_MGMT_DEVICE_TYPE_RC); + /* Hold PERST for 100ms as per the PCIe spec */ + DELAY(100000); + + /* Deassert PERST_N */ + FUDW_MGMT_WRITE(sc, FUDW_MGMT_PERST_N, 1); + return (0); }