From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga18.intel.com (mga18.intel.com []) by mx.groups.io with SMTP id smtpd.web12.5162.1572621016444543116 for ; Fri, 01 Nov 2019 08:10:18 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=fail (domain: intel.com, ip: , 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:17 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.68,256,1569308400"; d="scan'208";a="194687119" Received: from pidsbabios005.gar.corp.intel.com ([10.223.9.183]) by orsmga008.jf.intel.com with ESMTP; 01 Nov 2019 08:10:15 -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 06/12] PciBusDxe: Integration of setup for PCI feature enumeration Date: Fri, 1 Nov 2019 20:39:46 +0530 Message-Id: <20191101150952.3340-7-ashraf.javeed@intel.com> X-Mailer: git-send-email 2.21.0.windows.1 In-Reply-To: <20191101150952.3340-1-ashraf.javeed@intel.com> References: <20191101150952.3340-1-ashraf.javeed@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2194 The code changes are made to integrate the setup infrastructure for the PCI feature enumeration, in the last phase of the PCI Bus driver, after its registration and its option ROM loading phase is complete. Signed-off-by: Ashraf Javeed Cc: Jian J Wang Cc: Hao A Wu Cc: Ray Ni --- MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c | 11 +++++++++++ MdeModulePkg/Bus/Pci/PciBusDxe/PciFeatureSupport.c | 15 ++++++++++++++- MdeModulePkg/Bus/Pci/PciBusDxe/PciFeatureSupport.h | 11 +++++++++++ 3 files changed, 36 insertions(+), 1 deletion(-) diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c b/MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c index 33a0e94..b839102 100644 --- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c +++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c @@ -8,6 +8,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent **/ #include "PciBus.h" +#include "PciFeatureSupport.h" // // This device structure is serviced as a header. @@ -170,6 +171,8 @@ DestroyRootBridgeByHandle ( if (Temp->Handle == Controller) { + DestroyRootBridgePciFeaturesConfigCompletionList (Temp); + RemoveEntryList (CurrentLink); DestroyPciDeviceTree (Temp); @@ -818,6 +821,14 @@ StartPciDevicesOnBridge ( if (EFI_ERROR (Status) == EFI_NOT_FOUND) { return Status; } else { + if (CheckOtherPciFeaturesPcd ()) { + // + // the late configuration of PCI features + // + Status = EnumerateOtherPciFeatures ( + RootBridge + ); + } // // finally start those PCI bridge port devices only // diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciFeatureSupport.c b/MdeModulePkg/Bus/Pci/PciBusDxe/PciFeatureSupport.c index ab0e096..9e6671d 100644 --- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciFeatureSupport.c +++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciFeatureSupport.c @@ -25,6 +25,19 @@ PRIMARY_ROOT_PORT_NODE *mPrimaryRootPortList; **/ PCI_FEATURE_CONFIGURATION_COMPLETION_LIST *mPciFeaturesConfigurationCompletionList = NULL; +/** + Main routine to indicate platform selection of any of the other PCI features + to be configured by this driver + + @retval TRUE platform has selected the other PCI features to be configured + FALSE platform has not selected any of the other PCI features +**/ +BOOLEAN +CheckOtherPciFeaturesPcd ( + ) +{ + return PcdGet32 (PcdOtherPciFeatures) ? TRUE : FALSE; +} /** Main routine to indicate whether the platform has selected the Max_Payload_Size @@ -699,7 +712,7 @@ ProgramDevicePciFeatures ( IN PCI_IO_DEVICE *PciDevice ) { - EFI_STATUS Status; + EFI_STATUS Status = EFI_SUCCESS; return Status; } diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciFeatureSupport.h b/MdeModulePkg/Bus/Pci/PciBusDxe/PciFeatureSupport.h index b06c140..f92d008 100644 --- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciFeatureSupport.h +++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciFeatureSupport.h @@ -138,6 +138,17 @@ typedef enum { }PCI_FEATURE_CONFIGURATION_PHASE; +/** + Main routine to indicate platform selection of any of the other PCI features + to be configured by this driver + + @retval TRUE platform has selected the other PCI features to be configured + FALSE platform has not selected any of the other PCI features +**/ +BOOLEAN +CheckOtherPciFeaturesPcd ( + ); + /** Enumerate all the nodes of the specified root bridge or PCI-PCI Bridge, to configure the other PCI features. -- 2.21.0.windows.1