]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Include/Library/PciHostBridgeLib.h
b1dba0f754d7940a8362cfd7c9a027adc1a6f8ef
[mirror_edk2.git] / MdeModulePkg / Include / Library / PciHostBridgeLib.h
1 /** @file
2 PCI Host Bridge Library consumed by PciHostBridgeDxe driver returning
3 the platform specific information about the PCI Host Bridge.
4
5 Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
6 This program and the accompanying materials are
7 licensed and made available under the terms and conditions of
8 the BSD License which accompanies this distribution. The full
9 text of the license may be found at
10 http://opensource.org/licenses/bsd-license.php.
11
12 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
13 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
14
15 **/
16 #ifndef __PCI_HOST_BRIDGE_LIB_H__
17 #define __PCI_HOST_BRIDGE_LIB_H__
18
19 //
20 // (Base > Limit) indicates an aperture is not available.
21 //
22 typedef struct {
23 UINT64 Base;
24 UINT64 Limit;
25 } PCI_ROOT_BRIDGE_APERTURE;
26
27 typedef struct {
28 UINT32 Segment; ///< Segment number.
29 UINT64 Supports; ///< Supported attributes.
30 ///< Refer to EFI_PCI_ATTRIBUTE_xxx used by GetAttributes()
31 ///< and SetAttributes() in EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.
32 UINT64 Attributes; ///< Initial attributes.
33 ///< Refer to EFI_PCI_ATTRIBUTE_xxx used by GetAttributes()
34 ///< and SetAttributes() in EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.
35 BOOLEAN DmaAbove4G; ///< DMA above 4GB memory.
36 ///< Set to TRUE when root bridge supports DMA above 4GB memory.
37 UINT64 AllocationAttributes; ///< Allocation attributes.
38 ///< Refer to EFI_PCI_HOST_BRIDGE_COMBINE_MEM_PMEM and
39 ///< EFI_PCI_HOST_BRIDGE_MEM64_DECODE used by GetAllocAttributes()
40 ///< in EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL.
41 PCI_ROOT_BRIDGE_APERTURE Bus; ///< Bus aperture which can be used by the root bridge.
42 PCI_ROOT_BRIDGE_APERTURE Io; ///< IO aperture which can be used by the root bridge.
43 PCI_ROOT_BRIDGE_APERTURE Mem; ///< MMIO aperture below 4GB which can be used by the root bridge.
44 PCI_ROOT_BRIDGE_APERTURE MemAbove4G; ///< MMIO aperture above 4GB which can be used by the root bridge.
45 PCI_ROOT_BRIDGE_APERTURE PMem; ///< Prefetchable MMIO aperture below 4GB which can be used by the root bridge.
46 PCI_ROOT_BRIDGE_APERTURE PMemAbove4G; ///< Prefetchable MMIO aperture above 4GB which can be used by the root bridge.
47 EFI_DEVICE_PATH_PROTOCOL *DevicePath; ///< Device path.
48 } PCI_ROOT_BRIDGE;
49
50 /**
51 Return all the root bridge instances in an array.
52
53 @param Count Return the count of root bridge instances.
54
55 @return All the root bridge instances in an array.
56 The array should be passed into PciHostBridgeFreeRootBridges()
57 when it's not used.
58 **/
59 PCI_ROOT_BRIDGE *
60 EFIAPI
61 PciHostBridgeGetRootBridges (
62 UINTN *Count
63 );
64
65 /**
66 Free the root bridge instances array returned from PciHostBridgeGetRootBridges().
67
68 @param The root bridge instances array.
69 @param The count of the array.
70 **/
71 VOID
72 EFIAPI
73 PciHostBridgeFreeRootBridges (
74 PCI_ROOT_BRIDGE *Bridges,
75 UINTN Count
76 );
77
78 /**
79 Inform the platform that the resource conflict happens.
80
81 @param HostBridgeHandle Handle of the Host Bridge.
82 @param Configuration Pointer to PCI I/O and PCI memory resource descriptors.
83 The Configuration contains the resources for all the
84 root bridges. The resource for each root bridge is
85 terminated with END descriptor and an additional END
86 is appended indicating the end of the entire resources.
87 The resource descriptor field values follow the description
88 in EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL.SubmitResources().
89 **/
90 VOID
91 EFIAPI
92 PciHostBridgeResourceConflict (
93 EFI_HANDLE HostBridgeHandle,
94 VOID *Configuration
95 );
96
97 #endif