]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.h
MdeModulePkg: Update PciEnumeratorSupport to ignore OptionRom if needed
[mirror_edk2.git] / MdeModulePkg / Bus / Pci / PciBusDxe / PciEnumeratorSupport.h
index 4d7b3b754a2a25aae5a4658bc560f0f5f4a7e420..7daa6e020d09eefe9df89723bb3c6221f39e94db 100644 (file)
@@ -1,14 +1,8 @@
 /** @file\r
-  PCI emumeration support functions declaration for PCI Bus module.\r
+  PCI enumeration support functions declaration for PCI Bus module.\r
 \r
-Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials\r
-are licensed and made available under the terms and conditions of the BSD License\r
-which accompanies this distribution.  The full text of the license may be found at\r
-http://opensource.org/licenses/bsd-license.php\r
-\r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+Copyright (c) 2006 - 2021, Intel Corporation. All rights reserved.<BR>\r
+SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
 \r
@@ -30,11 +24,11 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 **/\r
 EFI_STATUS\r
 PciDevicePresent (\r
-  IN  EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL     *PciRootBridgeIo,\r
-  OUT PCI_TYPE00                          *Pci,\r
-  IN  UINT8                               Bus,\r
-  IN  UINT8                               Device,\r
-  IN  UINT8                               Func\r
+  IN  EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL  *PciRootBridgeIo,\r
+  OUT PCI_TYPE00                       *Pci,\r
+  IN  UINT8                            Bus,\r
+  IN  UINT8                            Device,\r
+  IN  UINT8                            Func\r
   );\r
 \r
 /**\r
@@ -44,7 +38,7 @@ PciDevicePresent (
   root bridge will then be created.\r
 \r
   @param Bridge         Parent bridge instance.\r
-  @param StartBusNumber Bus number of begining.\r
+  @param StartBusNumber Bus number of beginning.\r
 \r
   @retval EFI_SUCCESS   PCI device is found.\r
   @retval other         Some error occurred when reading PCI bridge information.\r
@@ -52,12 +46,12 @@ PciDevicePresent (
 **/\r
 EFI_STATUS\r
 PciPciDeviceInfoCollector (\r
-  IN PCI_IO_DEVICE                      *Bridge,\r
-  IN UINT8                              StartBusNumber\r
+  IN PCI_IO_DEVICE  *Bridge,\r
+  IN UINT8          StartBusNumber\r
   );\r
 \r
 /**\r
-  Seach required device and create PCI device instance.\r
+  Search required device and create PCI device instance.\r
 \r
   @param Bridge     Parent bridge instance.\r
   @param Pci        Input PCI device information block.\r
@@ -72,12 +66,12 @@ PciPciDeviceInfoCollector (
 **/\r
 EFI_STATUS\r
 PciSearchDevice (\r
-  IN  PCI_IO_DEVICE                         *Bridge,\r
-  IN  PCI_TYPE00                            *Pci,\r
-  IN  UINT8                                 Bus,\r
-  IN  UINT8                                 Device,\r
-  IN  UINT8                                 Func,\r
-  OUT PCI_IO_DEVICE                         **PciDevice\r
+  IN  PCI_IO_DEVICE  *Bridge,\r
+  IN  PCI_TYPE00     *Pci,\r
+  IN  UINT8          Bus,\r
+  IN  UINT8          Device,\r
+  IN  UINT8          Func,\r
+  OUT PCI_IO_DEVICE  **PciDevice\r
   );\r
 \r
 /**\r
@@ -94,11 +88,11 @@ PciSearchDevice (
 **/\r
 PCI_IO_DEVICE *\r
 GatherDeviceInfo (\r
-  IN PCI_IO_DEVICE                    *Bridge,\r
-  IN PCI_TYPE00                       *Pci,\r
-  IN UINT8                            Bus,\r
-  IN UINT8                            Device,\r
-  IN UINT8                            Func\r
+  IN PCI_IO_DEVICE  *Bridge,\r
+  IN PCI_TYPE00     *Pci,\r
+  IN UINT8          Bus,\r
+  IN UINT8          Device,\r
+  IN UINT8          Func\r
   );\r
 \r
 /**\r
@@ -115,11 +109,11 @@ GatherDeviceInfo (
 **/\r
 PCI_IO_DEVICE *\r
 GatherPpbInfo (\r
-  IN PCI_IO_DEVICE                    *Bridge,\r
-  IN PCI_TYPE00                       *Pci,\r
-  IN UINT8                            Bus,\r
-  IN UINT8                            Device,\r
-  IN UINT8                            Func\r
+  IN PCI_IO_DEVICE  *Bridge,\r
+  IN PCI_TYPE00     *Pci,\r
+  IN UINT8          Bus,\r
+  IN UINT8          Device,\r
+  IN UINT8          Func\r
   );\r
 \r
 /**\r
@@ -136,26 +130,26 @@ GatherPpbInfo (
 **/\r
 PCI_IO_DEVICE *\r
 GatherP2CInfo (\r
-  IN PCI_IO_DEVICE                    *Bridge,\r
-  IN PCI_TYPE00                       *Pci,\r
-  IN UINT8                            Bus,\r
-  IN UINT8                            Device,\r
-  IN UINT8                            Func\r
+  IN PCI_IO_DEVICE  *Bridge,\r
+  IN PCI_TYPE00     *Pci,\r
+  IN UINT8          Bus,\r
+  IN UINT8          Device,\r
+  IN UINT8          Func\r
   );\r
 \r
 /**\r
-  Create device path for pci deivce.\r
+  Create device path for pci device.\r
 \r
   @param ParentDevicePath  Parent bridge's path.\r
   @param PciIoDevice       Pci device instance.\r
 \r
-  @return device path protocol instance for specific pci device.\r
+  @return Device path protocol instance for specific pci device.\r
 \r
 **/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 CreatePciDevicePath (\r
-  IN  EFI_DEVICE_PATH_PROTOCOL *ParentDevicePath,\r
-  IN  PCI_IO_DEVICE            *PciIoDevice\r
+  IN  EFI_DEVICE_PATH_PROTOCOL  *ParentDevicePath,\r
+  IN  PCI_IO_DEVICE             *PciIoDevice\r
   );\r
 \r
 /**\r
@@ -172,10 +166,10 @@ CreatePciDevicePath (
 **/\r
 EFI_STATUS\r
 VfBarExisted (\r
-  IN PCI_IO_DEVICE *PciIoDevice,\r
-  IN UINTN         Offset,\r
-  OUT UINT32       *BarLengthValue,\r
-  OUT UINT32       *OriginalBarValue\r
+  IN PCI_IO_DEVICE  *PciIoDevice,\r
+  IN UINTN          Offset,\r
+  OUT UINT32        *BarLengthValue,\r
+  OUT UINT32        *OriginalBarValue\r
   );\r
 \r
 /**\r
@@ -192,10 +186,10 @@ VfBarExisted (
 **/\r
 EFI_STATUS\r
 BarExisted (\r
-  IN  PCI_IO_DEVICE *PciIoDevice,\r
-  IN  UINTN         Offset,\r
-  OUT UINT32        *BarLengthValue,\r
-  OUT UINT32        *OriginalBarValue\r
+  IN  PCI_IO_DEVICE  *PciIoDevice,\r
+  IN  UINTN          Offset,\r
+  OUT UINT32         *BarLengthValue,\r
+  OUT UINT32         *OriginalBarValue\r
   );\r
 \r
 /**\r
@@ -204,7 +198,7 @@ BarExisted (
   @param PciIoDevice      Pci device instance.\r
   @param Command          Input command register value, and\r
                           returned supported register value.\r
-  @param BridgeControl    Inout bridge control value for PPB or P2C, and\r
+  @param BridgeControl    Input bridge control value for PPB or P2C, and\r
                           returned supported bridge control value.\r
   @param OldCommand       Returned and stored old command register offset.\r
   @param OldBridgeControl Returned and stored old Bridge control value for PPB or P2C.\r
@@ -212,11 +206,11 @@ BarExisted (
 **/\r
 VOID\r
 PciTestSupportedAttribute (\r
-  IN     PCI_IO_DEVICE                      *PciIoDevice,\r
-  IN OUT UINT16                             *Command,\r
-  IN OUT UINT16                             *BridgeControl,\r
-     OUT UINT16                             *OldCommand,\r
-     OUT UINT16                             *OldBridgeControl\r
+  IN     PCI_IO_DEVICE  *PciIoDevice,\r
+  IN OUT UINT16         *Command,\r
+  IN OUT UINT16         *BridgeControl,\r
+  OUT UINT16            *OldCommand,\r
+  OUT UINT16            *OldBridgeControl\r
   );\r
 \r
 /**\r
@@ -230,10 +224,10 @@ PciTestSupportedAttribute (
 **/\r
 VOID\r
 PciSetDeviceAttribute (\r
-  IN PCI_IO_DEVICE                      *PciIoDevice,\r
-  IN UINT16                             Command,\r
-  IN UINT16                             BridgeControl,\r
-  IN UINTN                              Option\r
+  IN PCI_IO_DEVICE  *PciIoDevice,\r
+  IN UINT16         Command,\r
+  IN UINT16         BridgeControl,\r
+  IN UINTN          Option\r
   );\r
 \r
 /**\r
@@ -248,8 +242,8 @@ PciSetDeviceAttribute (
 **/\r
 EFI_STATUS\r
 GetFastBackToBackSupport (\r
-  IN PCI_IO_DEVICE                      *PciIoDevice,\r
-  IN UINT8                              StatusIndex\r
+  IN PCI_IO_DEVICE  *PciIoDevice,\r
+  IN UINT8          StatusIndex\r
   );\r
 \r
 /**\r
@@ -260,7 +254,7 @@ GetFastBackToBackSupport (
 **/\r
 EFI_STATUS\r
 DetermineDeviceAttribute (\r
-  IN PCI_IO_DEVICE                      *PciIoDevice\r
+  IN PCI_IO_DEVICE  *PciIoDevice\r
   );\r
 \r
 /**\r
@@ -268,6 +262,7 @@ DetermineDeviceAttribute (
 \r
   @param PciIoDevice      Input Pci device instance. Output Pci device instance with updated\r
                           Bar information.\r
+  @param IgnoreOptionRom  Output If the option rom of incompatible device need to be ignored.\r
 \r
   @retval EFI_SUCCESS     Successfully updated bar information.\r
   @retval EFI_UNSUPPORTED Given PCI device doesn't belong to incompatible PCI device list.\r
@@ -275,7 +270,8 @@ DetermineDeviceAttribute (
 **/\r
 EFI_STATUS\r
 UpdatePciInfo (\r
-  IN OUT PCI_IO_DEVICE    *PciIoDevice\r
+  IN OUT PCI_IO_DEVICE  *PciIoDevice,\r
+  OUT BOOLEAN           *IgnoreOptionRom\r
   );\r
 \r
 /**\r
@@ -287,8 +283,8 @@ UpdatePciInfo (
 **/\r
 VOID\r
 SetNewAlign (\r
-  IN OUT UINT64     *Alignment,\r
-  IN     UINT64     NewAlignment\r
+  IN OUT UINT64  *Alignment,\r
+  IN     UINT64  NewAlignment\r
   );\r
 \r
 /**\r
@@ -335,7 +331,7 @@ PciIovParseVfBar (
 **/\r
 VOID\r
 InitializePciDevice (\r
-  IN PCI_IO_DEVICE    *PciIoDevice\r
+  IN PCI_IO_DEVICE  *PciIoDevice\r
   );\r
 \r
 /**\r
@@ -346,7 +342,7 @@ InitializePciDevice (
 **/\r
 VOID\r
 InitializePpb (\r
-  IN PCI_IO_DEVICE    *PciIoDevice\r
+  IN PCI_IO_DEVICE  *PciIoDevice\r
   );\r
 \r
 /**\r
@@ -357,11 +353,11 @@ InitializePpb (
 **/\r
 VOID\r
 InitializeP2C (\r
-  IN PCI_IO_DEVICE    *PciIoDevice\r
+  IN PCI_IO_DEVICE  *PciIoDevice\r
   );\r
 \r
 /**\r
-  Create and initiliaze general PCI I/O device instance for\r
+  Create and initialize general PCI I/O device instance for\r
   PCI device/bridge device/hotplug bridge device.\r
 \r
   @param Bridge            Parent bridge instance.\r
@@ -375,11 +371,11 @@ InitializeP2C (
 **/\r
 PCI_IO_DEVICE *\r
 CreatePciIoDevice (\r
-  IN PCI_IO_DEVICE                    *Bridge,\r
-  IN PCI_TYPE00                       *Pci,\r
-  IN UINT8                            Bus,\r
-  IN UINT8                            Device,\r
-  IN UINT8                            Func\r
+  IN PCI_IO_DEVICE  *Bridge,\r
+  IN PCI_TYPE00     *Pci,\r
+  IN UINT8          Bus,\r
+  IN UINT8          Device,\r
+  IN UINT8          Func\r
   );\r
 \r
 /**\r
@@ -396,7 +392,7 @@ CreatePciIoDevice (
 **/\r
 EFI_STATUS\r
 PciEnumeratorLight (\r
-  IN EFI_HANDLE                    Controller\r
+  IN EFI_HANDLE  Controller\r
   );\r
 \r
 /**\r
@@ -430,7 +426,7 @@ PciGetBusRange (
 **/\r
 EFI_STATUS\r
 StartManagingRootBridge (\r
-  IN PCI_IO_DEVICE *RootBridgeDev\r
+  IN PCI_IO_DEVICE  *RootBridgeDev\r
   );\r
 \r
 /**\r
@@ -444,7 +440,7 @@ StartManagingRootBridge (
 **/\r
 BOOLEAN\r
 IsPciDeviceRejected (\r
-  IN PCI_IO_DEVICE *PciIoDevice\r
+  IN PCI_IO_DEVICE  *PciIoDevice\r
   );\r
 \r
 /**\r
@@ -456,8 +452,8 @@ IsPciDeviceRejected (
 **/\r
 VOID\r
 ResetAllPpbBusNumber (\r
-  IN PCI_IO_DEVICE                      *Bridge,\r
-  IN UINT8                              StartBusNumber\r
+  IN PCI_IO_DEVICE  *Bridge,\r
+  IN UINT8          StartBusNumber\r
   );\r
 \r
 /**\r
@@ -469,8 +465,18 @@ ResetAllPpbBusNumber (
 **/\r
 VOID\r
 DumpPpbPaddingResource (\r
-  IN PCI_IO_DEVICE                    *PciIoDevice,\r
-  IN PCI_BAR_TYPE                     ResourceType\r
+  IN PCI_IO_DEVICE  *PciIoDevice,\r
+  IN PCI_BAR_TYPE   ResourceType\r
+  );\r
+\r
+/**\r
+  Dump the PCI BAR information.\r
+\r
+  @param PciIoDevice     PCI IO instance.\r
+**/\r
+VOID\r
+DumpPciBars (\r
+  IN PCI_IO_DEVICE  *PciIoDevice\r
   );\r
 \r
 #endif\r