To skip loading an option rom for certain devices, can you use IncompatiblePciDevice->CheckDevice()? [Table Description automatically generated] For skipping enumerating a certain device, we could change PciBus to skip enumerating if gPciPlatformProtocol->PlatformPrepController() returns error status for that device. Do you think this solution is feasible to you? Thanks, Ray From: devel@edk2.groups.io On Behalf Of manickavasakam karpagavinayagam Sent: Friday, June 18, 2021 12:41 AM To: Kinney, Michael D ; devel@edk2.groups.io; gaoliming ; Ni, Ray Cc: DOPPALAPUDI, HARIKRISHNA Subject: Re: [EXTERNAL] 回复: [edk2-devel] [edk2-platforms] [PATCH V1 0/2] Support for TiogaPass Platform and Override generic PciBus Driver with Mike : During PCI Bus enumeration, we need to skip SPI Controller (because of a silicon sighting) or else any SET variable asserts. Also, need to skip a specific MLX card UEFI OPROM or else will see CPU exception. We checked the PCIBUS driver code flow and there is no generic hooks to skip enumerating a device and to override the OPROM contents. To avoid overriding the PCIBUS driver with platform instance, we can have PciBus Hooks at various places in PCIBUS driver to skip the device from enumeration, overriding the OPROM contents etc.. Ex : MdeModulePkg\Bus\Pci\PciBusDxe\PciLib.c PciScanBus() for (Device = 0; Device <= PCI_MAX_DEVICE; Device++) { TempReservedBusNum = 0; for (Func = 0; Func <= PCI_MAX_FUNC; Func++) { // // Check to see whether a pci device is present // Status = PciDevicePresent ( PciRootBridgeIo, &Pci, StartBusNumber, Device, Func ); if (EFI_ERROR (Status) && Func == 0) { // // go to next device if there is no Function 0 // break; } if (EFI_ERROR (Status)) { continue; } Status = PciOemPlatformHooks(&Pci, isPciSkipDevice, &Pci, &StartBusNumber, &Device, &Func); if(EFI_ERROR(Status)) { if(Status==EFI_UNSUPPORTED){ Status=EFI_SUCCESS; } else ASSERT_EFI_ERROR(Status); } else { DEBUG((DEBUG_INFO,"Device @ [B%X|D%X|F%X], VID=%X, DID=%X SKIPPED from enumeration.\n\n", StartBusNumber, Device, Func, Pci.Hdr.VendorId,Pci.Hdr.DeviceId)); continue; } // // Get the PCI device information // Status = PciSearchDevice ( Bridge, &Pci, StartBusNumber, Device, Func, &PciDevice ); if (EFI_ERROR (Status)) { continue; } Thank you -Manic From: Kinney, Michael D > Sent: Thursday, June 17, 2021 11:19 AM To: devel@edk2.groups.io; Manickavasakam Karpagavinayagam >; gaoliming >; Ni, Ray >; Kinney, Michael D > Cc: Harikrishna Doppalapudi > Subject: RE: [EXTERNAL] 回复: [edk2-devel] [edk2-platforms] [PATCH V1 0/2] Support for TiogaPass Platform and Override generic PciBus Driver with Has the reason for the PciBusDxe override been discussed with the PciBusDxe maintainer? What feature would need to be added to PciBusDxe to accommodate the use case? Mike From: devel@edk2.groups.io > On Behalf Of manickavasakam karpagavinayagam Sent: Thursday, June 17, 2021 7:56 AM To: gaoliming >; devel@edk2.groups.io Cc: DOPPALAPUDI, HARIKRISHNA > Subject: Re: [EXTERNAL] 回复: [edk2-devel] [edk2-platforms] [PATCH V1 0/2] Support for TiogaPass Platform and Override generic PciBus Driver with Liming : Below email is the cover letter and this patch series has two changes. Sure next time, will add more comments in the cover letter also. Please refer the attached email and it has information about the PCIBUS override changes. PCIBUS override is done based on the platform sighting and it can’t be generic. Thank you -Manic From: gaoliming > Sent: Wednesday, June 16, 2021 10:56 PM To: devel@edk2.groups.io; Manickavasakam Karpagavinayagam > Subject: [EXTERNAL] 回复: [edk2-devel] [edk2-platforms] [PATCH V1 0/2] Support for TiogaPass Platform and Override generic PciBus Driver with **CAUTION: The e-mail below is from an external source. Please exercise caution before opening attachments, clicking links, or following guidance.** Please follow https://github.com/tianocore/tianocore.github.io/wiki/Commit-Message-Format to update the commit message format. And, for the override PciBus module, can you give more detail why need to override PciBus? Is it possible to update Edk2 MdeModulePkg PciBus to meet the platform requirement? Thanks Liming 发件人: devel@edk2.groups.io > 代表 manickavasakam karpagavinayagam 发送时间: 2021年6月17日 7:05 收件人: devel@edk2.groups.io 主题: [edk2-devel] [edk2-platforms] [PATCH V1 0/2] Support for TiogaPass Platform and Override generic PciBus Driver with Add BoardTiogaPass packages to support TiogaPass Platform Enabled Network, ISCSI,IPMI, SMBIOS, Performance Measurement Remove AST2500 UEFI option ROM driver from PurleyOpenBoardPkg AST2500 UEFI option ROM move to edk2-non-osi ASpeedGopBinPkg Update copyright headers manickavasakam karpagavinayagam (2): PurleyOpenBoardPkg : Support for TiogaPass Platform PurleyOpenBoardPkg : Override generic PciBus Driver with Platform specific instance of PciBus driver. .../IpmiFeaturePkg/GenericIpmi/Dxe/IpmiInit.c | 8 +- .../Acpi/BoardAcpiDxe/AmlOffsetTable.c | 453 +- .../Acpi/BoardAcpiDxe/BoardAcpiDxeDsdt.c | 3 + .../BoardTiogaPass/CoreDxeInclude.dsc | 168 + .../BoardTiogaPass/CoreUefiBootInclude.fdf | 82 + .../BoardTiogaPass/GitEdk2MinTiogaPass.bat | 93 + .../BasePlatformHookLib/BasePlatformHookLib.c | 389 + .../BasePlatformHookLib.inf | 36 + .../BoardAcpiLib/DxeBoardAcpiTableLib.c | 36 + .../BoardAcpiLib/DxeBoardAcpiTableLib.inf | 40 + .../BoardAcpiLib/DxeTiogaPassAcpiTableLib.c | 53 + .../BoardAcpiLib/SmmBoardAcpiEnableLib.c | 62 + .../BoardAcpiLib/SmmBoardAcpiEnableLib.inf | 41 + .../BoardAcpiLib/SmmSiliconAcpiEnableLib.c | 120 + .../BoardAcpiLib/SmmTiogaPassAcpiEnableLib.c | 37 + .../Library/BoardInitLib/AllLanesEparam.c | 44 + .../Library/BoardInitLib/GpioTable.c | 296 + .../Library/BoardInitLib/IioBifur.c | 70 + .../BoardInitLib/PeiBoardInitPostMemLib.c | 46 + .../BoardInitLib/PeiBoardInitPostMemLib.inf | 37 + .../BoardInitLib/PeiBoardInitPreMemLib.c | 112 + .../BoardInitLib/PeiBoardInitPreMemLib.inf | 69 + .../Library/BoardInitLib/PeiTiogaPassDetect.c | 28 + .../BoardInitLib/PeiTiogaPassInitLib.h | 18 + .../BoardInitLib/PeiTiogaPassInitPostMemLib.c | 86 + .../BoardInitLib/PeiTiogaPassInitPreMemLib.c | 638 ++ .../Library/BoardInitLib/UsbOC.c | 46 + .../Library/PeiReportFvLib/PeiReportFvLib.c | 138 + .../Library/PeiReportFvLib/PeiReportFvLib.inf | 51 + .../BoardTiogaPass/OpenBoardPkg.dsc | 245 + .../BoardTiogaPass/OpenBoardPkg.fdf | 600 ++ .../BoardTiogaPass/PlatformPkgBuildOption.dsc | 84 + .../BoardTiogaPass/PlatformPkgConfig.dsc | 58 + .../BoardTiogaPass/PlatformPkgPcd.dsc | 392 ++ .../BoardTiogaPass/StructureConfig.dsc | 6236 +++++++++++++++++ .../BoardTiogaPass/__init__.py | 0 .../PurleyOpenBoardPkg/BoardTiogaPass/bld.bat | 139 + .../BoardTiogaPass/build_board.py | 195 + .../BoardTiogaPass/build_config.cfg | 34 + .../BoardTiogaPass/logo.txt | 10 + .../BoardTiogaPass/postbuild.bat | 96 + .../BoardTiogaPass/prebuild.bat | 213 + .../Ipmi/Library/IpmiLibKcs/IpmiLibKcs.inf | 10 +- .../IpmiPlatformHookLib.inf | 6 +- .../Include/Guid/PchRcVariable.h | 6 + .../Include/Guid/SetupVariable.h | 15 +- .../Intel/PurleyOpenBoardPkg/OpenBoardPkg.dec | 1 + .../Bus/Pci/PciBusDxe/ComponentName.c | 170 + .../Bus/Pci/PciBusDxe/ComponentName.h | 146 + .../MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.c | 460 ++ .../MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.h | 396 ++ .../Bus/Pci/PciBusDxe/PciBusDxe.inf | 112 + .../Bus/Pci/PciBusDxe/PciBusDxe.uni | 16 + .../Bus/Pci/PciBusDxe/PciBusDxeExtra.uni | 14 + .../Bus/Pci/PciBusDxe/PciCommand.c | 267 + .../Bus/Pci/PciBusDxe/PciCommand.h | 232 + .../Bus/Pci/PciBusDxe/PciDeviceSupport.c | 1056 +++ .../Bus/Pci/PciBusDxe/PciDeviceSupport.h | 266 + .../Bus/Pci/PciBusDxe/PciDriverOverride.c | 188 + .../Bus/Pci/PciBusDxe/PciDriverOverride.h | 83 + .../Bus/Pci/PciBusDxe/PciEnumerator.c | 2210 ++++++ .../Bus/Pci/PciBusDxe/PciEnumerator.h | 515 ++ .../Bus/Pci/PciBusDxe/PciEnumeratorSupport.c | 2885 ++++++++ .../Bus/Pci/PciBusDxe/PciEnumeratorSupport.h | 480 ++ .../Bus/Pci/PciBusDxe/PciHotPlugSupport.c | 484 ++ .../Bus/Pci/PciBusDxe/PciHotPlugSupport.h | 205 + .../MdeModulePkg/Bus/Pci/PciBusDxe/PciIo.c | 2087 ++++++ .../MdeModulePkg/Bus/Pci/PciBusDxe/PciIo.h | 660 ++ .../MdeModulePkg/Bus/Pci/PciBusDxe/PciLib.c | 1809 +++++ .../MdeModulePkg/Bus/Pci/PciBusDxe/PciLib.h | 179 + .../Bus/Pci/PciBusDxe/PciOptionRomSupport.c | 776 ++ .../Bus/Pci/PciBusDxe/PciOptionRomSupport.h | 136 + .../Bus/Pci/PciBusDxe/PciPowerManagement.c | 82 + .../Bus/Pci/PciBusDxe/PciPowerManagement.h | 28 + .../Bus/Pci/PciBusDxe/PciResourceSupport.c | 2292 ++++++ .../Bus/Pci/PciBusDxe/PciResourceSupport.h | 456 ++ .../Bus/Pci/PciBusDxe/PciRomTable.c | 135 + .../Bus/Pci/PciBusDxe/PciRomTable.h | 48 + Platform/Intel/build.cfg | 2 + Platform/Intel/build_bios.py | 3 +- 80 files changed, 30278 insertions(+), 240 deletions(-) create mode 100644 Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/CoreDxeInclude.dsc create mode 100644 Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/CoreUefiBootInclude.fdf create mode 100644 Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/GitEdk2MinTiogaPass.bat create mode 100644 Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/Library/BasePlatformHookLib/BasePlatformHookLib.c create mode 100644 Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/Library/BasePlatformHookLib/BasePlatformHookLib.inf create mode 100644 Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/Library/BoardAcpiLib/DxeBoardAcpiTableLib.c create mode 100644 Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/Library/BoardAcpiLib/DxeBoardAcpiTableLib.inf create mode 100644 Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/Library/BoardAcpiLib/DxeTiogaPassAcpiTableLib.c create mode 100644 Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/Library/BoardAcpiLib/SmmBoardAcpiEnableLib.c create mode 100644 Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/Library/BoardAcpiLib/SmmBoardAcpiEnableLib.inf create mode 100644 Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/Library/BoardAcpiLib/SmmSiliconAcpiEnableLib.c create mode 100644 Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/Library/BoardAcpiLib/SmmTiogaPassAcpiEnableLib.c create mode 100644 Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/Library/BoardInitLib/AllLanesEparam.c create mode 100644 Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/Library/BoardInitLib/GpioTable.c create mode 100644 Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/Library/BoardInitLib/IioBifur.c create mode 100644 Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/Library/BoardInitLib/PeiBoardInitPostMemLib.c create mode 100644 Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/Library/BoardInitLib/PeiBoardInitPostMemLib.inf create mode 100644 Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/Library/BoardInitLib/PeiBoardInitPreMemLib.c create mode 100644 Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/Library/BoardInitLib/PeiBoardInitPreMemLib.inf create mode 100644 Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/Library/BoardInitLib/PeiTiogaPassDetect.c create mode 100644 Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/Library/BoardInitLib/PeiTiogaPassInitLib.h create mode 100644 Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/Library/BoardInitLib/PeiTiogaPassInitPostMemLib.c create mode 100644 Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/Library/BoardInitLib/PeiTiogaPassInitPreMemLib.c create mode 100644 Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/Library/BoardInitLib/UsbOC.c create mode 100644 Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/Library/PeiReportFvLib/PeiReportFvLib.c create mode 100644 Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/Library/PeiReportFvLib/PeiReportFvLib.inf create mode 100644 Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/OpenBoardPkg.dsc create mode 100644 Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/OpenBoardPkg.fdf create mode 100644 Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/PlatformPkgBuildOption.dsc create mode 100644 Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/PlatformPkgConfig.dsc create mode 100644 Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/PlatformPkgPcd.dsc create mode 100644 Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/StructureConfig.dsc create mode 100644 Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/__init__.py create mode 100644 Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/bld.bat create mode 100644 Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/build_board.py create mode 100644 Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/build_config.cfg create mode 100644 Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/logo.txt create mode 100644 Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/postbuild.bat create mode 100644 Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/prebuild.bat create mode 100644 Platform/Intel/PurleyOpenBoardPkg/Override/MdeModulePkg/Bus/Pci/PciBusDxe/ComponentName.c create mode 100644 Platform/Intel/PurleyOpenBoardPkg/Override/MdeModulePkg/Bus/Pci/PciBusDxe/ComponentName.h create mode 100644 Platform/Intel/PurleyOpenBoardPkg/Override/MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.c create mode 100644 Platform/Intel/PurleyOpenBoardPkg/Override/MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.h create mode 100644 Platform/Intel/PurleyOpenBoardPkg/Override/MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf create mode 100644 Platform/Intel/PurleyOpenBoardPkg/Override/MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.uni create mode 100644 Platform/Intel/PurleyOpenBoardPkg/Override/MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxeExtra.uni create mode 100644 Platform/Intel/PurleyOpenBoardPkg/Override/MdeModulePkg/Bus/Pci/PciBusDxe/PciCommand.c create mode 100644 Platform/Intel/PurleyOpenBoardPkg/Override/MdeModulePkg/Bus/Pci/PciBusDxe/PciCommand.h create mode 100644 Platform/Intel/PurleyOpenBoardPkg/Override/MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c create mode 100644 Platform/Intel/PurleyOpenBoardPkg/Override/MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.h create mode 100644 Platform/Intel/PurleyOpenBoardPkg/Override/MdeModulePkg/Bus/Pci/PciBusDxe/PciDriverOverride.c create mode 100644 Platform/Intel/PurleyOpenBoardPkg/Override/MdeModulePkg/Bus/Pci/PciBusDxe/PciDriverOverride.h create mode 100644 Platform/Intel/PurleyOpenBoardPkg/Override/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumerator.c create mode 100644 Platform/Intel/PurleyOpenBoardPkg/Override/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumerator.h create mode 100644 Platform/Intel/PurleyOpenBoardPkg/Override/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c create mode 100644 Platform/Intel/PurleyOpenBoardPkg/Override/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.h create mode 100644 Platform/Intel/PurleyOpenBoardPkg/Override/MdeModulePkg/Bus/Pci/PciBusDxe/PciHotPlugSupport.c create mode 100644 Platform/Intel/PurleyOpenBoardPkg/Override/MdeModulePkg/Bus/Pci/PciBusDxe/PciHotPlugSupport.h create mode 100644 Platform/Intel/PurleyOpenBoardPkg/Override/MdeModulePkg/Bus/Pci/PciBusDxe/PciIo.c create mode 100644 Platform/Intel/PurleyOpenBoardPkg/Override/MdeModulePkg/Bus/Pci/PciBusDxe/PciIo.h create mode 100644 Platform/Intel/PurleyOpenBoardPkg/Override/MdeModulePkg/Bus/Pci/PciBusDxe/PciLib.c create mode 100644 Platform/Intel/PurleyOpenBoardPkg/Override/MdeModulePkg/Bus/Pci/PciBusDxe/PciLib.h create mode 100644 Platform/Intel/PurleyOpenBoardPkg/Override/MdeModulePkg/Bus/Pci/PciBusDxe/PciOptionRomSupport.c create mode 100644 Platform/Intel/PurleyOpenBoardPkg/Override/MdeModulePkg/Bus/Pci/PciBusDxe/PciOptionRomSupport.h create mode 100644 Platform/Intel/PurleyOpenBoardPkg/Override/MdeModulePkg/Bus/Pci/PciBusDxe/PciPowerManagement.c create mode 100644 Platform/Intel/PurleyOpenBoardPkg/Override/MdeModulePkg/Bus/Pci/PciBusDxe/PciPowerManagement.h create mode 100644 Platform/Intel/PurleyOpenBoardPkg/Override/MdeModulePkg/Bus/Pci/PciBusDxe/PciResourceSupport.c create mode 100644 Platform/Intel/PurleyOpenBoardPkg/Override/MdeModulePkg/Bus/Pci/PciBusDxe/PciResourceSupport.h create mode 100644 Platform/Intel/PurleyOpenBoardPkg/Override/MdeModulePkg/Bus/Pci/PciBusDxe/PciRomTable.c create mode 100644 Platform/Intel/PurleyOpenBoardPkg/Override/MdeModulePkg/Bus/Pci/PciBusDxe/PciRomTable.h -The information contained in this message may be confidential and proprietary to American Megatrends (AMI). This communication is intended to be read only by the individual or entity to whom it is addressed or by their designee. If the reader of this message is not the intended recipient, you are on notice that any distribution of this message, in any form, is strictly prohibited. Please promptly notify the sender by reply e-mail or by telephone at 770-246-8600, and then delete or destroy all copies of the transmission. -The information contained in this message may be confidential and proprietary to American Megatrends (AMI). This communication is intended to be read only by the individual or entity to whom it is addressed or by their designee. If the reader of this message is not the intended recipient, you are on notice that any distribution of this message, in any form, is strictly prohibited. Please promptly notify the sender by reply e-mail or by telephone at 770-246-8600, and then delete or destroy all copies of the transmission.