]> git.proxmox.com Git - mirror_edk2.git/blame - UefiPayloadPkg/Library/PciHostBridgeLib/PciHostBridge.h
UefiPayloadPkg: Enhance UEFI payload for coreboot and Slim Bootloader
[mirror_edk2.git] / UefiPayloadPkg / Library / PciHostBridgeLib / PciHostBridge.h
CommitLineData
04af8bf2
DG
1/** @file\r
2 Header file of PciHostBridgeLib.\r
3\r
4 Copyright (C) 2016, Red Hat, Inc.\r
5 Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>\r
6\r
7 SPDX-License-Identifier: BSD-2-Clause-Patent\r
8\r
9**/\r
10\r
11#ifndef _PCI_HOST_BRIDGE_H\r
12#define _PCI_HOST_BRIDGE_H\r
13\r
14typedef struct {\r
15 ACPI_HID_DEVICE_PATH AcpiDevicePath;\r
16 EFI_DEVICE_PATH_PROTOCOL EndDevicePath;\r
17} CB_PCI_ROOT_BRIDGE_DEVICE_PATH;\r
18\r
19PCI_ROOT_BRIDGE *\r
20ScanForRootBridges (\r
21 UINTN *NumberOfRootBridges\r
22);\r
23\r
24/**\r
25 Initialize a PCI_ROOT_BRIDGE structure.\r
26\r
27 @param[in] Supports Supported attributes.\r
28\r
29 @param[in] Attributes Initial attributes.\r
30\r
31 @param[in] AllocAttributes Allocation attributes.\r
32\r
33 @param[in] RootBusNumber The bus number to store in RootBus.\r
34\r
35 @param[in] MaxSubBusNumber The inclusive maximum bus number that can be\r
36 assigned to any subordinate bus found behind any\r
37 PCI bridge hanging off this root bus.\r
38\r
39 The caller is responsible for ensuring that\r
40 RootBusNumber <= MaxSubBusNumber. If\r
41 RootBusNumber equals MaxSubBusNumber, then the\r
42 root bus has no room for subordinate buses.\r
43\r
44 @param[in] Io IO aperture.\r
45\r
46 @param[in] Mem MMIO aperture.\r
47\r
48 @param[in] MemAbove4G MMIO aperture above 4G.\r
49\r
50 @param[in] PMem Prefetchable MMIO aperture.\r
51\r
52 @param[in] PMemAbove4G Prefetchable MMIO aperture above 4G.\r
53\r
54 @param[out] RootBus The PCI_ROOT_BRIDGE structure (allocated by the\r
55 caller) that should be filled in by this\r
56 function.\r
57\r
58 @retval EFI_SUCCESS Initialization successful. A device path\r
59 consisting of an ACPI device path node, with\r
60 UID = RootBusNumber, has been allocated and\r
61 linked into RootBus.\r
62\r
63 @retval EFI_OUT_OF_RESOURCES Memory allocation failed.\r
64**/\r
65EFI_STATUS\r
66InitRootBridge (\r
67 IN UINT64 Supports,\r
68 IN UINT64 Attributes,\r
69 IN UINT64 AllocAttributes,\r
70 IN UINT8 RootBusNumber,\r
71 IN UINT8 MaxSubBusNumber,\r
72 IN PCI_ROOT_BRIDGE_APERTURE *Io,\r
73 IN PCI_ROOT_BRIDGE_APERTURE *Mem,\r
74 IN PCI_ROOT_BRIDGE_APERTURE *MemAbove4G,\r
75 IN PCI_ROOT_BRIDGE_APERTURE *PMem,\r
76 IN PCI_ROOT_BRIDGE_APERTURE *PMemAbove4G,\r
77 OUT PCI_ROOT_BRIDGE *RootBus\r
78);\r
79\r
80#endif\r