From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mx.groups.io with SMTP id smtpd.web12.5161.1572621011267459384 for ; Fri, 01 Nov 2019 08:10:11 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.126, mailfrom: ashraf.javeed@intel.com) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Nov 2019 08:10:01 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.68,256,1569308400"; d="scan'208";a="194686890" Received: from pidsbabios005.gar.corp.intel.com ([10.223.9.183]) by orsmga008.jf.intel.com with ESMTP; 01 Nov 2019 08:09:59 -0700 From: "Javeed, Ashraf" To: devel@edk2.groups.io Cc: Jian J Wang , Hao A Wu , Ray Ni Subject: [edk2-staging/UEFI_PCI_ENHANCE-2 PATCH 00/12] New PCI features - MPS, MRRS, RO, NS, CTO Date: Fri, 1 Nov 2019 20:39:40 +0530 Message-Id: <20191101150952.3340-1-ashraf.javeed@intel.com> X-Mailer: git-send-email 2.21.0.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable The EDK2 Kernel PciBusDxe driver is enhanced to enable the configuration=0D of PCI features like=0D (1) Max_Payload_Size=0D (2) Max_Read_Req_Size=0D (3) Relax Ordering=0D (4) No-Snoop=0D (5) Completion Timeout=0D =0D Max_Payload_Size:- The PCI Device Control register provides this feature=0D register field which controls the maximum data packet (TLP) size that a=0D PCI device should maintain as a requester. The PCI Bus driver is required=0D to maintain a highest common value supported by all the PCI devices in a=0D PCIe hierarchy, especially in case of isochronous applications.=0D =0D Max_Read_Req_Size:- The PCI Device Control register provides this feature=0D register field which controls the maximum memory read request size that a=0D PCI device should maintain as a requester. The PCI Bus driver is required=0D to maintain a common value, same as Max_Payload_Size, in case of=0D isochronous applications only; or else, it should maintain the user=0D requested value uniformly in a PCIe hierarchy (PCI root port and its=0D downstream devices).=0D =0D Relax Ordering:- The PCI Device Control register has the enabling of=0D Relax Ordering functionality register field (bit 4). If this bit is Set,=0D the PCI Function is permitted to set the Relaxed Ordering bit in the=0D Attributes field of transactions it initiates that do not require strong=0D write ordering (see PCI Base Specification 4, Section 2.2.6.4 and Sect-=0D ion 2.4). Any supporting PCI function is expected have this bit enabled=0D by as per its hardware default; the code enhancement is to enable / dis-=0D able as per the PCI device policy provided by the platform firmware. If=0D no device policy override is provided than it shall be ignored by the PCI=0D Bus driver for that PCI function.=0D =0D No-Snoop:- The PCI Device Control register has the enabling of No-Snoop=0D functionality register field (bit 11). If this bit is Set, the PCI=0D Function is permitted to Set the No Snoop bit in the Requester Attributes=0D of transactions it initiates that do not require hardware enforced cache=0D coherency (see PCI Base Specification 4, Section 2.2.6.5). Any supporting=0D PCI function is expected have this bit enabled by as per its hardware=0D default; the code enhancement is to enable / disable as per the PCI=0D device policy provided by the platform firmware. If no device policy=0D override is provided than it shall be ignored by the PCI Bus driver for=0D that PCI function.=0D =0D Completion Timeout:- The PCI Device Control 2 register provides two=0D register fields based on its Device Capability 2 register; the CTO Ranges=0D (bits [3:0]) and the disabling of CTO detection mechanism (bit 4). The=0D software is permitted to change the CTO ranges and enable/disable the CTO=0D detection mechanism any time. The code enhancement here is to override=0D these register fields as per the platform device policy. If no device=0D policy override is provided than it shall be ignored by the PCI Bus=0D driver for that PCI function.=0D =0D The PCI Base Specification 4 Revision 1 contains detailed information=0D about these features. The EDK2 PCI Bus driver needs to enable the=0D configuration of these features as per the PCI Base specification.=0D =0D The EDK2 PCI Bus driver also needs to take the PCI device-specific=0D platform policy into the consideration while programming these features;=0D thus the code changes to support these, is explicitly dependent on the=0D new PCI Platform Protocol interface definition defined in the below=0D record:-=0D https://bugzilla.tianocore.org/show_bug.cgi?id=3D1954=0D =0D =0D Signed-off-by: Ashraf Javeed =0D Cc: Jian J Wang =0D Cc: Hao A Wu =0D Cc: Ray Ni =0D --- Ashraf Javeed (12): MdeModulePkg/PciBusDxe:New PCI features separation with PCD PciBusDxe: Reorganize the PCI Platform Protocol usage code PciBusDxe: Separation of the PCI device registration and start PciBusDxe: Inclusion of new PCI Platform Protocol 2 PciBusDxe: Setup sub-phases for PCI feature enumeration PciBusDxe: Integration of setup for PCI feature enumeration PciBusDxe: Record the PCI-Express Capability Structure PciBusDxe: New PCI feature Max_Payload_Size PciBusDxe: New PCI feature Max_Read_Req_Size PciBusDxe: New PCI feature Relax Ordering PciBusDxe: New PCI feature No-Snoop PciBusDxe: New PCI feature Completion Timeout MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.c | 23 +---------- MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.h | 20 ++++++++-- MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf | 9 ++++- MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c | 233 +++++++++++++= +++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------= -------------------- MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumerator.c | 139 +++++++++++++= +++------------------------------------------------- MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c | 34 ++++++++++---= --- MdeModulePkg/Bus/Pci/PciBusDxe/PciFeatureSupport.c | 2030 +++++++++++++= +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= ++++++++++++++++++++++++ MdeModulePkg/Bus/Pci/PciBusDxe/PciFeatureSupport.h | 223 +++++++++++++= +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= +++++++++++++++ MdeModulePkg/Bus/Pci/PciBusDxe/PciPlatformSupport.c | 749 +++++++++++++= +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= +++++++++++++++++++++++++++++++++ MdeModulePkg/Bus/Pci/PciBusDxe/PciPlatformSupport.h | 191 +++++++++++++= ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ MdeModulePkg/Bus/Pci/PciBusDxe/PciResourceSupport.c | 15 +------ MdeModulePkg/MdeModulePkg.dec | 22 +++++++++++ 12 files changed, 3450 insertions(+), 238 deletions(-) create mode 100644 MdeModulePkg/Bus/Pci/PciBusDxe/PciFeatureSupport.c create mode 100644 MdeModulePkg/Bus/Pci/PciBusDxe/PciFeatureSupport.h create mode 100644 MdeModulePkg/Bus/Pci/PciBusDxe/PciPlatformSupport.c create mode 100644 MdeModulePkg/Bus/Pci/PciBusDxe/PciPlatformSupport.h --=20 2.21.0.windows.1