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