]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Bus/Pci/PciBusDxe/PciLib.h
MdeModulePkg/Bus/Pci/PciBusDxe: Support PCIe Resizable BAR Capability
[mirror_edk2.git] / MdeModulePkg / Bus / Pci / PciBusDxe / PciLib.h
index 10b435d146117894abaf4d8130484d520ec49b8c..aeec6d6b6dcdabe4fddf6feff7bd161f34324610 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Internal library declaration for PCI Bus module.\r
 \r
-Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2021, Intel Corporation. All rights reserved.<BR>\r
 SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
@@ -24,6 +24,10 @@ typedef struct {
   UINT8                              *AllocRes;\r
 } EFI_RESOURCE_ALLOC_FAILURE_ERROR_DATA_PAYLOAD;\r
 \r
+typedef enum {\r
+  PciResizableBarMin = 0x00,\r
+  PciResizableBarMax = 0xFF\r
+} PCI_RESIZABLE_BAR_OPERATION;\r
 \r
 /**\r
   Retrieve the PCI Card device BAR information via PciIo interface.\r
@@ -156,4 +160,20 @@ PciHostBridgeEnumerator (
   IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL  *PciResAlloc\r
   );\r
 \r
+/**\r
+  This function is used to program the Resizable BAR Register.\r
+\r
+  @param PciIoDevice            A pointer to the PCI_IO_DEVICE.\r
+  @param ResizableBarOp         PciResizableBarMax: Set BAR to max size\r
+                                PciResizableBarMin: set BAR to min size.\r
+\r
+  @retval EFI_SUCCESS           Successfully enumerated the host bridge.\r
+  @retval other                 Some error occurred when enumerating the host bridge.\r
+\r
+**/\r
+EFI_STATUS\r
+PciProgramResizableBar (\r
+  IN PCI_IO_DEVICE                *PciIoDevice,\r
+  IN PCI_RESIZABLE_BAR_OPERATION  ResizableBarOp\r
+  );\r
 #endif\r