From nobody Mon Feb 9 02:51:12 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+49805+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+49805+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1572621013; cv=none; d=zoho.com; s=zohoarc; b=aPvZ1rtSLxBiXjv8n3uTNtX3jv1iMGd9hmmjS5935sq9zieNCjPdW6cpE9kfvhLq/EnN7sCFaVJ/jabFmmGk3z0PoBUyBX6tja8UIc9BD+bMWZ0v4jVkrZL1ZzgGQI+lMybMHPdEDyhOL0jCF5LYuUEG1ekD8ykdEKw/cCHYdkg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1572621013; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=8MA5dEA8I5wiRN1ciU9DiHtuTEBBnOJk89PdBmx8m9o=; b=P7Tr1fX4ktgnRfsFurJz8lo/G0fuyhCv80OGpqa1/4PmfqDx4sR9ioVgM2zEs5pDFpmoodmCAM1omOA+Cha4OdW8FdTPzCcAcdZOQHsYQmK2N5/wv9i1AYtpFwBNsHCuYu5pAaWW5YtkJARhM9XHp9WsUUwmGf2x1D4UhDen3uY= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+49805+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1572621013453239.6593190888501; Fri, 1 Nov 2019 08:10:13 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id aaaaYY1788612xaaaaaaaaaa; Fri, 01 Nov 2019 08:10:12 -0700 X-Received: from mga18.intel.com (mga18.intel.com []) by mx.groups.io with SMTP id smtpd.web12.5161.1572621011267459384 for ; Fri, 01 Nov 2019 08:10:11 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-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:04 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.68,256,1569308400"; d="scan'208";a="194686957" X-Received: from pidsbabios005.gar.corp.intel.com ([10.223.9.183]) by orsmga008.jf.intel.com with ESMTP; 01 Nov 2019 08:10:02 -0700 From: "Javeed, Ashraf" To: devel@edk2.groups.io Cc: Jian J Wang , Hao A Wu , Ray Ni Subject: [edk2-devel] [edk2-staging/UEFI_PCI_ENHANCE-2 PATCH 01/12] MdeModulePkg/PciBusDxe:New PCI features separation with PCD Date: Fri, 1 Nov 2019 20:39:41 +0530 Message-Id: <20191101150952.3340-2-ashraf.javeed@intel.com> In-Reply-To: <20191101150952.3340-1-ashraf.javeed@intel.com> References: <20191101150952.3340-1-ashraf.javeed@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,ashraf.javeed@intel.com X-Gm-Message-State: aaaaaaaaaaaaaaaaaaaaaaaax1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1572621012; bh=RyHOux6QsgbObHyheDGQjx0hzYpmz9Ugvs1a9YTKTP8=; h=Cc:Date:From:Reply-To:Subject:To; b=EnlbKV2/X1JqzqPoOw+oib3A3sM2TwOy3LjZ3BYUyUUjJ+WxGx+WsP7AN4CMNFiShwn BGOREWqCuGDLtkxyawmYxAALfHq7Ok0+8x/UMkqnwAPLmJWAdli7+hSeUkAfR7EwvcKQ6 RGO3/Ytf98px6WsWJ/c3z7DCtatV7vlatZs= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2194 Definition of bit masks for the new PCD for the following new PCI feature set:- 1. Maximum Payload Size (MPS) 2. Maximum Read Request Size (MRRS) 3. Completion Timeout (CTO) 4. Relax Order (RO) Enable 5. No Snoop (NS) Enable 6. Extended Tag 7. ASPM support 8. Common Clock Configuration 9. Extended SYNC 10. Atomic Op 11. LTR Enable 12. PTM support Code changes made to the PCI Bus driver to adopt to these new PCD defini- tion, helper routines defined for features that needs to be supported in. future. Signed-off-by: Ashraf Javeed Cc: Jian J Wang Cc: Hao A Wu Cc: Ray Ni --- MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf | 5 ++++- MdeModulePkg/Bus/Pci/PciBusDxe/PciFeatureSupport.c | 177 +++++++++++++++++= +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= ++++++++++ MdeModulePkg/Bus/Pci/PciBusDxe/PciFeatureSupport.h | 26 +++++++++++++++++= +++++++++ MdeModulePkg/MdeModulePkg.dec | 22 +++++++++++++++++= +++++ 4 files changed, 229 insertions(+), 1 deletion(-) diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf b/MdeModulePkg/Bu= s/Pci/PciBusDxe/PciBusDxe.inf index 05c2202..6dab970 100644 --- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf +++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf @@ -2,7 +2,7 @@ # The PCI bus driver will probe all PCI devices and allocate MMIO and IO = space for these devices. # Please use PCD feature flag PcdPciBusHotplugDeviceSupport to enable hot= plug supporting. # -# Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
+# Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.
# # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -57,6 +57,8 @@ PciCommand.h PciIo.h PciBus.h + PciFeatureSupport.c + PciFeatureSupport.h =20 [Packages] MdePkg/MdePkg.dec @@ -104,6 +106,7 @@ gEfiMdeModulePkgTokenSpaceGuid.PcdAriSupport ## CONSUMES gEfiMdeModulePkgTokenSpaceGuid.PcdMrIovSupport ## CONSUMES gEfiMdeModulePkgTokenSpaceGuid.PcdPciDisableBusEnumeration ## SOMETIM= ES_CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdOtherPciFeatures ## CONSUMES =20 [UserExtensions.TianoCore."ExtraFiles"] PciBusDxeExtra.uni diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciFeatureSupport.c b/MdeModule= Pkg/Bus/Pci/PciBusDxe/PciFeatureSupport.c new file mode 100644 index 0000000..8be227a --- /dev/null +++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciFeatureSupport.c @@ -0,0 +1,177 @@ +/** @file + PCI standard feature support functions implementation for PCI Bus module= .. + +Copyright (c) 2019, Intel Corporation. All rights reserved.
+SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include "PciBus.h" +#include "PciFeatureSupport.h" + +/** + Main routine to indicate whether the platform has selected the Max_Paylo= ad_Size + PCI feature to be configured by this driver + + @retval TRUE platform has selected the Max_Payload_Size to be configu= red + FALSE platform has not selected this feature +**/ +BOOLEAN +SetupMaxPayloadSize ( + ) +{ + return (PcdGet32 (PcdOtherPciFeatures) & PCI_FEATURE_SUPPORT_FLAG_MPS) ?= TRUE : FALSE; +} + +/** + Main routine to indicate whether the platform has selected the Max_Read_= Req_Size + PCI feature to be configured by this driver + + @retval TRUE platform has selected the Max_Read_Req_Size to be config= ured + FALSE platform has not selected this feature +**/ +BOOLEAN +SetupMaxReadReqSize ( + ) +{ + return (PcdGet32 (PcdOtherPciFeatures) & PCI_FEATURE_SUPPORT_FLAG_MRRS) = ? TRUE : FALSE; +} + +/** + Main routine to indicate whether the platform has selected the Relax Ord= ering + PCI feature to be configured by this driver + + @retval TRUE platform has selected the Relax Ordering to be configured + FALSE platform has not selected this feature +**/ +BOOLEAN +SetupRelaxOrder ( + ) +{ + return (PcdGet32 (PcdOtherPciFeatures) & PCI_FEATURE_SUPPORT_FLAG_RO) ? = TRUE : FALSE; +} + +/** + Main routine to indicate whether the platform has selected the No-Snoop + PCI feature to be configured by this driver + + @retval TRUE platform has selected the No-Snoop to be configured + FALSE platform has not selected this feature +**/ +BOOLEAN +SetupNoSnoop ( + ) +{ + return (PcdGet32 (PcdOtherPciFeatures) & PCI_FEATURE_SUPPORT_FLAG_NS) ? = TRUE : FALSE; +} + +/** + Main routine to indicate whether the platform has selected the Completio= n Timeout + PCI feature to be configured by this driver + + @retval TRUE platform has selected the Completion Timeout to be confi= gured + FALSE platform has not selected this feature +**/ +BOOLEAN +SetupCompletionTimeout ( + ) +{ + return (PcdGet32 (PcdOtherPciFeatures) & PCI_FEATURE_SUPPORT_FLAG_CTO) ?= TRUE : FALSE; +} + +/** + Main routine to indicate whether the platform has selected the Extended = Tag + PCI feature to be configured by this driver + + @retval TRUE platform has selected the Completion Timeout to be confi= gured + FALSE platform has not selected this feature +**/ +BOOLEAN +SetupExtendedTag ( + ) +{ + return (PcdGet32 (PcdOtherPciFeatures) & PCI_FEATURE_SUPPORT_FLAG_ETAG) = ? TRUE : FALSE; +} + +/** + Main routine to indicate whether the platform has selected the Atomic Op + PCI feature to be configured by this driver + + @retval TRUE platform has selected the Completion Timeout to be confi= gured + FALSE platform has not selected this feature +**/ +BOOLEAN +SetupAtomicOp ( + ) +{ + return (PcdGet32 (PcdOtherPciFeatures) & PCI_FEATURE_SUPPORT_FLAG_AOP) ?= TRUE : FALSE; +} +/** + Main routine to indicate whether the platform has selected the LTR + PCI feature to be configured by this driver + + @retval TRUE platform has selected the Completion Timeout to be confi= gured + FALSE platform has not selected this feature +**/ +BOOLEAN +SetupLtr ( + ) +{ + return (PcdGet32 (PcdOtherPciFeatures) & PCI_FEATURE_SUPPORT_FLAG_LTR) ?= TRUE : FALSE; +} + +/** + Main routine to indicate whether the platform has selected the ASPM state + PCI feature to be configured by this driver + + @retval TRUE platform has selected the Completion Timeout to be confi= gured + FALSE platform has not selected this feature +**/ +BOOLEAN +SetupAspm ( + ) +{ + return (PcdGet32 (PcdOtherPciFeatures) & PCI_FEATURE_SUPPORT_FLAG_ASPM) = ? TRUE : FALSE; +} + +/** + Main routine to indicate whether the platform has selected the Common Cl= ock Configuration + PCI feature to be configured by this driver + + @retval TRUE platform has selected the Completion Timeout to be confi= gured + FALSE platform has not selected this feature +**/ +BOOLEAN +SetupCommonClkCfg ( + ) +{ + return (PcdGet32 (PcdOtherPciFeatures) & PCI_FEATURE_SUPPORT_FLAG_CCC) ?= TRUE : FALSE; +} + +/** + Main routine to indicate whether the platform has selected the Extended = Synch + PCI feature to be configured by this driver + + @retval TRUE platform has selected the Completion Timeout to be confi= gured + FALSE platform has not selected this feature +**/ +BOOLEAN +SetupExtendedSynch ( + ) +{ + return (PcdGet32 (PcdOtherPciFeatures) & PCI_FEATURE_SUPPORT_FLAG_ESYN) = ? TRUE : FALSE; +} + +/** + Main routine to indicate whether the platform has selected the PIM Contr= ol + PCI feature to be configured by this driver + + @retval TRUE platform has selected the Completion Timeout to be confi= gured + FALSE platform has not selected this feature +**/ +BOOLEAN +SetupPtm ( + ) +{ + return (PcdGet32 (PcdOtherPciFeatures) & PCI_FEATURE_SUPPORT_FLAG_PTM) ?= TRUE : FALSE; +} diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciFeatureSupport.h b/MdeModule= Pkg/Bus/Pci/PciBusDxe/PciFeatureSupport.h new file mode 100644 index 0000000..d06a5e8 --- /dev/null +++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciFeatureSupport.h @@ -0,0 +1,26 @@ +/** @file + PCI standard feature support functions implementation for PCI Bus module= .. + +Copyright (c) 2019, Intel Corporation. All rights reserved.
+SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#ifndef _EFI_PCI_FEATURES_SUPPORT_H_ +#define _EFI_PCI_FEATURES_SUPPORT_H_ +// +// Macro definitions for the PCI Features support PCD +// +#define PCI_FEATURE_SUPPORT_FLAG_MPS BIT0 +#define PCI_FEATURE_SUPPORT_FLAG_MRRS BIT1 +#define PCI_FEATURE_SUPPORT_FLAG_RO BIT2 +#define PCI_FEATURE_SUPPORT_FLAG_NS BIT3 +#define PCI_FEATURE_SUPPORT_FLAG_CTO BIT4 +#define PCI_FEATURE_SUPPORT_FLAG_ETAG BIT5 +#define PCI_FEATURE_SUPPORT_FLAG_AOP BIT6 +#define PCI_FEATURE_SUPPORT_FLAG_LTR BIT7 +#define PCI_FEATURE_SUPPORT_FLAG_ASPM BIT12 +#define PCI_FEATURE_SUPPORT_FLAG_CCC BIT13 +#define PCI_FEATURE_SUPPORT_FLAG_ESYN BIT14 +#define PCI_FEATURE_SUPPORT_FLAG_PTM BIT20 +#endif diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec index 12e0bbf..ed82e85 100644 --- a/MdeModulePkg/MdeModulePkg.dec +++ b/MdeModulePkg/MdeModulePkg.dec @@ -1036,6 +1036,28 @@ # @Prompt Enable UEFI Stack Guard. gEfiMdeModulePkgTokenSpaceGuid.PcdCpuStackGuard|FALSE|BOOLEAN|0x30001055 =20 + ## This PCD is to indicate the PCI Bus driver to setup other new PCI fea= tures. + # Each PCI feature is represented by its mask bit position and it confi= gures + # if that bit is set. + # + # Bit 0 - if set, the PCI Bus driver programs the device's Max_Payload= _Size.
+ # Bit 1 - if set, the PCI Bus driver programs the device's Max_Read_Re= q_Size.
+ # Bit 2 - if set, the PCI Bus driver programs the device's Relax Order= ing state.
+ # Bit 3 - if set, the PCI Bus driver programs the device's No-Snoop st= ate.
+ # Bit 4 - if set, the PCI Bus driver programs the device's Completion = Timeout range.
+ # Bit 5 - if set, the PCI Bus driver programs the device's Extended Ta= g range.
+ # Bit 6 - if set, the PCI Bus driver programs the device's AtomicOp fe= ature.
+ # Bit 7 - if set, the PCI Bus driver programs the device's LTR feature= .
+ # Bit 8 to 11 - Reserved for future use by the PCI Bus driver.
+ # Bit 12 - if set, the PCI Bus driver programs the PCIe link ASPM stat= e.
+ # Bit 13 - if set, the PCI Bus driver programs the PCIe link Common Cl= ock Configuration.
+ # Bit 14 - if set, the PCI Bus driver programs the PCIe link Extended = Synch state.
+ # Bit 15 to 19 - Reserved for future use by the PCI Bus driver.
+ # Bit 20 - if set, the PCI Bus driver programs the device's PTM featur= e.
+ # Bit 21 to 31 - Reserved for future use by the PCI Bus driver.
+ # @Prompt The UEFI PCI Bus driver enables the new set of other PCI Featu= res. + gEfiMdeModulePkgTokenSpaceGuid.PcdOtherPciFeatures|0x001070FF|UINT32|0x3= 0001056 + [PcdsFixedAtBuild, PcdsPatchableInModule] ## Dynamic type PCD can be registered callback function for Pcd setting = action. # PcdMaxPeiPcdCallBackNumberPerPcdEntry indicates the maximum number of= callback function --=20 2.21.0.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#49805): https://edk2.groups.io/g/devel/message/49805 Mute This Topic: https://groups.io/mt/40419681/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-