2 This file declares EFI PCI Hot Plug Init Protocol.
4 This protocol provides the necessary functionality to initialize the Hot Plug
5 Controllers (HPCs) and the buses that they control. This protocol also provides
6 information regarding resource padding.
9 This protocol is required only on platforms that support one or more PCI Hot
10 Plug* slots or CardBus sockets.
12 The EFI_PCI_HOT_PLUG_INIT_PROTOCOL provides a mechanism for the PCI bus enumerator
13 to properly initialize the HPCs and CardBus sockets that require initialization.
14 The HPC initialization takes place before the PCI enumeration process is complete.
15 There cannot be more than one instance of this protocol in a system. This protocol
16 is installed on its own separate handle.
18 Because the system may include multiple HPCs, one instance of this protocol
19 should represent all of them. The protocol functions use the device path of
20 the HPC to identify the HPC. When the PCI bus enumerator finds a root HPC, it
21 will call EFI_PCI_HOT_PLUG_INIT_PROTOCOL.InitializeRootHpc(). If InitializeRootHpc()
22 is unable to initialize a root HPC, the PCI enumerator will ignore that root HPC
23 and continue the enumeration process. If the HPC is not initialized, the devices
24 that it controls may not be initialized, and no resource padding will be provided.
26 From the standpoint of the PCI bus enumerator, HPCs are divided into the following
30 These HPCs must be initialized by calling InitializeRootHpc() during the
31 enumeration process. These HPCs will also require resource padding. The
32 platform code must have a priori knowledge of these devices and must know
33 how to initialize them. There may not be any way to access their PCI
34 configuration space before the PCI enumerator programs all the upstream
35 bridges and thus enables the path to these devices. The PCI bus enumerator
36 is responsible for determining the PCI bus address of the HPC before it
37 calls InitializeRootHpc().
39 These HPCs will not need explicit initialization during enumeration process.
40 These HPCs will require resource padding. The platform code does not have
41 to have a priori knowledge of these devices.
43 Copyright (c) 2007 - 2009, Intel Corporation
44 All rights reserved. This program and the accompanying materials
45 are licensed and made available under the terms and conditions of the BSD License
46 which accompanies this distribution. The full text of the license may be found at
47 http://opensource.org/licenses/bsd-license.php
49 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
50 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
52 @par Revision Reference:
53 This Protocol is defined in UEFI Platform Initialization Specification 1.2
58 #ifndef _EFI_PCI_HOT_PLUG_INIT_H_
59 #define _EFI_PCI_HOT_PLUG_INIT_H_
62 /// Global ID for the EFI_PCI_HOT_PLUG_INIT_PROTOCOL
64 #define EFI_PCI_HOT_PLUG_INIT_PROTOCOL_GUID \
66 0xaa0e8bc1, 0xdabc, 0x46b0, {0xa8, 0x44, 0x37, 0xb8, 0x16, 0x9b, 0x2b, 0xea } \
70 /// Forward declaration for EFI_PCI_HOT_PLUG_INIT_PROTOCOL
72 typedef struct _EFI_PCI_HOT_PLUG_INIT_PROTOCOL EFI_PCI_HOT_PLUG_INIT_PROTOCOL
;
75 /// Describes the current state of an HPC
77 typedef UINT16 EFI_HPC_STATE
;
80 /// The HPC initialization function was called and the HPC completed
81 /// initialization, but it was not enabled for some reason. The HPC may be
82 /// disabled in hardware, or it may be disabled due to user preferences,
83 /// hardware failure, or other reasons. No resource padding is required.
85 #define EFI_HPC_STATE_INITIALIZED 0x01
88 /// The HPC initialization function was called, the HPC completed
89 /// initialization, and it was enabled. Resource padding is required.
91 #define EFI_HPC_STATE_ENABLED 0x02
94 /// Location definition for PCI Hot Plug Controller
99 /// The device path to the root HPC. An HPC cannot control its parent buses.
100 /// The PCI bus driver requires this information so that it can pass the
101 /// correct HpcPciAddress to the InitializeRootHpc() and GetResourcePadding()
104 EFI_DEVICE_PATH_PROTOCOL
*HpcDevicePath
;
106 /// The device path to the Hot Plug Bus (HPB) that is controlled by the root
107 /// HPC. The PCI bus driver uses this information to check if a particular PCI
108 /// bus has hot-plug slots. The device path of a PCI bus is the same as the
109 /// device path of its parent. For Standard(PCI) Hot Plug Controllers (SHPCs)
110 /// and PCI Express*, HpbDevicePath is the same as HpcDevicePath.
112 EFI_DEVICE_PATH_PROTOCOL
*HpbDevicePath
;
116 /// Describes how resource padding should be applied
120 /// Apply the padding at a PCI bus level. In other words, the resources
121 /// that are allocated to the bus containing hot-plug slots are padded by
122 /// the specified amount. If the hot-plug bus is behind a PCI-to-PCI
123 /// bridge, the PCI-to-PCI bridge apertures will indicate the padding
127 /// Apply the padding at a PCI root bridge level. If a PCI root bridge
128 /// includes more than one hot-plug bus, the resource padding requests
129 /// for these buses are added together and the resources that are
130 /// allocated to the root bridge are padded by the specified amount. This
131 /// strategy may reduce the total amount of padding, but requires
132 /// reprogramming of PCI-to-PCI bridges in a hot-add event. If the hotplug
133 /// bus is behind a PCI-to-PCI bridge, the PCI-to-PCI bridge
134 /// apertures do not indicate the padding for that bus.
136 EfiPaddingPciRootBridge
137 } EFI_HPC_PADDING_ATTRIBUTES
;
140 Returns a list of root Hot Plug Controllers (HPCs) that require initialization
141 during the boot process.
143 This procedure returns a list of root HPCs. The PCI bus driver must initialize
144 these controllers during the boot process. The PCI bus driver may or may not be
145 able to detect these HPCs. If the platform includes a PCI-to-CardBus bridge, it
146 can be included in this list if it requires initialization. The HpcList must be
147 self consistent. An HPC cannot control any of its parent buses. Only one HPC can
148 control a PCI bus. Because this list includes only root HPCs, no HPC in the list
149 can be a child of another HPC. This policy must be enforced by the
150 EFI_PCI_HOT_PLUG_INIT_PROTOCOL. The PCI bus driver may not check for such
151 invalid conditions. The callee allocates the buffer HpcList
153 @param[in] This Pointer to the EFI_PCI_HOT_PLUG_INIT_PROTOCOL instance.
154 @param[out] HpcCount The number of root HPCs that were returned.
155 @param[out] HpcList The list of root HPCs. HpcCount defines the number of
156 elements in this list.
158 @retval EFI_SUCCESS HpcList was returned.
159 @retval EFI_OUT_OF_RESOURCES HpcList was not returned due to insufficient
161 @retval EFI_INVALID_PARAMETER HpcCount is NULL or HpcList is NULL.
166 (EFIAPI
*EFI_GET_ROOT_HPC_LIST
)(
167 IN EFI_PCI_HOT_PLUG_INIT_PROTOCOL
*This
,
169 OUT EFI_HPC_LOCATION
**HpcList
173 Initializes one root Hot Plug Controller (HPC). This process may causes
174 initialization of its subordinate buses.
176 This function initializes the specified HPC. At the end of initialization,
177 the hot-plug slots or sockets (controlled by this HPC) are powered and are
178 connected to the bus. All the necessary registers in the HPC are set up. For
179 a Standard (PCI) Hot Plug Controller (SHPC), the registers that must be set
180 up are defined in the PCI Standard Hot Plug Controller and Subsystem
183 @param[in] This Pointer to the EFI_PCI_HOT_PLUG_INIT_PROTOCOL instance.
184 @param[in] HpcDevicePath The device path to the HPC that is being initialized.
185 @param[in] HpcPciAddress The address of the HPC function on the PCI bus.
186 @param[in] Event The event that should be signaled when the HPC
187 initialization is complete. Set to NULL if the
188 caller wants to wait until the entire initialization
190 @param[out] HpcState The state of the HPC hardware. The state is
191 EFI_HPC_STATE_INITIALIZED or EFI_HPC_STATE_ENABLED.
193 @retval EFI_SUCCESS If Event is NULL, the specific HPC was successfully
194 initialized. If Event is not NULL, Event will be
195 signaled at a later time when initialization is complete.
196 @retval EFI_UNSUPPORTED This instance of EFI_PCI_HOT_PLUG_INIT_PROTOCOL
197 does not support the specified HPC.
198 @retval EFI_OUT_OF_RESOURCES Initialization failed due to insufficient
200 @retval EFI_INVALID_PARAMETER HpcState is NULL.
205 (EFIAPI
*EFI_INITIALIZE_ROOT_HPC
)(
206 IN EFI_PCI_HOT_PLUG_INIT_PROTOCOL
*This
,
207 IN EFI_DEVICE_PATH_PROTOCOL
*HpcDevicePath
,
208 IN UINT64 HpcPciAddress
,
209 IN EFI_EVENT Event
, OPTIONAL
210 OUT EFI_HPC_STATE
*HpcState
214 Returns the resource padding that is required by the PCI bus that is controlled
215 by the specified Hot Plug Controller (HPC).
217 This function returns the resource padding that is required by the PCI bus that
218 is controlled by the specified HPC. This member function is called for all the
219 root HPCs and nonroot HPCs that are detected by the PCI bus enumerator. This
220 function will be called before PCI resource allocation is completed. This function
221 must be called after all the root HPCs, with the possible exception of a
222 PCI-to-CardBus bridge, have completed initialization.
224 @param[in] This Pointer to the EFI_PCI_HOT_PLUG_INIT_PROTOCOL instance.
225 @param[in] HpcDevicePath The device path to the HPC.
226 @param[in] HpcPciAddress The address of the HPC function on the PCI bus.
227 @param[in] HpcState The state of the HPC hardware.
228 @param[out] Padding The amount of resource padding that is required by the
229 PCI bus under the control of the specified HPC.
230 @param[out] Attributes Describes how padding is accounted for. The padding
231 is returned in the form of ACPI 2.0 resource descriptors.
233 @retval EFI_SUCCESS The resource padding was successfully returned.
234 @retval EFI_UNSUPPORTED This instance of the EFI_PCI_HOT_PLUG_INIT_PROTOCOL
235 does not support the specified HPC.
236 @retval EFI_NOT_READY This function was called before HPC initialization
238 @retval EFI_INVALID_PARAMETER HpcState or Padding or Attributes is NULL.
239 @retval EFI_OUT_OF_RESOURCES ACPI 2.0 resource descriptors for Padding
240 cannot be allocated due to insufficient resources.
245 (EFIAPI
*EFI_GET_HOT_PLUG_PADDING
)(
246 IN EFI_PCI_HOT_PLUG_INIT_PROTOCOL
*This
,
247 IN EFI_DEVICE_PATH_PROTOCOL
*HpcDevicePath
,
248 IN UINT64 HpcPciAddress
,
249 OUT EFI_HPC_STATE
*HpcState
,
251 OUT EFI_HPC_PADDING_ATTRIBUTES
*Attributes
255 /// This protocol provides the necessary functionality to initialize the
256 /// Hot Plug Controllers (HPCs) and the buses that they control. This protocol
257 /// also provides information regarding resource padding.
259 struct _EFI_PCI_HOT_PLUG_INIT_PROTOCOL
{
261 /// Returns a list of root HPCs and the buses that they control.
263 EFI_GET_ROOT_HPC_LIST GetRootHpcList
;
266 /// Initializes the specified root HPC.
268 EFI_INITIALIZE_ROOT_HPC InitializeRootHpc
;
271 /// Returns the resource padding that is required by the HPC.
273 EFI_GET_HOT_PLUG_PADDING GetResourcePadding
;
276 extern EFI_GUID gEfiPciHotPlugInitProtocolGuid
;