xref: /freebsd/sys/contrib/edk2/Include/Protocol/PciPlatform.h (revision f439973d6726c3be929c8fb3b1545b8b1744abc3)
1*f439973dSWarner Losh /** @file
2*f439973dSWarner Losh   This file declares PlatfromOpRom protocols that provide the interface between
3*f439973dSWarner Losh   the PCI bus driver/PCI Host Bridge Resource Allocation driver and a platform-specific
4*f439973dSWarner Losh   driver to describe the unique features of a platform.
5*f439973dSWarner Losh   This protocol is optional.
6*f439973dSWarner Losh 
7*f439973dSWarner Losh Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
8*f439973dSWarner Losh SPDX-License-Identifier: BSD-2-Clause-Patent
9*f439973dSWarner Losh 
10*f439973dSWarner Losh   @par Revision Reference:
11*f439973dSWarner Losh   This Protocol is defined in UEFI Platform Initialization Specification 1.2
12*f439973dSWarner Losh   Volume 5: Standards
13*f439973dSWarner Losh 
14*f439973dSWarner Losh **/
15*f439973dSWarner Losh 
16*f439973dSWarner Losh #ifndef _PCI_PLATFORM_H_
17*f439973dSWarner Losh #define _PCI_PLATFORM_H_
18*f439973dSWarner Losh 
19*f439973dSWarner Losh ///
20*f439973dSWarner Losh /// This file must be included because the EFI_PCI_PLATFORM_PROTOCOL uses
21*f439973dSWarner Losh /// EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PHASE.
22*f439973dSWarner Losh ///
23*f439973dSWarner Losh #include <Protocol/PciHostBridgeResourceAllocation.h>
24*f439973dSWarner Losh 
25*f439973dSWarner Losh ///
26*f439973dSWarner Losh /// Global ID for the EFI_PCI_PLATFORM_PROTOCOL.
27*f439973dSWarner Losh ///
28*f439973dSWarner Losh #define EFI_PCI_PLATFORM_PROTOCOL_GUID \
29*f439973dSWarner Losh   { \
30*f439973dSWarner Losh     0x7d75280, 0x27d4, 0x4d69, {0x90, 0xd0, 0x56, 0x43, 0xe2, 0x38, 0xb3, 0x41} \
31*f439973dSWarner Losh   }
32*f439973dSWarner Losh 
33*f439973dSWarner Losh ///
34*f439973dSWarner Losh /// Forward declaration for EFI_PCI_PLATFORM_PROTOCOL.
35*f439973dSWarner Losh ///
36*f439973dSWarner Losh typedef struct _EFI_PCI_PLATFORM_PROTOCOL EFI_PCI_PLATFORM_PROTOCOL;
37*f439973dSWarner Losh 
38*f439973dSWarner Losh ///
39*f439973dSWarner Losh /// EFI_PCI_PLATFORM_POLICY that is a bitmask with the following legal combinations:
40*f439973dSWarner Losh ///   - EFI_RESERVE_NONE_IO_ALIAS:<BR>
41*f439973dSWarner Losh ///       Does not set aside either ISA or VGA I/O resources during PCI
42*f439973dSWarner Losh ///       enumeration. By using this selection, the platform indicates that it does
43*f439973dSWarner Losh ///       not want to support a PCI device that requires ISA or legacy VGA
44*f439973dSWarner Losh ///       resources. If a PCI device driver asks for these resources, the request
45*f439973dSWarner Losh ///       will be turned down.
46*f439973dSWarner Losh ///   - EFI_RESERVE_ISA_IO_ALIAS | EFI_RESERVE_VGA_IO_ALIAS:<BR>
47*f439973dSWarner Losh ///       Sets aside the ISA I/O range and all the aliases during PCI
48*f439973dSWarner Losh ///       enumeration. VGA I/O ranges and aliases are included in ISA alias
49*f439973dSWarner Losh ///       ranges. In this scheme, seventy-five percent of the I/O space remains unused.
50*f439973dSWarner Losh ///       By using this selection, the platform indicates that it wants to support
51*f439973dSWarner Losh ///       PCI devices that require the following, at the cost of wasted I/O space:
52*f439973dSWarner Losh ///       ISA range and its aliases
53*f439973dSWarner Losh ///       Legacy VGA range and its aliases
54*f439973dSWarner Losh ///       The PCI bus driver will not allocate I/O addresses out of the ISA I/O
55*f439973dSWarner Losh ///       range and its aliases. The following are the ISA I/O ranges:
56*f439973dSWarner Losh ///         - n100..n3FF
57*f439973dSWarner Losh ///         - n500..n7FF
58*f439973dSWarner Losh ///         - n900..nBFF
59*f439973dSWarner Losh ///         - nD00..nFFF
60*f439973dSWarner Losh ///
61*f439973dSWarner Losh ///       In this case, the PCI bus driver will ask the PCI host bridge driver for
62*f439973dSWarner Losh ///       larger I/O ranges. The PCI host bridge driver is not aware of the ISA
63*f439973dSWarner Losh ///       aliasing policy and merely attempts to allocate the requested ranges.
64*f439973dSWarner Losh ///       The first device that requests the legacy VGA range will get all the
65*f439973dSWarner Losh ///       legacy VGA range plus its aliased addresses forwarded to it. The first
66*f439973dSWarner Losh ///       device that requests the legacy ISA range will get all the legacy ISA
67*f439973dSWarner Losh ///       range, plus its aliased addresses, forwarded to it.
68*f439973dSWarner Losh ///   - EFI_RESERVE_ISA_IO_NO_ALIAS | EFI_RESERVE_VGA_IO_ALIAS:<BR>
69*f439973dSWarner Losh ///       Sets aside the ISA I/O range (0x100 - 0x3FF) during PCI enumeration
70*f439973dSWarner Losh ///       and the aliases of the VGA I/O ranges. By using this selection, the
71*f439973dSWarner Losh ///       platform indicates that it will support VGA devices that require VGA
72*f439973dSWarner Losh ///       ranges, including those that require VGA aliases. The platform further
73*f439973dSWarner Losh ///       wants to support non-VGA devices that ask for the ISA range (0x100 -
74*f439973dSWarner Losh ///       3FF), but not if it also asks for the ISA aliases. The PCI bus driver will
75*f439973dSWarner Losh ///       not allocate I/O addresses out of the legacy ISA I/O range (0x100 -
76*f439973dSWarner Losh ///       0x3FF) range or the aliases of the VGA I/O range. If a PCI device
77*f439973dSWarner Losh ///       driver asks for the ISA I/O ranges, including aliases, the request will be
78*f439973dSWarner Losh ///       turned down. The first device that requests the legacy VGA range will
79*f439973dSWarner Losh ///       get all the legacy VGA range plus its aliased addresses forwarded to
80*f439973dSWarner Losh ///       it. When the legacy VGA device asks for legacy VGA ranges and its
81*f439973dSWarner Losh ///       aliases, all the upstream PCI-to-PCI bridges must be set up to perform
82*f439973dSWarner Losh ///       10-bit decode on legacy VGA ranges. To prevent two bridges from
83*f439973dSWarner Losh ///       positively decoding the same address, all PCI-to-PCI bridges that are
84*f439973dSWarner Losh ///       peers to this bridge will have to be set up to not decode ISA aliased
85*f439973dSWarner Losh ///       ranges. In that case, all the devices behind the peer bridges can
86*f439973dSWarner Losh ///       occupy only I/O addresses that are not ISA aliases. This is a limitation
87*f439973dSWarner Losh ///       of PCI-to-PCI bridges and is described in the white paper PCI-to-PCI
88*f439973dSWarner Losh ///       Bridges and Card Bus Controllers on Windows 2000, Windows XP,
89*f439973dSWarner Losh ///       and Windows Server 2003. The PCI enumeration process must be
90*f439973dSWarner Losh ///       cognizant of this restriction.
91*f439973dSWarner Losh ///   - EFI_RESERVE_ISA_IO_NO_ALIAS | EFI_RESERVE_VGA_IO_NO_ALIAS:<BR>
92*f439973dSWarner Losh ///       Sets aside the ISA I/O range (0x100 - 0x3FF) during PCI enumeration.
93*f439973dSWarner Losh ///       VGA I/O ranges are included in the ISA range. By using this selection,
94*f439973dSWarner Losh ///       the platform indicates that it wants to support PCI devices that require
95*f439973dSWarner Losh ///       the ISA range and legacy VGA range, but it does not want to support
96*f439973dSWarner Losh ///       devices that require ISA alias ranges or VGA alias ranges. The PCI
97*f439973dSWarner Losh ///       bus driver will not allocate I/O addresses out of the legacy ISA I/O
98*f439973dSWarner Losh ///       range (0x100-0x3FF). If a PCI device driver asks for the ISA I/O
99*f439973dSWarner Losh ///       ranges, including aliases, the request will be turned down. By using
100*f439973dSWarner Losh ///       this selection, the platform indicates that it will support VGA devices
101*f439973dSWarner Losh ///       that require VGA ranges, but it will not support VGA devices that
102*f439973dSWarner Losh ///       require VGA aliases. To truly support 16-bit VGA decode, all the PCIto-
103*f439973dSWarner Losh ///       PCI bridges that are upstream to a VGA device, as well as
104*f439973dSWarner Losh ///       upstream to the parent PCI root bridge, must support 16-bit VGA I/O
105*f439973dSWarner Losh ///       decode. See the PCI-to-PCI Bridge Architecture Specification for
106*f439973dSWarner Losh ///       information regarding the 16-bit VGA decode support. This
107*f439973dSWarner Losh ///       requirement must hold true for every VGA device in the system. If any
108*f439973dSWarner Losh ///       of these bridges does not support 16-bit VGA decode, it will positively
109*f439973dSWarner Losh ///       decode all the aliases of the VGA I/O ranges and this selection must
110*f439973dSWarner Losh ///       be treated like EFI_RESERVE_ISA_IO_NO_ALIAS |
111*f439973dSWarner Losh ///       EFI_RESERVE_VGA_IO_ALIAS.
112*f439973dSWarner Losh ///
113*f439973dSWarner Losh typedef UINT32 EFI_PCI_PLATFORM_POLICY;
114*f439973dSWarner Losh 
115*f439973dSWarner Losh ///
116*f439973dSWarner Losh /// Does not set aside either ISA or VGA I/O resources during PCI
117*f439973dSWarner Losh /// enumeration.
118*f439973dSWarner Losh ///
119*f439973dSWarner Losh #define     EFI_RESERVE_NONE_IO_ALIAS  0x0000
120*f439973dSWarner Losh 
121*f439973dSWarner Losh ///
122*f439973dSWarner Losh /// Sets aside ISA I/O range and all aliases:
123*f439973dSWarner Losh ///   - n100..n3FF
124*f439973dSWarner Losh ///   - n500..n7FF
125*f439973dSWarner Losh ///   - n900..nBFF
126*f439973dSWarner Losh ///   - nD00..nFFF.
127*f439973dSWarner Losh ///
128*f439973dSWarner Losh #define     EFI_RESERVE_ISA_IO_ALIAS  0x0001
129*f439973dSWarner Losh 
130*f439973dSWarner Losh ///
131*f439973dSWarner Losh /// Sets aside ISA I/O range 0x100-0x3FF.
132*f439973dSWarner Losh ///
133*f439973dSWarner Losh #define     EFI_RESERVE_ISA_IO_NO_ALIAS  0x0002
134*f439973dSWarner Losh 
135*f439973dSWarner Losh ///
136*f439973dSWarner Losh /// Sets aside VGA I/O ranges and all aliases.
137*f439973dSWarner Losh ///
138*f439973dSWarner Losh #define     EFI_RESERVE_VGA_IO_ALIAS  0x0004
139*f439973dSWarner Losh 
140*f439973dSWarner Losh ///
141*f439973dSWarner Losh /// Sets aside VGA I/O ranges
142*f439973dSWarner Losh ///
143*f439973dSWarner Losh #define     EFI_RESERVE_VGA_IO_NO_ALIAS  0x0008
144*f439973dSWarner Losh 
145*f439973dSWarner Losh ///
146*f439973dSWarner Losh /// EFI_PCI_EXECUTION_PHASE is used to call a platform protocol and execute
147*f439973dSWarner Losh /// platform-specific code.
148*f439973dSWarner Losh ///
149*f439973dSWarner Losh typedef enum {
150*f439973dSWarner Losh   ///
151*f439973dSWarner Losh   /// The phase that indicates the entry point to the PCI Bus Notify phase. This
152*f439973dSWarner Losh   /// platform hook is called before the PCI bus driver calls the
153*f439973dSWarner Losh   /// EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL driver.
154*f439973dSWarner Losh   ///
155*f439973dSWarner Losh   BeforePciHostBridge = 0,
156*f439973dSWarner Losh   ///
157*f439973dSWarner Losh   /// The phase that indicates the entry point to the PCI Bus Notify phase. This
158*f439973dSWarner Losh   /// platform hook is called before the PCI bus driver calls the
159*f439973dSWarner Losh   /// EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL driver.
160*f439973dSWarner Losh   ///
161*f439973dSWarner Losh   ChipsetEntry = 0,
162*f439973dSWarner Losh   ///
163*f439973dSWarner Losh   /// The phase that indicates the exit point to the Chipset Notify phase before
164*f439973dSWarner Losh   /// returning to the PCI Bus Driver Notify phase. This platform hook is called after
165*f439973dSWarner Losh   /// the PCI bus driver calls the EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL
166*f439973dSWarner Losh   /// driver.
167*f439973dSWarner Losh   ///
168*f439973dSWarner Losh   AfterPciHostBridge = 1,
169*f439973dSWarner Losh   ///
170*f439973dSWarner Losh   /// The phase that indicates the exit point to the Chipset Notify phase before
171*f439973dSWarner Losh   /// returning to the PCI Bus Driver Notify phase. This platform hook is called after
172*f439973dSWarner Losh   /// the PCI bus driver calls the EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL
173*f439973dSWarner Losh   /// driver.
174*f439973dSWarner Losh   ///
175*f439973dSWarner Losh   ChipsetExit = 1,
176*f439973dSWarner Losh   MaximumChipsetPhase
177*f439973dSWarner Losh } EFI_PCI_EXECUTION_PHASE;
178*f439973dSWarner Losh 
179*f439973dSWarner Losh typedef EFI_PCI_EXECUTION_PHASE EFI_PCI_CHIPSET_EXECUTION_PHASE;
180*f439973dSWarner Losh 
181*f439973dSWarner Losh /**
182*f439973dSWarner Losh   The notification from the PCI bus enumerator to the platform that it is
183*f439973dSWarner Losh   about to enter a certain phase during the enumeration process.
184*f439973dSWarner Losh 
185*f439973dSWarner Losh   The PlatformNotify() function can be used to notify the platform driver so that
186*f439973dSWarner Losh   it can perform platform-specific actions. No specific actions are required.
187*f439973dSWarner Losh   Eight notification points are defined at this time. More synchronization points
188*f439973dSWarner Losh   may be added as required in the future. The PCI bus driver calls the platform driver
189*f439973dSWarner Losh   twice for every Phase-once before the PCI Host Bridge Resource Allocation Protocol
190*f439973dSWarner Losh   driver is notified, and once after the PCI Host Bridge Resource Allocation Protocol
191*f439973dSWarner Losh   driver has been notified.
192*f439973dSWarner Losh   This member function may not perform any error checking on the input parameters. It
193*f439973dSWarner Losh   also does not return any error codes. If this member function detects any error condition,
194*f439973dSWarner Losh   it needs to handle those errors on its own because there is no way to surface any
195*f439973dSWarner Losh   errors to the caller.
196*f439973dSWarner Losh 
197*f439973dSWarner Losh   @param[in] This           The pointer to the EFI_PCI_PLATFORM_PROTOCOL instance.
198*f439973dSWarner Losh   @param[in] HostBridge     The handle of the host bridge controller.
199*f439973dSWarner Losh   @param[in] Phase          The phase of the PCI bus enumeration.
200*f439973dSWarner Losh   @param[in] ExecPhase      Defines the execution phase of the PCI chipset driver.
201*f439973dSWarner Losh 
202*f439973dSWarner Losh   @retval EFI_SUCCESS   The function completed successfully.
203*f439973dSWarner Losh 
204*f439973dSWarner Losh **/
205*f439973dSWarner Losh typedef
206*f439973dSWarner Losh EFI_STATUS
207*f439973dSWarner Losh (EFIAPI *EFI_PCI_PLATFORM_PHASE_NOTIFY)(
208*f439973dSWarner Losh   IN EFI_PCI_PLATFORM_PROTOCOL                      *This,
209*f439973dSWarner Losh   IN EFI_HANDLE                                     HostBridge,
210*f439973dSWarner Losh   IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PHASE  Phase,
211*f439973dSWarner Losh   IN EFI_PCI_EXECUTION_PHASE                        ExecPhase
212*f439973dSWarner Losh   );
213*f439973dSWarner Losh 
214*f439973dSWarner Losh /**
215*f439973dSWarner Losh   The notification from the PCI bus enumerator to the platform for each PCI
216*f439973dSWarner Losh   controller at several predefined points during PCI controller initialization.
217*f439973dSWarner Losh 
218*f439973dSWarner Losh   The PlatformPrepController() function can be used to notify the platform driver so that
219*f439973dSWarner Losh   it can perform platform-specific actions. No specific actions are required.
220*f439973dSWarner Losh   Several notification points are defined at this time. More synchronization points may be
221*f439973dSWarner Losh   added as required in the future. The PCI bus driver calls the platform driver twice for
222*f439973dSWarner Losh   every PCI controller-once before the PCI Host Bridge Resource Allocation Protocol driver
223*f439973dSWarner Losh   is notified, and once after the PCI Host Bridge Resource Allocation Protocol driver has
224*f439973dSWarner Losh   been notified.
225*f439973dSWarner Losh   This member function may not perform any error checking on the input parameters. It also
226*f439973dSWarner Losh   does not return any error codes. If this member function detects any error condition, it
227*f439973dSWarner Losh   needs to handle those errors on its own because there is no way to surface any errors to
228*f439973dSWarner Losh   the caller.
229*f439973dSWarner Losh 
230*f439973dSWarner Losh   @param[in] This           The pointer to the EFI_PCI_PLATFORM_PROTOCOL instance.
231*f439973dSWarner Losh   @param[in] HostBridge     The associated PCI host bridge handle.
232*f439973dSWarner Losh   @param[in] RootBridge     The associated PCI root bridge handle.
233*f439973dSWarner Losh   @param[in] PciAddress     The address of the PCI device on the PCI bus.
234*f439973dSWarner Losh   @param[in] Phase          The phase of the PCI controller enumeration.
235*f439973dSWarner Losh   @param[in] ExecPhase      Defines the execution phase of the PCI chipset driver.
236*f439973dSWarner Losh 
237*f439973dSWarner Losh   @retval EFI_SUCCESS   The function completed successfully.
238*f439973dSWarner Losh 
239*f439973dSWarner Losh **/
240*f439973dSWarner Losh typedef
241*f439973dSWarner Losh EFI_STATUS
242*f439973dSWarner Losh (EFIAPI *EFI_PCI_PLATFORM_PREPROCESS_CONTROLLER)(
243*f439973dSWarner Losh   IN EFI_PCI_PLATFORM_PROTOCOL                     *This,
244*f439973dSWarner Losh   IN EFI_HANDLE                                    HostBridge,
245*f439973dSWarner Losh   IN EFI_HANDLE                                    RootBridge,
246*f439973dSWarner Losh   IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_PCI_ADDRESS   PciAddress,
247*f439973dSWarner Losh   IN EFI_PCI_CONTROLLER_RESOURCE_ALLOCATION_PHASE  Phase,
248*f439973dSWarner Losh   IN EFI_PCI_EXECUTION_PHASE                       ExecPhase
249*f439973dSWarner Losh   );
250*f439973dSWarner Losh 
251*f439973dSWarner Losh /**
252*f439973dSWarner Losh   Retrieves the platform policy regarding enumeration.
253*f439973dSWarner Losh 
254*f439973dSWarner Losh   The GetPlatformPolicy() function retrieves the platform policy regarding PCI
255*f439973dSWarner Losh   enumeration. The PCI bus driver and the PCI Host Bridge Resource Allocation Protocol
256*f439973dSWarner Losh   driver can call this member function to retrieve the policy.
257*f439973dSWarner Losh 
258*f439973dSWarner Losh   @param[in]  This        The pointer to the EFI_PCI_PLATFORM_PROTOCOL instance.
259*f439973dSWarner Losh   @param[out] PciPolicy   The platform policy with respect to VGA and ISA aliasing.
260*f439973dSWarner Losh 
261*f439973dSWarner Losh   @retval EFI_SUCCESS             The function completed successfully.
262*f439973dSWarner Losh   @retval EFI_INVALID_PARAMETER   PciPolicy is NULL.
263*f439973dSWarner Losh 
264*f439973dSWarner Losh **/
265*f439973dSWarner Losh typedef
266*f439973dSWarner Losh EFI_STATUS
267*f439973dSWarner Losh (EFIAPI *EFI_PCI_PLATFORM_GET_PLATFORM_POLICY)(
268*f439973dSWarner Losh   IN  CONST EFI_PCI_PLATFORM_PROTOCOL  *This,
269*f439973dSWarner Losh   OUT       EFI_PCI_PLATFORM_POLICY    *PciPolicy
270*f439973dSWarner Losh   );
271*f439973dSWarner Losh 
272*f439973dSWarner Losh /**
273*f439973dSWarner Losh   Gets the PCI device's option ROM from a platform-specific location.
274*f439973dSWarner Losh 
275*f439973dSWarner Losh   The GetPciRom() function gets the PCI device's option ROM from a platform-specific location.
276*f439973dSWarner Losh   The option ROM will be loaded into memory. This member function is used to return an image
277*f439973dSWarner Losh   that is packaged as a PCI 2.2 option ROM. The image may contain both legacy and EFI option
278*f439973dSWarner Losh   ROMs. See the UEFI 2.0 Specification for details. This member function can be used to return
279*f439973dSWarner Losh   option ROM images for embedded controllers. Option ROMs for embedded controllers are typically
280*f439973dSWarner Losh   stored in platform-specific storage, and this member function can retrieve it from that storage
281*f439973dSWarner Losh   and return it to the PCI bus driver. The PCI bus driver will call this member function before
282*f439973dSWarner Losh   scanning the ROM that is attached to any controller, which allows a platform to specify a ROM
283*f439973dSWarner Losh   image that is different from the ROM image on a PCI card.
284*f439973dSWarner Losh 
285*f439973dSWarner Losh   @param[in]  This        The pointer to the EFI_PCI_PLATFORM_PROTOCOL instance.
286*f439973dSWarner Losh   @param[in]  PciHandle   The handle of the PCI device.
287*f439973dSWarner Losh   @param[out] RomImage    If the call succeeds, the pointer to the pointer to the option ROM image.
288*f439973dSWarner Losh                           Otherwise, this field is undefined. The memory for RomImage is allocated
289*f439973dSWarner Losh                           by EFI_PCI_PLATFORM_PROTOCOL.GetPciRom() using the EFI Boot Service AllocatePool().
290*f439973dSWarner Losh                           It is the caller's responsibility to free the memory using the EFI Boot Service
291*f439973dSWarner Losh                           FreePool(), when the caller is done with the option ROM.
292*f439973dSWarner Losh   @param[out] RomSize     If the call succeeds, a pointer to the size of the option ROM size. Otherwise,
293*f439973dSWarner Losh                           this field is undefined.
294*f439973dSWarner Losh 
295*f439973dSWarner Losh   @retval EFI_SUCCESS            The option ROM was available for this device and loaded into memory.
296*f439973dSWarner Losh   @retval EFI_NOT_FOUND          No option ROM was available for this device.
297*f439973dSWarner Losh   @retval EFI_OUT_OF_RESOURCES   No memory was available to load the option ROM.
298*f439973dSWarner Losh   @retval EFI_DEVICE_ERROR       An error occurred in obtaining the option ROM.
299*f439973dSWarner Losh 
300*f439973dSWarner Losh **/
301*f439973dSWarner Losh typedef
302*f439973dSWarner Losh EFI_STATUS
303*f439973dSWarner Losh (EFIAPI *EFI_PCI_PLATFORM_GET_PCI_ROM)(
304*f439973dSWarner Losh   IN  CONST EFI_PCI_PLATFORM_PROTOCOL  *This,
305*f439973dSWarner Losh   IN        EFI_HANDLE                 PciHandle,
306*f439973dSWarner Losh   OUT       VOID                       **RomImage,
307*f439973dSWarner Losh   OUT       UINTN                      *RomSize
308*f439973dSWarner Losh   );
309*f439973dSWarner Losh 
310*f439973dSWarner Losh ///
311*f439973dSWarner Losh /// This protocol provides the interface between the PCI bus driver/PCI Host
312*f439973dSWarner Losh /// Bridge Resource Allocation driver and a platform-specific driver to describe
313*f439973dSWarner Losh /// the unique features of a platform.
314*f439973dSWarner Losh ///
315*f439973dSWarner Losh struct _EFI_PCI_PLATFORM_PROTOCOL {
316*f439973dSWarner Losh   ///
317*f439973dSWarner Losh   /// The notification from the PCI bus enumerator to the platform that it is about to
318*f439973dSWarner Losh   /// enter a certain phase during the enumeration process.
319*f439973dSWarner Losh   ///
320*f439973dSWarner Losh   EFI_PCI_PLATFORM_PHASE_NOTIFY             PlatformNotify;
321*f439973dSWarner Losh   ///
322*f439973dSWarner Losh   /// The notification from the PCI bus enumerator to the platform for each PCI
323*f439973dSWarner Losh   /// controller at several predefined points during PCI controller initialization.
324*f439973dSWarner Losh   ///
325*f439973dSWarner Losh   EFI_PCI_PLATFORM_PREPROCESS_CONTROLLER    PlatformPrepController;
326*f439973dSWarner Losh   ///
327*f439973dSWarner Losh   /// Retrieves the platform policy regarding enumeration.
328*f439973dSWarner Losh   ///
329*f439973dSWarner Losh   EFI_PCI_PLATFORM_GET_PLATFORM_POLICY      GetPlatformPolicy;
330*f439973dSWarner Losh   ///
331*f439973dSWarner Losh   /// Gets the PCI device's option ROM from a platform-specific location.
332*f439973dSWarner Losh   ///
333*f439973dSWarner Losh   EFI_PCI_PLATFORM_GET_PCI_ROM              GetPciRom;
334*f439973dSWarner Losh };
335*f439973dSWarner Losh 
336*f439973dSWarner Losh extern EFI_GUID  gEfiPciPlatformProtocolGuid;
337*f439973dSWarner Losh 
338*f439973dSWarner Losh #endif
339