]> git.proxmox.com Git - mirror_edk2.git/blame_incremental - IntelFrameworkPkg/Include/Protocol/PciHotPlugInit.h
add detailed description for functions.
[mirror_edk2.git] / IntelFrameworkPkg / Include / Protocol / PciHotPlugInit.h
... / ...
CommitLineData
1/** @file\r
2 This file declares EFI PCI Hot Plug Init Protocol.\r
3 This protocol provides the necessary functionality to initialize the Hot Plug Controllers (HPCs) and\r
4 the buses that they control. This protocol also provides information regarding resource padding.\r
5\r
6 Copyright (c) 2007 - 2009, Intel Corporation\r
7 All rights reserved. This program and the accompanying materials\r
8 are licensed and made available under the terms and conditions of the BSD License\r
9 which accompanies this distribution. The full 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 @par Revision Reference:\r
16 This protocol is defined in Framework of EFI Hot Plug Pci Initialization Protocol Spec\r
17 Version 0.9\r
18\r
19**/\r
20\r
21#ifndef _EFI_PCI_HOT_PLUG_INIT_H_\r
22#define _EFI_PCI_HOT_PLUG_INIT_H_\r
23\r
24#include <PiDxe.h>\r
25\r
26///\r
27/// Global ID for the PCI Hot Plug Protocol\r
28///\r
29#define EFI_PCI_HOT_PLUG_INIT_PROTOCOL_GUID \\r
30 { \\r
31 0xaa0e8bc1, 0xdabc, 0x46b0, {0xa8, 0x44, 0x37, 0xb8, 0x16, 0x9b, 0x2b, 0xea } \\r
32 }\r
33\r
34typedef struct _EFI_PCI_HOT_PLUG_INIT_PROTOCOL EFI_PCI_HOT_PLUG_INIT_PROTOCOL;\r
35\r
36///\r
37/// Current state of an HPC\r
38///\r
39typedef UINT16 EFI_HPC_STATE;\r
40\r
41///\r
42/// The HPC initialization function was called and the HPC completed \r
43/// initialization, but it was not enabled for some reason. The HPC may be \r
44/// disabled in hardware, or it may be disabled due to user preferences, \r
45/// hardware failure, or other reasons. No resource padding is required.\r
46///\r
47#define EFI_HPC_STATE_INITIALIZED 0x01\r
48\r
49///\r
50/// The HPC initialization function was called, the HPC completed \r
51/// initialization, and it was enabled. Resource padding is required.\r
52///\r
53#define EFI_HPC_STATE_ENABLED 0x02\r
54\r
55///\r
56/// Location definition for PCI Hot Plug Controller\r
57///\r
58typedef struct{\r
59 ///\r
60 /// The device path to the Root HPC\r
61 ///\r
62 EFI_DEVICE_PATH_PROTOCOL *HpcDevicePath;\r
63 ///\r
64 /// The device path to the Hot Plug Bus (HPB) that is controlled by \r
65 /// the root HPC.\r
66 ///\r
67 EFI_DEVICE_PATH_PROTOCOL *HpbDevicePath;\r
68} EFI_HPC_LOCATION;\r
69\r
70\r
71///\r
72/// Describes how resource padding should be applied\r
73///\r
74typedef enum{\r
75 EfiPaddingPciBus,\r
76 EfiPaddingPciRootBridge\r
77} EFI_HPC_PADDING_ATTRIBUTES;\r
78\r
79/**\r
80 Returns a list of root Hot Plug Controllers (HPCs) that require initialization\r
81 during the boot process.\r
82\r
83 This procedure returns a list of root HPCs. The PCI bus driver must initialize these controllers \r
84 during the boot process. The PCI bus driver may or may not be able to detect these HPCs. If the \r
85 platform includes a PCI-to-CardBus bridge, it can be included in this list if it requires initialization. \r
86 The HpcList must be self consistent. An HPC cannot control any of its parent buses. Only one HPC \r
87 can control a PCI bus. Because this list includes only root HPCs, no HPC in the list can be a child of \r
88 another HPC. This policy must be enforced by the EFI_PCI_HOT_PLUG_INIT_PROTOCOL. \r
89 The PCI bus driver may not check for such invalid conditions. \r
90 The callee allocates the buffer HpcList\r
91\r
92 @param This Pointer to the EFI_PCI_HOT_PLUG_INIT_PROTOCOL instance.\r
93 @param HpcCount The number of root HPCs that were returned.\r
94 @param HpcList The list of root HPCs. HpcCount defines the number of\r
95 elements in this list.\r
96\r
97 @retval EFI_SUCCESS HpcList was returned.\r
98 @retval EFI_OUT_OF_RESOURCES HpcList was not returned due to insufficient resources.\r
99 @retval EFI_INVALID_PARAMETER HpcCount is NULL or HpcList is NULL.\r
100\r
101**/\r
102typedef\r
103EFI_STATUS\r
104(EFIAPI *EFI_GET_ROOT_HPC_LIST)(\r
105 IN EFI_PCI_HOT_PLUG_INIT_PROTOCOL *This,\r
106 OUT UINTN *HpcCount,\r
107 OUT EFI_HPC_LOCATION **HpcList\r
108);\r
109\r
110/**\r
111 Initializes one root Hot Plug Controller (HPC). This process may causes\r
112 initialization of its subordinate buses.\r
113 \r
114 This function initializes the specified HPC. At the end of initialization, the hot-plug slots or sockets \r
115 (controlled by this HPC) are powered and are connected to the bus. All the necessary registers in the \r
116 HPC are set up. For a Standard (PCI) Hot Plug Controller (SHPC), the registers that must be set up \r
117 are defined in the PCI Standard Hot Plug Controller and Subsystem Specification.\r
118\r
119 @param This Pointer to the EFI_PCI_HOT_PLUG_INIT_PROTOCOL instance.\r
120 @param HpcDevicePath The device path to the HPC that is being initialized.\r
121 @param HpcPciAddress The address of the HPC function on the PCI bus.\r
122 @param Event The event that should be signaled when the HPC initialization\r
123 is complete.\r
124 @param HpcState The state of the HPC hardware. The state is EFI_HPC_STATE_INITIALIZED\r
125 or EFI_HPC_STATE_ENABLED.\r
126\r
127 @retval EFI_SUCCESS If Event is NULL, the specific HPC was successfully\r
128 initialized. If Event is not NULL, Event will be signaled at a later time\r
129 when initialization is complete.\r
130 @retval EFI_UNSUPPORTED This instance of EFI_PCI_HOT_PLUG_INIT_PROTOCOL\r
131 does not support the specified HPC.\r
132 @retval EFI_OUT_OF_RESOURCES Initialization failed due to insufficient\r
133 resources.\r
134 @retval EFI_INVALID_PARAMETER HpcState is NULL.\r
135\r
136**/\r
137typedef\r
138EFI_STATUS\r
139(EFIAPI *EFI_INITIALIZE_ROOT_HPC)(\r
140 IN EFI_PCI_HOT_PLUG_INIT_PROTOCOL *This,\r
141 IN EFI_DEVICE_PATH_PROTOCOL *HpcDevicePath,\r
142 IN UINT64 HpcPciAddress,\r
143 IN EFI_EVENT Event, OPTIONAL\r
144 OUT EFI_HPC_STATE *HpcState\r
145);\r
146\r
147/**\r
148 Returns the resource padding that is required by the PCI bus that is controlled\r
149 by the specified Hot Plug Controller (HPC).\r
150\r
151 This function returns the resource padding that is required by the PCI bus that is controlled by the \r
152 specified HPC. This member function is called for all the root HPCs and nonroot HPCs that are \r
153 detected by the PCI bus enumerator. This function will be called before PCI resource allocation is \r
154 completed. This function must be called after all the root HPCs, with the possible exception of a \r
155 PCI-to-CardBus bridge, have completed initialization.\r
156\r
157 @param This Pointer to the EFI_PCI_HOT_PLUG_INIT_PROTOCOL instance.\r
158 @param HpcDevicePath The device path to the HPC.\r
159 @param HpcPciAddress The address of the HPC function on the PCI bus.\r
160 @param HpcState The state of the HPC hardware.\r
161 @param Padding The amount of resource padding that is required by the\r
162 PCI bus under the control of the specified HPC.\r
163 @param Attributes Describes how padding is accounted for. The padding\r
164 is returned in the form of ACPI 2.0 resource descriptors.\r
165\r
166 @retval EFI_SUCCESS The resource padding was successfully returned.\r
167 @retval EFI_UNSUPPORTED This instance of the EFI_PCI_HOT_PLUG_INIT_PROTOCOL\r
168 does not support the specified HPC.\r
169 @retval EFI_NOT_READY This function was called before HPC initialization is complete.\r
170 @retval EFI_INVALID_PARAMETER HpcState or Padding or Attributes is NULL.\r
171 @retval EFI_OUT_OF_RESOURCES ACPI 2.0 resource descriptors for Padding\r
172 cannot be allocated due to insufficient resources.\r
173\r
174**/\r
175typedef\r
176EFI_STATUS\r
177(EFIAPI *EFI_GET_HOT_PLUG_PADDING)(\r
178 IN EFI_PCI_HOT_PLUG_INIT_PROTOCOL *This,\r
179 IN EFI_DEVICE_PATH_PROTOCOL *HpcDevicePath,\r
180 IN UINT64 HpcPciAddress,\r
181 OUT EFI_HPC_STATE *HpcState,\r
182 OUT VOID **Padding,\r
183 OUT EFI_HPC_PADDING_ATTRIBUTES *Attributes\r
184);\r
185\r
186\r
187//\r
188// Prototypes for the PCI Hot Plug Init Protocol\r
189//\r
190\r
191///\r
192/// This protocol provides the necessary functionality to initialize the\r
193/// Hot Plug Controllers (HPCs) and the buses that they control. This protocol\r
194/// also provides information regarding resource padding.\r
195///\r
196struct _EFI_PCI_HOT_PLUG_INIT_PROTOCOL {\r
197 ///\r
198 /// Returns a list of root HPCs and the buses that they control.\r
199 ///\r
200 EFI_GET_ROOT_HPC_LIST GetRootHpcList;\r
201 \r
202 ///\r
203 /// Initializes the specified root HPC.\r
204 ///\r
205 EFI_INITIALIZE_ROOT_HPC InitializeRootHpc;\r
206 \r
207 ///\r
208 /// Returns the resource padding that is required by the HPC.\r
209 ///\r
210 EFI_GET_HOT_PLUG_PADDING GetResourcePadding;\r
211};\r
212\r
213extern EFI_GUID gEfiPciHotPlugInitProtocolGuid;\r
214\r
215#endif\r