]> git.proxmox.com Git - mirror_edk2.git/blobdiff - UefiPayloadPkg/Library/PciHostBridgeLib/PciHostBridge.h
UefiPayloadPkg: UefiPayload retrieve PCI root bridge from Guid Hob
[mirror_edk2.git] / UefiPayloadPkg / Library / PciHostBridgeLib / PciHostBridge.h
index c2961b3bee1b6aaa2f36656d530a9cbe6434c286..3eee1fbeac863f2e41b1a463fc1aeeaa5d15c63c 100644 (file)
@@ -2,7 +2,7 @@
   Header file of PciHostBridgeLib.\r
 \r
   Copyright (C) 2016, Red Hat, Inc.\r
-  Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2016 - 2021, Intel Corporation. All rights reserved.<BR>\r
 \r
   SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 #ifndef _PCI_HOST_BRIDGE_H\r
 #define _PCI_HOST_BRIDGE_H\r
 \r
+#include <UniversalPayload/PciRootBridges.h>\r
+\r
 typedef struct {\r
   ACPI_HID_DEVICE_PATH     AcpiDevicePath;\r
   EFI_DEVICE_PATH_PROTOCOL EndDevicePath;\r
 } CB_PCI_ROOT_BRIDGE_DEVICE_PATH;\r
 \r
+/**\r
+  Scan for all root bridges in platform.\r
+\r
+  @param[out] NumberOfRootBridges  Number of root bridges detected\r
+\r
+  @retval     Pointer to the allocated PCI_ROOT_BRIDGE structure array.\r
+**/\r
 PCI_ROOT_BRIDGE *\r
 ScanForRootBridges (\r
-  UINTN      *NumberOfRootBridges\r
+  OUT UINTN      *NumberOfRootBridges\r
+);\r
+\r
+/**\r
+  Scan for all root bridges from Universal Payload PciRootBridgeInfoHob\r
+\r
+  @param[in]  PciRootBridgeInfo    Pointer of Universal Payload PCI Root Bridge Info Hob\r
+  @param[out] NumberOfRootBridges  Number of root bridges detected\r
+\r
+  @retval     Pointer to the allocated PCI_ROOT_BRIDGE structure array.\r
+\r
+**/\r
+PCI_ROOT_BRIDGE *\r
+RetrieveRootBridgeInfoFromHob (\r
+  IN  UNIVERSAL_PAYLOAD_PCI_ROOT_BRIDGES  *PciRootBridgeInfo,\r
+  OUT UINTN                               *NumberOfRootBridges\r
 );\r
 \r
 /**\r
@@ -77,4 +101,16 @@ InitRootBridge (
   OUT PCI_ROOT_BRIDGE          *RootBus\r
 );\r
 \r
+/**\r
+  Initialize DevicePath for a PCI_ROOT_BRIDGE.\r
+  @param[in] HID               HID for device path\r
+  @param[in] UID               UID for device path\r
+\r
+  @retval A pointer to the new created device patch.\r
+**/\r
+EFI_DEVICE_PATH_PROTOCOL *\r
+CreateRootBridgeDevicePath (\r
+  IN     UINT32                   HID,\r
+  IN     UINT32                   UID\r
+);\r
 #endif\r