From nobody Tue Jan 24 08:54:12 2023 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 4P1LPJ2TSjz30x8D; Tue, 24 Jan 2023 08:54:12 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4P1LPJ1zJxz3hLy; Tue, 24 Jan 2023 08:54:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674550452; 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=l5p/PP3+yH9aL3rjUtXEBjRC8YnVqZYH0wYOUikSV/g=; b=KuT4SA9fpNW+6vzBcI1ljYzah/oyCXUrGx3bs7O39ptCx92m0xGelNAKctLKDQIYAhceYj q2XIJYW6C/kK6jFy8R09IWZgL2Oqkvf+asGevRfk9FNr/TfBf4X0UsWtKWlPSVIAbStkGA QctoMBRKYwJupXza25yVzwTGIG5NW//YsmI8tdF0JmFFyLU259qrCb8j+3Cncz46hveM9d KQccIYaSVyLIDMI/Era+n9tBax4zHeJhlzgSh3D4UdJkjOpyh3t2KSYm7ohhcG/h8nroxM /Y/akVcYu5IzERwF1m+a97h0ryOq9SVSG23nlUul0e2PTo5EgDwfZsD/4gmpAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674550452; 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=l5p/PP3+yH9aL3rjUtXEBjRC8YnVqZYH0wYOUikSV/g=; b=wjOkdcpxqvPcmgMfF6b0RRdSWOd3QKHx5BVo00KkKPQ29ZQtBpjMN7wBcv21Qkg/KBu6Jl NWRNiCTaTviU9MXO8FYgebZLXIYEjcqj6Z2TR+sXJ+JJGP86DOqUjTCAvKetBcgZ/LTKR1 E9NgEz6cQ6iAJBoVe3NqpvmmEzk2RxSVY/XX69zBoHaV0SGBUBJPoZT8W+MY0V/biT3iI8 c3FiPdDF7cagEpn7QKbvNO9Icqt3cLl/OeE/uCq1shfSCpzAlFJl9YNxxmVDPC4WAZKnIf 3XWnebTtj56VHOT/+YlyWoA6Br3SCb1Z5HChCXKF99eQln7iZvEu7N1ynxyKkQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674550452; a=rsa-sha256; cv=none; b=muabTqViAFZuN8vKJYjL5tMEEh3WzW7jk+9OpAxrE41wws0NZLOvzaFwRisZK5nRmvsw2k GG9kj3gJygVnxQoPU642P4idix6fuo521Lq/L+zp1TEgpWE9xEgHoVnkgTLEPEWPmQaVXj AVziZKkgF/VqLGUuWa2sEMp2D1OpssgTmRXPeIGRDQe49ELTYLv6fiFdpZRc7EqJRt11dq dm+Z2My3fzIjhhFVSqVOOJdtMUKmCNdEpKRhHk+GcMW/GmjVjzd415oPn2N2z+UcPIR8LF x0OO3onjq0H3a6uMhfVIcnebR8ovdh00YCM7t7tch20X2OIgU98EhX8MzZhvQg== 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 4P1LPJ0wd6z13MD; Tue, 24 Jan 2023 08:54:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30O8sCGL036180; Tue, 24 Jan 2023 08:54:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30O8sCHx036179; Tue, 24 Jan 2023 08:54:12 GMT (envelope-from git) Date: Tue, 24 Jan 2023 08:54:12 GMT Message-Id: <202301240854.30O8sCHx036179@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Emmanuel Vadot Subject: git: fe5b301ed2e8 - stable/13 - linuxkpi: Add `PCIE_SPEED_{32,64}_0GT` PCI-E bus speed constants 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: fe5b301ed2e8ea376d298f3adf60df822ee5df86 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=fe5b301ed2e8ea376d298f3adf60df822ee5df86 commit fe5b301ed2e8ea376d298f3adf60df822ee5df86 Author: Jean-Sébastien Pédron AuthorDate: 2022-12-01 14:00:54 +0000 Commit: Emmanuel Vadot CommitDate: 2023-01-24 09:08:01 +0000 linuxkpi: Add `PCIE_SPEED_{32,64}_0GT` PCI-E bus speed constants This change is a requirement to update our DRM drivers to Linux 5.12. Differential Revision: https://reviews.freebsd.org/D37363 (cherry picked from commit 0adc02a97989f0a396740ffb64314fe8e816c877) --- sys/compat/linuxkpi/common/include/linux/pci.h | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/pci.h b/sys/compat/linuxkpi/common/include/linux/pci.h index a271bc6a1360..8d41e33b0da8 100644 --- a/sys/compat/linuxkpi/common/include/linux/pci.h +++ b/sys/compat/linuxkpi/common/include/linux/pci.h @@ -147,19 +147,24 @@ MODULE_PNP_INFO("U32:vendor;U32:device;V32:subvendor;V32:subdevice", \ #define PCI_EXP_TYPE_RC_EC PCIEM_TYPE_ROOT_EC /* Root Complex Event Collector */ #define PCI_EXP_LNKCAP_SLS_2_5GB 0x01 /* Supported Link Speed 2.5GT/s */ #define PCI_EXP_LNKCAP_SLS_5_0GB 0x02 /* Supported Link Speed 5.0GT/s */ -#define PCI_EXP_LNKCAP_SLS_8_0GB 0x04 /* Supported Link Speed 8.0GT/s */ -#define PCI_EXP_LNKCAP_SLS_16_0GB 0x08 /* Supported Link Speed 16.0GT/s */ +#define PCI_EXP_LNKCAP_SLS_8_0GB 0x03 /* Supported Link Speed 8.0GT/s */ +#define PCI_EXP_LNKCAP_SLS_16_0GB 0x04 /* Supported Link Speed 16.0GT/s */ +#define PCI_EXP_LNKCAP_SLS_32_0GB 0x05 /* Supported Link Speed 32.0GT/s */ +#define PCI_EXP_LNKCAP_SLS_64_0GB 0x06 /* Supported Link Speed 64.0GT/s */ #define PCI_EXP_LNKCAP_MLW 0x03f0 /* Maximum Link Width */ #define PCI_EXP_LNKCAP2_SLS_2_5GB 0x02 /* Supported Link Speed 2.5GT/s */ #define PCI_EXP_LNKCAP2_SLS_5_0GB 0x04 /* Supported Link Speed 5.0GT/s */ #define PCI_EXP_LNKCAP2_SLS_8_0GB 0x08 /* Supported Link Speed 8.0GT/s */ #define PCI_EXP_LNKCAP2_SLS_16_0GB 0x10 /* Supported Link Speed 16.0GT/s */ +#define PCI_EXP_LNKCAP2_SLS_32_0GB 0x20 /* Supported Link Speed 32.0GT/s */ +#define PCI_EXP_LNKCAP2_SLS_64_0GB 0x40 /* Supported Link Speed 64.0GT/s */ #define PCI_EXP_LNKCTL2_TLS 0x000f #define PCI_EXP_LNKCTL2_TLS_2_5GT 0x0001 /* Supported Speed 2.5GT/s */ #define PCI_EXP_LNKCTL2_TLS_5_0GT 0x0002 /* Supported Speed 5GT/s */ #define PCI_EXP_LNKCTL2_TLS_8_0GT 0x0003 /* Supported Speed 8GT/s */ #define PCI_EXP_LNKCTL2_TLS_16_0GT 0x0004 /* Supported Speed 16GT/s */ #define PCI_EXP_LNKCTL2_TLS_32_0GT 0x0005 /* Supported Speed 32GT/s */ +#define PCI_EXP_LNKCTL2_TLS_64_0GT 0x0006 /* Supported Speed 64GT/s */ #define PCI_EXP_LNKCTL2_ENTER_COMP 0x0010 /* Enter Compliance */ #define PCI_EXP_LNKCTL2_TX_MARGIN 0x0380 /* Transmit Margin */ @@ -181,6 +186,8 @@ enum pci_bus_speed { PCIE_SPEED_5_0GT, PCIE_SPEED_8_0GT, PCIE_SPEED_16_0GT, + PCIE_SPEED_32_0GT, + PCIE_SPEED_64_0GT, }; enum pcie_link_width { @@ -1270,6 +1277,10 @@ pcie_get_speed_cap(struct pci_dev *dev) return (PCIE_SPEED_8_0GT); if (lnkcap2 & PCI_EXP_LNKCAP2_SLS_16_0GB) return (PCIE_SPEED_16_0GT); + if (lnkcap2 & PCI_EXP_LNKCAP2_SLS_32_0GB) + return (PCIE_SPEED_32_0GT); + if (lnkcap2 & PCI_EXP_LNKCAP2_SLS_64_0GB) + return (PCIE_SPEED_64_0GT); } else { /* pre-r3.0 */ lnkcap = pci_read_config(root, pos + PCIER_LINK_CAP, 4); if (lnkcap & PCI_EXP_LNKCAP_SLS_2_5GB) @@ -1280,6 +1291,10 @@ pcie_get_speed_cap(struct pci_dev *dev) return (PCIE_SPEED_8_0GT); if (lnkcap & PCI_EXP_LNKCAP_SLS_16_0GB) return (PCIE_SPEED_16_0GT); + if (lnkcap & PCI_EXP_LNKCAP_SLS_32_0GB) + return (PCIE_SPEED_32_0GT); + if (lnkcap & PCI_EXP_LNKCAP_SLS_64_0GB) + return (PCIE_SPEED_64_0GT); } return (PCI_SPEED_UNKNOWN); } @@ -1307,6 +1322,10 @@ PCIE_SPEED2MBS_ENC(enum pci_bus_speed spd) { switch(spd) { + case PCIE_SPEED_64_0GT: + return (64000 * 128 / 130); + case PCIE_SPEED_32_0GT: + return (32000 * 128 / 130); case PCIE_SPEED_16_0GT: return (16000 * 128 / 130); case PCIE_SPEED_8_0GT: