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