]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Include/Library/PciHostBridgeLib.h
MdeModulePkg: PciHostBridgeDxe: don't assume extended config space
[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 BOOLEAN NoExtendedConfigSpace; ///< When FALSE, the root bridge supports
38 ///< Extended (4096-byte) Configuration Space.
39 ///< When TRUE, the root bridge supports
40 ///< 256-byte Configuration Space only.
41 UINT64 AllocationAttributes; ///< Allocation attributes.
42 ///< Refer to EFI_PCI_HOST_BRIDGE_COMBINE_MEM_PMEM and
43 ///< EFI_PCI_HOST_BRIDGE_MEM64_DECODE used by GetAllocAttributes()
44 ///< in EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL.
45 PCI_ROOT_BRIDGE_APERTURE Bus; ///< Bus aperture which can be used by the root bridge.
46 PCI_ROOT_BRIDGE_APERTURE Io; ///< IO aperture which can be used by the root bridge.
47 PCI_ROOT_BRIDGE_APERTURE Mem; ///< MMIO aperture below 4GB which can be used by the root bridge.
48 PCI_ROOT_BRIDGE_APERTURE MemAbove4G; ///< MMIO aperture above 4GB which can be used by the root bridge.
49 PCI_ROOT_BRIDGE_APERTURE PMem; ///< Prefetchable MMIO aperture below 4GB which can be used by the root bridge.
50 PCI_ROOT_BRIDGE_APERTURE PMemAbove4G; ///< Prefetchable MMIO aperture above 4GB which can be used by the root bridge.
51 EFI_DEVICE_PATH_PROTOCOL *DevicePath; ///< Device path.
52 } PCI_ROOT_BRIDGE;
53
54 /**
55 Return all the root bridge instances in an array.
56
57 @param Count Return the count of root bridge instances.
58
59 @return All the root bridge instances in an array.
60 The array should be passed into PciHostBridgeFreeRootBridges()
61 when it's not used.
62 **/
63 PCI_ROOT_BRIDGE *
64 EFIAPI
65 PciHostBridgeGetRootBridges (
66 UINTN *Count
67 );
68
69 /**
70 Free the root bridge instances array returned from PciHostBridgeGetRootBridges().
71
72 @param The root bridge instances array.
73 @param The count of the array.
74 **/
75 VOID
76 EFIAPI
77 PciHostBridgeFreeRootBridges (
78 PCI_ROOT_BRIDGE *Bridges,
79 UINTN Count
80 );
81
82 /**
83 Inform the platform that the resource conflict happens.
84
85 @param HostBridgeHandle Handle of the Host Bridge.
86 @param Configuration Pointer to PCI I/O and PCI memory resource descriptors.
87 The Configuration contains the resources for all the
88 root bridges. The resource for each root bridge is
89 terminated with END descriptor and an additional END
90 is appended indicating the end of the entire resources.
91 The resource descriptor field values follow the description
92 in EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL.SubmitResources().
93 **/
94 VOID
95 EFIAPI
96 PciHostBridgeResourceConflict (
97 EFI_HANDLE HostBridgeHandle,
98 VOID *Configuration
99 );
100
101 #endif