From nobody Thu Dec 01 14:04:42 2022 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 4NNHrW1r9xz4jHpG; Thu, 1 Dec 2022 14:04:43 +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 4NNHrV6vcjz3p30; Thu, 1 Dec 2022 14:04:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1669903483; 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=5xCAK+wZ1AeB4+TL5WX0RbyaedWQFyDe0Gy3FPGEe7w=; b=TR2N9Sq8dbVqBZxD04+WIaQC2oInvSsV8seuHRMlqPTjX3RyLSRMBibwsr800vkCsjlnGa dhiKoNU33ehwoww0LQeamuhvNmgGs6GuwYYOEz6xHK4BEyIQgd1Ead3JKEEK5N/f8ruEkZ K2aiUuH8/3LvCQKJur2XwoH5zuIMkQPFOtDE5zVR+ZZ8WTymCxurgyAGvOr6R5K3WHdNHb tXtu+QNVTk7GYw3aEd6htlyj/xIe6Tgb4C4VtSQ4Dx2WNTuea2Qv9LSic7TBz0WBErQNVf J7ctVtWK1ElHIwxomzw3LqSNnk0tgo0Lmfmqv0Ut3fxhIlJuYID55tkVdHi0Kg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1669903483; 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=5xCAK+wZ1AeB4+TL5WX0RbyaedWQFyDe0Gy3FPGEe7w=; b=oBSzoFHtkNOmiLRnru2knLGuEKfWMvHWZOcgvPSpIjYBftwzi6/K/wx6iy9Lh7LtkFAF5W 0seExGR7ykGfG7I9BNHt3dSUwbYWx98n8tD1QbulS+T8yb2DiaRGqxApG6sfMKr4BOGD+h slcFr6FI3tUm6w43DGT7ZS611JZNwTvhYWjhB2yyom9N6MOGUuBgVRR1fcZVZrYaMWenaY /6aPb6OkiSM9Ejg3CaF95sPexfetnas/RqtQg3/DNihRe2+9QtyfIv/EXXNYxJeFIKqq0E Qo0Dhurkfh3gs9RVetscLio5Ui2mHFOlyLZCoV4LRwFY7n8+BI3bWxgAHGkOXw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1669903483; a=rsa-sha256; cv=none; b=DNp8BpetkPoTZtb8WHZuUCLAHmhHtjpXePENGYIhp2E0DSUEPK3tD2Nw95DuFnK7WNuPIS Xy/dH5gIw67gHDqK0y/ULpnMeysz5zQtuwk34OJES2JAIKJ9AHB++bwX1Rd+b9bzd79HDC 8PIIWPS7HkSPiyKzgmvbL0J5fEfCs8wQixIUiq9qDhRiw0/h9NSl5YiAwU7Aj0/SjwUlpp qTlvGcT5P4uJRQxrV5xc1r37xOL0ED8XuFjtUSBkP+fuybvqMF41+C0QVqXGk1KMQ0jHvt ofQxN0d+sfNuyILq4s9U1ZbUPM+XI/Qq3jo9tHtE7+0VYx3uSUtWTFDroEBRag== 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 4NNHrV5lXZzfkg; Thu, 1 Dec 2022 14:04:42 +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 2B1E4gxC050771; Thu, 1 Dec 2022 14:04:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2B1E4gWX050770; Thu, 1 Dec 2022 14:04:42 GMT (envelope-from git) Date: Thu, 1 Dec 2022 14:04:42 GMT Message-Id: <202212011404.2B1E4gWX050770@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: 0adc02a97989 - main - 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/main X-Git-Reftype: branch X-Git-Commit: 0adc02a97989f0a396740ffb64314fe8e816c877 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=0adc02a97989f0a396740ffb64314fe8e816c877 commit 0adc02a97989f0a396740ffb64314fe8e816c877 Author: Jean-Sébastien Pédron AuthorDate: 2022-12-01 14:00:54 +0000 Commit: Emmanuel Vadot CommitDate: 2022-12-01 14:02:27 +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 --- 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 20f9b917fbdc..4b9f02497a59 100644 --- a/sys/compat/linuxkpi/common/include/linux/pci.h +++ b/sys/compat/linuxkpi/common/include/linux/pci.h @@ -145,19 +145,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 */ @@ -179,6 +184,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 { @@ -1248,6 +1255,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) @@ -1258,6 +1269,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); } @@ -1285,6 +1300,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: