]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg: Add new structure for the PCI Root Bridge Info Hob
authorZhiguang Liu <zhiguang.liu@intel.com>
Fri, 30 Apr 2021 05:07:32 +0000 (13:07 +0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Wed, 16 Jun 2021 05:20:19 +0000 (05:20 +0000)
Also add ExceptionList in MdeModulePkg\MdeModulePkg.ci.yaml, to avoid open
CI issue, because UID and HID are terms which are already used in current
source code.

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
Tested-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
MdeModulePkg/Include/UniversalPayload/PciRootBridges.h [new file with mode: 0644]
MdeModulePkg/MdeModulePkg.ci.yaml
MdeModulePkg/MdeModulePkg.dec

diff --git a/MdeModulePkg/Include/UniversalPayload/PciRootBridges.h b/MdeModulePkg/Include/UniversalPayload/PciRootBridges.h
new file mode 100644 (file)
index 0000000..3a7aae8
--- /dev/null
@@ -0,0 +1,91 @@
+/** @file\r
+  This file defines the structure for the PCI Root Bridges.\r
+\r
+  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>\r
+  SPDX-License-Identifier: BSD-2-Clause-Patent\r
+\r
+  @par Revision Reference:\r
+    - Universal Payload Specification 0.75 (https://universalpayload.github.io/documentation/)\r
+**/\r
+\r
+#ifndef UNIVERSAL_PAYLOAD_PCI_ROOT_BRIDGES_H_\r
+#define UNIVERSAL_PAYLOAD_PCI_ROOT_BRIDGES_H_\r
+\r
+#include <UniversalPayload/UniversalPayload.h>\r
+\r
+#pragma pack(1)\r
+\r
+//\r
+// (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
+} UNIVERSAL_PAYLOAD_PCI_ROOT_BRIDGE_APERTURE;\r
+\r
+///\r
+/// Payload PCI Root Bridge Information HOB\r
+///\r
+typedef struct {\r
+  UINT32                                     Segment;               ///< Segment number.\r
+  UINT64                                     Supports;              ///< Supported attributes.\r
+                                                                    ///< Refer to EFI_PCI_ATTRIBUTE_xxx used by GetAttributes()\r
+                                                                    ///< and SetAttributes() in EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.\r
+  UINT64                                     Attributes;            ///< Initial attributes.\r
+                                                                    ///< Refer to EFI_PCI_ATTRIBUTE_xxx used by GetAttributes()\r
+                                                                    ///< 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
+  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
+                                                                    ///< in EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL.\r
+  UNIVERSAL_PAYLOAD_PCI_ROOT_BRIDGE_APERTURE Bus;                   ///< Bus aperture which can be used by the root bridge.\r
+  UNIVERSAL_PAYLOAD_PCI_ROOT_BRIDGE_APERTURE Io;                    ///< IO aperture which can be used by the root bridge.\r
+  UNIVERSAL_PAYLOAD_PCI_ROOT_BRIDGE_APERTURE Mem;                   ///< MMIO aperture below 4GB which can be used by the root bridge.\r
+  UNIVERSAL_PAYLOAD_PCI_ROOT_BRIDGE_APERTURE MemAbove4G;            ///< MMIO aperture above 4GB which can be used by the root bridge.\r
+  UNIVERSAL_PAYLOAD_PCI_ROOT_BRIDGE_APERTURE PMem;                  ///< Prefetchable MMIO aperture below 4GB which can be used by the root bridge.\r
+  UNIVERSAL_PAYLOAD_PCI_ROOT_BRIDGE_APERTURE PMemAbove4G;           ///< Prefetchable MMIO aperture above 4GB which can be used by the root bridge.\r
+  UINT32                                     HID;                   ///< PnP hardware ID of the root bridge. This value must match the corresponding\r
+                                                                    ///< _HID in the ACPI name space.\r
+  UINT32                                     UID;                   ///< Unique ID that is required by ACPI if two devices have the same _HID.\r
+                                                                    ///< This value must also match the corresponding _UID/_HID pair in the ACPI name space.\r
+} UNIVERSAL_PAYLOAD_PCI_ROOT_BRIDGE;\r
+\r
+typedef struct {\r
+  UNIVERSAL_PAYLOAD_GENERIC_HEADER   Header;\r
+  BOOLEAN                            ResourceAssigned;\r
+  UINT8                              Count;\r
+  UNIVERSAL_PAYLOAD_PCI_ROOT_BRIDGE  RootBridge[0];\r
+} UNIVERSAL_PAYLOAD_PCI_ROOT_BRIDGES;\r
+\r
+#pragma pack()\r
+\r
+#define UNIVERSAL_PAYLOAD_PCI_ROOT_BRIDGES_REVISION 1\r
+\r
+extern GUID gUniversalPayloadPciRootBridgeInfoGuid;\r
+\r
+#endif // UNIVERSAL_PAYLOAD_PCI_ROOT_BRIDGES_H_\r
index 45783f12c1266ee19ea2c063ad9b3c020c6608c1..4c71468bd32ccd858676e61adf5f4ebcc8e0da9c 100644 (file)
@@ -16,6 +16,8 @@
         ##     "<ErrorID>", "<KeyWord>"\r
         ## ]\r
         "ExceptionList": [\r
+            "8005", "UNIVERSAL_PAYLOAD_PCI_ROOT_BRIDGE.UID",\r
+            "8005", "UNIVERSAL_PAYLOAD_PCI_ROOT_BRIDGE.HID",\r
         ],\r
         ## Both file path and directory path are accepted.\r
         "IgnoreFiles": [\r
index 8d3838391516d28725688390d1aab9340f14fb64..5cee4e159a030357a26068a0956fe2929c892744 100644 (file)
   ## Include/Guid/MigratedFvInfo.h\r
   gEdkiiMigratedFvInfoGuid = { 0xc1ab12f7, 0x74aa, 0x408d, { 0xa2, 0xf4, 0xc6, 0xce, 0xfd, 0x17, 0x98, 0x71 } }\r
 \r
+  #\r
+  # GUID defined in UniversalPayload\r
+  #\r
+  ## Include/UniversalPayload/PciRootBridges.h\r
+  gUniversalPayloadPciRootBridgeInfoGuid = { 0xec4ebacb, 0x2638, 0x416e, { 0xbe, 0x80, 0xe5, 0xfa, 0x4b, 0x51, 0x19, 0x01 }}\r
+\r
 [Ppis]\r
   ## Include/Ppi/AtaController.h\r
   gPeiAtaControllerPpiGuid       = { 0xa45e60d1, 0xc719, 0x44aa, { 0xb0, 0x7a, 0xaa, 0x77, 0x7f, 0x85, 0x90, 0x6d }}\r