]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdePkg/PciExpress21.h: Fix the PCI industry standard register defines
authorJaveed, Ashraf <ashraf.javeed@intel.com>
Mon, 29 Jul 2019 03:51:23 +0000 (11:51 +0800)
committerLiming Gao <liming.gao@intel.com>
Wed, 31 Jul 2019 06:58:39 +0000 (14:58 +0800)
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2007
The following two PCI Capability Structure registers are updated as per
the PCI Base Specification Revision 4:-
(1) The PCI Device capability register 2(PCI_REG_PCIE_DEVICE_CAPABILITY2)
    needs to be upgraded for the PCI features like -
    LN system CLS (LnSystemCLS),
    10b Tag completer/requester register fields
    (TenBitTagCompleterSupported, TenBitTagRequesterSupported),
    Emergency power reduction support and initialization requirement
    (EmergencyPowerReductionSupported,
     EmergencyPowerReductionInitializationRequired),
    and FRS support (FrsSupported ).

(2) The PCI Device Control register 2(PCI_REG_PCIE_DEVICE_CONTROL2) needs
    to be upgraded for the -
    Emergency power reduction request enabling
    (EmergencyPowerReductionRequest), and also the 10b Extended Tag
    enabling (TenBitTagRequesterEnable).

The following two are defined as per the PCI Express Base Specification
Revision 2.1:-
(1) Defined macro definitions for all the ranges of Maximum Payload Sizes
    and Maximum Read Request Sizes register fields

(2) Defined macro definitions for all the ranges of Completion Timeout
    value.

Signed-off-by: Ashraf Javeed <ashraf.javeed@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
MdePkg/Include/IndustryStandard/PciExpress21.h

index d4003de74cca9a165e0c2cfc195115799e2e2124..f17f570775536402ae8558ce3d03b37d0d28b924 100644 (file)
@@ -91,6 +91,24 @@ typedef union {
   UINT16   Uint16;\r
 } PCI_REG_PCIE_DEVICE_CONTROL;\r
 \r
+#define PCIE_MAX_PAYLOAD_SIZE_128B   0\r
+#define PCIE_MAX_PAYLOAD_SIZE_256B   1\r
+#define PCIE_MAX_PAYLOAD_SIZE_512B   2\r
+#define PCIE_MAX_PAYLOAD_SIZE_1024B  3\r
+#define PCIE_MAX_PAYLOAD_SIZE_2048B  4\r
+#define PCIE_MAX_PAYLOAD_SIZE_4096B  5\r
+#define PCIE_MAX_PAYLOAD_SIZE_RVSD1  6\r
+#define PCIE_MAX_PAYLOAD_SIZE_RVSD2  7\r
+\r
+#define PCIE_MAX_READ_REQ_SIZE_128B    0\r
+#define PCIE_MAX_READ_REQ_SIZE_256B    1\r
+#define PCIE_MAX_READ_REQ_SIZE_512B    2\r
+#define PCIE_MAX_READ_REQ_SIZE_1024B   3\r
+#define PCIE_MAX_READ_REQ_SIZE_2048B   4\r
+#define PCIE_MAX_READ_REQ_SIZE_4096B   5\r
+#define PCIE_MAX_READ_REQ_SIZE_RVSD1   6\r
+#define PCIE_MAX_READ_REQ_SIZE_RVSD2   7\r
+\r
 typedef union {\r
   struct {\r
     UINT16 CorrectableError : 1;\r
@@ -250,16 +268,30 @@ typedef union {
     UINT32 NoRoEnabledPrPrPassing : 1;\r
     UINT32 LtrMechanism : 1;\r
     UINT32 TphCompleter : 2;\r
-    UINT32 Reserved : 4;\r
+    UINT32 LnSystemCLS : 2;\r
+    UINT32 TenBitTagCompleterSupported : 1;\r
+    UINT32 TenBitTagRequesterSupported : 1;\r
     UINT32 Obff : 2;\r
     UINT32 ExtendedFmtField : 1;\r
     UINT32 EndEndTlpPrefix : 1;\r
     UINT32 MaxEndEndTlpPrefixes : 2;\r
-    UINT32 Reserved2 : 8;\r
+    UINT32 EmergencyPowerReductionSupported : 2;\r
+    UINT32 EmergencyPowerReductionInitializationRequired : 1;\r
+    UINT32 Reserved3 : 4;\r
+    UINT32 FrsSupported : 1;\r
   } Bits;\r
   UINT32   Uint32;\r
 } PCI_REG_PCIE_DEVICE_CAPABILITY2;\r
 \r
+#define PCIE_COMPLETION_TIMEOUT_NOT_SUPPORTED           0\r
+#define PCIE_COMPLETION_TIMEOUT_RANGE_A_SUPPORTED       1\r
+#define PCIE_COMPLETION_TIMEOUT_RANGE_B_SUPPORTED       2\r
+#define PCIE_COMPLETION_TIMEOUT_RANGE_A_B_SUPPORTED     3\r
+#define PCIE_COMPLETION_TIMEOUT_RANGE_B_C_SUPPORTED     6\r
+#define PCIE_COMPLETION_TIMEOUT_RANGE_A_B_C_SUPPORTED   7\r
+#define PCIE_COMPLETION_TIMEOUT_RANGE_B_C_D_SUPPORTED   14\r
+#define PCIE_COMPLETION_TIMEOUT_RANGE_A_B_C_D_SUPPORTED 15\r
+\r
 #define PCIE_DEVICE_CAPABILITY_OBFF_MESSAGE BIT0\r
 #define PCIE_DEVICE_CAPABILITY_OBFF_WAKE    BIT1\r
 \r
@@ -273,7 +305,8 @@ typedef union {
     UINT16 IdoRequest : 1;\r
     UINT16 IdoCompletion : 1;\r
     UINT16 LtrMechanism : 2;\r
-    UINT16 Reserved : 2;\r
+    UINT16 EmergencyPowerReductionRequest : 1;\r
+    UINT16 TenBitTagRequesterEnable : 1;\r
     UINT16 Obff : 2;\r
     UINT16 EndEndTlpPrefixBlocking : 1;\r
   } Bits;\r