]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.h
MdeModulePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdeModulePkg / Bus / Pci / PciBusDxe / PciBus.h
index e268014d346a02ac35a0f16e38194776c308d95d..504a1b1c1297792a65b7e7bbffea26bdb6eb117d 100644 (file)
@@ -1,14 +1,8 @@
 /** @file\r
   Header files and data structures needed by 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 - 2019, Intel Corporation. All rights reserved.<BR>\r
+SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
 \r
@@ -32,6 +26,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <Protocol/IncompatiblePciDeviceSupport.h>\r
 #include <Protocol/PciOverride.h>\r
 #include <Protocol/PciEnumerationComplete.h>\r
+#include <Protocol/IoMmu.h>\r
 \r
 #include <Library/DebugLib.h>\r
 #include <Library/UefiDriverEntryPoint.h>\r
@@ -43,7 +38,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <Library/UefiBootServicesTableLib.h>\r
 #include <Library/DevicePathLib.h>\r
 #include <Library/PcdLib.h>\r
-#include <Library/PeCoffLib.h>\r
 \r
 #include <IndustryStandard/Pci.h>\r
 #include <IndustryStandard/PeImage.h>\r
@@ -67,6 +61,7 @@ typedef enum {
   PciBarTypePMem32,\r
   PciBarTypeMem64,\r
   PciBarTypePMem64,\r
+  PciBarTypeOpRom,\r
   PciBarTypeIo,\r
   PciBarTypeMem,\r
   PciBarTypeMaxType\r
@@ -102,8 +97,7 @@ struct _PCI_BAR {
   UINT64        Length;\r
   UINT64        Alignment;\r
   PCI_BAR_TYPE  BarType;\r
-  BOOLEAN       Prefetchable;\r
-  UINT8         MemType;\r
+  BOOLEAN       BarTypeFixed;\r
   UINT16        Offset;\r
 };\r
 \r
@@ -127,6 +121,12 @@ struct _PCI_BAR {
 #define PCI_CARD_PREFETCHABLE_MEMORY_0_ENABLE BIT8\r
 #define PCI_CARD_PREFETCHABLE_MEMORY_1_ENABLE BIT9\r
 \r
+#define RB_IO_RANGE                           1\r
+#define RB_MEM32_RANGE                        2\r
+#define RB_PMEM32_RANGE                       3\r
+#define RB_MEM64_RANGE                        4\r
+#define RB_PMEM64_RANGE                       5\r
+\r
 #define PPB_BAR_0                             0\r
 #define PPB_BAR_1                             1\r
 #define PPB_IO_RANGE                          2\r
@@ -198,7 +198,7 @@ struct _PCI_IO_DEVICE {
   LIST_ENTRY                                ChildList;\r
 \r
   //\r
-  // TURE if the PCI bus driver creates the handle for this PCI device\r
+  // TRUE if the PCI bus driver creates the handle for this PCI device\r
   //\r
   BOOLEAN                                   Registered;\r
 \r
@@ -231,12 +231,7 @@ struct _PCI_IO_DEVICE {
   //\r
   // The OptionRom Size\r
   //\r
-  UINT64                                    RomSize;\r
-\r
-  //\r
-  // The OptionRom Size\r
-  //\r
-  UINT64                                    RomBase;\r
+  UINT32                                    RomSize;\r
 \r
   //\r
   // TRUE if all OpROM (in device or in platform specific position) have been processed\r
@@ -261,6 +256,11 @@ struct _PCI_IO_DEVICE {
   EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR         *ResourcePaddingDescriptors;\r
   EFI_HPC_PADDING_ATTRIBUTES                PaddingAttributes;\r
 \r
+  //\r
+  // Bus number ranges for a PCI Root Bridge device\r
+  //\r
+  EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR         *BusNumberRanges;\r
+\r
   BOOLEAN                                   IsPciExp;\r
   //\r
   // For SR-IOV\r
@@ -275,7 +275,7 @@ struct _PCI_IO_DEVICE {
   UINT16                                    ReservedBusNum;\r
   //\r
   // Per PCI to PCI Bridge spec, I/O window is 4K aligned,\r
-  // but some chipsets support non-stardard I/O window aligments less than 4K.\r
+  // but some chipsets support non-standard I/O window alignments less than 4K.\r
   // This field is used to support this case.\r
   //\r
   UINT16                                    BridgeIoAlignment;\r
@@ -298,7 +298,7 @@ struct _PCI_IO_DEVICE {
 //\r
 // Global Variables\r
 //\r
-extern EFI_INCOMPATIBLE_PCI_DEVICE_SUPPORT_PROTOCOL *gEfiIncompatiblePciDeviceSupport;\r
+extern EFI_INCOMPATIBLE_PCI_DEVICE_SUPPORT_PROTOCOL *gIncompatiblePciDeviceSupport;\r
 extern EFI_DRIVER_BINDING_PROTOCOL                  gPciBusDriverBinding;\r
 extern EFI_COMPONENT_NAME_PROTOCOL                  gPciBusComponentName;\r
 extern EFI_COMPONENT_NAME2_PROTOCOL                 gPciBusComponentName2;\r
@@ -309,16 +309,16 @@ extern UINT64                                       gAllOne;
 extern UINT64                                       gAllZero;\r
 extern EFI_PCI_PLATFORM_PROTOCOL                    *gPciPlatformProtocol;\r
 extern EFI_PCI_OVERRIDE_PROTOCOL                    *gPciOverrideProtocol;\r
-\r
-\r
+extern BOOLEAN                                      mReserveIsaAliases;\r
+extern BOOLEAN                                      mReserveVgaAliases;\r
 \r
 /**\r
   Macro that checks whether device is a GFX device.\r
 \r
   @param  _p      Specified device.\r
 \r
-  @retval TRUE    Device is a GFX device.\r
-  @retval FALSE   Device is not a GFX device.\r
+  @retval TRUE    Device is a GFX device.\r
+  @retval FALSE   Device is not a GFX device.\r
 \r
 **/\r
 #define IS_PCI_GFX(_p)     IS_CLASS2 (_p, PCI_CLASS_DISPLAY, PCI_CLASS_DISPLAY_OTHER)\r
@@ -329,7 +329,7 @@ extern EFI_PCI_OVERRIDE_PROTOCOL                    *gPciOverrideProtocol;
 \r
   @param  This                Protocol instance pointer.\r
   @param  Controller          Handle of device to test.\r
-  @param  RemainingDevicePath Optional parameter use to pick a specific child.\r
+  @param  RemainingDevicePath Optional parameter use to pick a specific child\r
                               device to start.\r
 \r
   @retval EFI_SUCCESS         This driver supports this device.\r
@@ -351,7 +351,7 @@ PciBusDriverBindingSupported (
 \r
   @param  This                 Protocol instance pointer.\r
   @param  Controller           Handle of device to bind driver to.\r
-  @param  RemainingDevicePath  Optional parameter use to pick a specific child.\r
+  @param  RemainingDevicePath  Optional parameter use to pick a specific child\r
                                device to start.\r
 \r
   @retval EFI_SUCCESS          This driver is added to ControllerHandle.\r
@@ -368,7 +368,7 @@ PciBusDriverBindingStart (
   );\r
 \r
 /**\r
-  Stop this driver on ControllerHandle. Support stoping any child handles\r
+  Stop this driver on ControllerHandle. Support stopping any child handles\r
   created by this driver.\r
 \r
   @param  This              Protocol instance pointer.\r