]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Include/Library/PciHostBridgeLib.h
MdeModulePkg/PciHostBridgeLib.h: add address Translation
[mirror_edk2.git] / MdeModulePkg / Include / Library / PciHostBridgeLib.h
index 16ad104a9368a7511e03cf7be2603437165be085..18963a0d3821760aad37b54b493134b47c3ce41e 100644 (file)
 // (Base > Limit) indicates an aperture is not available.\r
 //\r
 typedef struct {\r
+  //\r
+  // Base and Limit are the device address instead of host address when\r
+  // Translation is not zero\r
+  //\r
   UINT64 Base;\r
   UINT64 Limit;\r
+  //\r
+  // According to UEFI 2.7, Device Address = Host Address + Translation,\r
+  // so Translation = Device Address - Host Address.\r
+  // On platforms where Translation is not zero, the subtraction is probably to\r
+  // be performed with UINT64 wrap-around semantics, for we may translate an\r
+  // above-4G host address into a below-4G device address for legacy PCIe device\r
+  // compatibility.\r
+  //\r
+  // NOTE: The alignment of Translation is required to be larger than any BAR\r
+  // alignment in the same root bridge, so that the same alignment can be\r
+  // applied to both device address and host address, which simplifies the\r
+  // situation and makes the current resource allocation code in generic PCI\r
+  // host bridge driver still work.\r
+  //\r
+  UINT64 Translation;\r
 } PCI_ROOT_BRIDGE_APERTURE;\r
 \r
 typedef struct {\r
@@ -34,6 +53,12 @@ typedef struct {
                                                   ///< and SetAttributes() in EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.\r
   BOOLEAN                  DmaAbove4G;            ///< DMA above 4GB memory.\r
                                                   ///< Set to TRUE when root bridge supports DMA above 4GB memory.\r
+  BOOLEAN                  NoExtendedConfigSpace; ///< When FALSE, the root bridge supports\r
+                                                  ///< Extended (4096-byte) Configuration Space.\r
+                                                  ///< When TRUE, the root bridge supports\r
+                                                  ///< 256-byte Configuration Space only.\r
+  BOOLEAN                  ResourceAssigned;      ///< Resource assignment status of the root bridge.\r
+                                                  ///< Set to TRUE if Bus/IO/MMIO resources for root bridge have been assigned.\r
   UINT64                   AllocationAttributes;  ///< Allocation attributes.\r
                                                   ///< Refer to EFI_PCI_HOST_BRIDGE_COMBINE_MEM_PMEM and\r
                                                   ///< EFI_PCI_HOST_BRIDGE_MEM64_DECODE used by GetAllocAttributes()\r
@@ -65,8 +90,8 @@ PciHostBridgeGetRootBridges (
 /**\r
   Free the root bridge instances array returned from PciHostBridgeGetRootBridges().\r
 \r
-  @param  The root bridge instances array.\r
-  @param  The count of the array.\r
+  @param Bridges The root bridge instances array.\r
+  @param Count   The count of the array.\r
 **/\r
 VOID\r
 EFIAPI\r