]>
Commit | Line | Data |
---|---|---|
878ddf1f | 1 | /** @file\r |
2 | This file declares PlatfromOpRom protocols.\r | |
3 | \r | |
4 | Copyright (c) 2006, Intel Corporation \r | |
5 | All rights reserved. This program and the accompanying materials \r | |
6 | are licensed and made available under the terms and conditions of the BSD License \r | |
7 | which accompanies this distribution. The full text of the license may be found at \r | |
8 | http://opensource.org/licenses/bsd-license.php \r | |
9 | \r | |
10 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r | |
11 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r | |
12 | \r | |
13 | Module Name: PciPlatform.h\r | |
14 | \r | |
15 | @par Revision Reference:\r | |
16 | This protocol is defined in PCI Platform Support Specification\r | |
17 | Version 0.9\r | |
18 | \r | |
19 | **/\r | |
20 | \r | |
21 | #ifndef _PCI_PLATFORM_H_\r | |
22 | #define _PCI_PLATFORM_H_\r | |
23 | \r | |
24 | //\r | |
25 | // Protocol for GUID.\r | |
26 | //\r | |
27 | \r | |
28 | #define EFI_PCI_PLATFORM_PROTOCOL_GUID \\r | |
29 | { 0x7d75280, 0x27d4, 0x4d69, {0x90, 0xd0, 0x56, 0x43, 0xe2, 0x38, 0xb3, 0x41} }\r | |
30 | \r | |
31 | typedef struct _EFI_PCI_PLATFORM_PROTOCOL EFI_PCI_PLATFORM_PROTOCOL;\r | |
32 | \r | |
33 | typedef UINT32 EFI_PCI_PLATFORM_POLICY;\r | |
34 | \r | |
35 | \r | |
36 | #define EFI_RESERVE_NONE_IO_ALIAS 0x0000\r | |
37 | #define EFI_RESERVE_ISA_IO_ALIAS 0x0001\r | |
38 | #define EFI_RESERVE_ISA_IO_NO_ALIAS 0x0002\r | |
39 | #define EFI_RESERVE_VGA_IO_ALIAS 0x0004\r | |
40 | #define EFI_RESERVE_VGA_IO_NO_ALIAS 0x0008\r | |
41 | \r | |
42 | \r | |
43 | typedef enum {\r | |
44 | ChipsetEntry,\r | |
45 | ChipsetExit,\r | |
46 | MaximumChipsetPhase\r | |
47 | } EFI_PCI_CHIPSET_EXECUTION_PHASE;\r | |
48 | \r | |
49 | \r | |
50 | /**\r | |
51 | The PlatformNotify() function can be used to notify the platform driver so that \r | |
52 | it can perform platform-specific actions. No specific actions are required. \r | |
53 | Eight notification points are defined at this time. More synchronization points \r | |
54 | may be added as required in the future. The PCI bus driver calls the platform driver \r | |
55 | twice for every Phase-once before the PCI Host Bridge Resource Allocation Protocol \r | |
56 | driver is notified, and once after the PCI Host Bridge Resource Allocation Protocol \r | |
57 | driver has been notified. \r | |
58 | This member function may not perform any error checking on the input parameters. It \r | |
59 | also does not return any error codes. If this member function detects any error condition, \r | |
60 | it needs to handle those errors on its own because there is no way to surface any \r | |
61 | errors to the caller.\r | |
62 | \r | |
63 | @param This Pointer to the EFI_PCI_PLATFORM_PROTOCOL instance.\r | |
64 | @param HostBridge The handle of the host bridge controller.\r | |
65 | @param Phase The phase of the PCI bus enumeration.\r | |
66 | @param ChipsetPhase Defines the execution phase of the PCI chipset driver.\r | |
67 | \r | |
68 | @retval EFI_SUCCESS The function completed successfully.\r | |
69 | \r | |
70 | **/\r | |
71 | typedef\r | |
72 | EFI_STATUS\r | |
73 | (EFIAPI *EFI_PCI_PLATFORM_PHASE_NOTIFY) (\r | |
74 | IN EFI_PCI_PLATFORM_PROTOCOL *This,\r | |
75 | IN EFI_HANDLE HostBridge,\r | |
76 | IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PHASE Phase,\r | |
77 | IN EFI_PCI_CHIPSET_EXECUTION_PHASE ChipsetPhase \r | |
78 | )\r | |
79 | ;\r | |
80 | \r | |
81 | \r | |
82 | /**\r | |
83 | The PlatformPrepController() function can be used to notify the platform driver so that \r | |
84 | it can perform platform-specific actions. No specific actions are required. \r | |
85 | Several notification points are defined at this time. More synchronization points may be \r | |
86 | added as required in the future. The PCI bus driver calls the platform driver twice for \r | |
87 | every PCI controller-once before the PCI Host Bridge Resource Allocation Protocol driver \r | |
88 | is notified, and once after the PCI Host Bridge Resource Allocation Protocol driver has \r | |
89 | been notified. \r | |
90 | This member function may not perform any error checking on the input parameters. It also \r | |
91 | does not return any error codes. If this member function detects any error condition, it \r | |
92 | needs to handle those errors on its own because there is no way to surface any errors to \r | |
93 | the caller. \r | |
94 | \r | |
95 | @param This Pointer to the EFI_PCI_PLATFORM_PROTOCOL instance.\r | |
96 | @param HostBridge The associated PCI host bridge handle.\r | |
97 | @param RootBridge The associated PCI root bridge handle.\r | |
98 | @param PciAddress The address of the PCI device on the PCI bus.\r | |
99 | @param Phase The phase of the PCI controller enumeration.\r | |
100 | @param ChipsetPhase Defines the execution phase of the PCI chipset driver.\r | |
101 | \r | |
102 | @retval EFI_SUCCESS The function completed successfully.\r | |
103 | \r | |
104 | **/\r | |
105 | typedef\r | |
106 | EFI_STATUS\r | |
107 | (EFIAPI *EFI_PCI_PLATFORM_PREPROCESS_CONTROLLER) (\r | |
108 | IN EFI_PCI_PLATFORM_PROTOCOL *This,\r | |
109 | IN EFI_HANDLE HostBridge,\r | |
110 | IN EFI_HANDLE RootBridge,\r | |
111 | IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_PCI_ADDRESS PciAddress,\r | |
112 | IN EFI_PCI_CONTROLLER_RESOURCE_ALLOCATION_PHASE Phase,\r | |
113 | IN EFI_PCI_CHIPSET_EXECUTION_PHASE ChipsetPhase\r | |
114 | )\r | |
115 | ;\r | |
116 | \r | |
117 | \r | |
118 | /**\r | |
119 | The GetPlatformPolicy() function retrieves the platform policy regarding PCI \r | |
120 | enumeration. The PCI bus driver and the PCI Host Bridge Resource Allocation Protocol \r | |
121 | driver can call this member function to retrieve the policy.\r | |
122 | \r | |
123 | @param This Pointer to the EFI_PCI_PLATFORM_PROTOCOL instance.\r | |
124 | @param PciPolicy The platform policy with respect to VGA and ISA aliasing.\r | |
125 | \r | |
126 | @retval EFI_SUCCESS The function completed successfully.\r | |
127 | @retval EFI_INVALID_PARAMETER PciPolicy is NULL.\r | |
128 | \r | |
129 | **/\r | |
130 | typedef\r | |
131 | EFI_STATUS\r | |
132 | (EFIAPI *EFI_PCI_PLATFORM_GET_PLATFORM_POLICY) (\r | |
133 | IN EFI_PCI_PLATFORM_PROTOCOL *This,\r | |
134 | OUT EFI_PCI_PLATFORM_POLICY *PciPolicy\r | |
135 | )\r | |
136 | ;\r | |
137 | \r | |
138 | \r | |
139 | /**\r | |
140 | The GetPciRom() function gets the PCI device's option ROM from a platform-specific location. \r | |
141 | The option ROM will be loaded into memory. This member function is used to return an image \r | |
142 | that is packaged as a PCI 2.2 option ROM. The image may contain both legacy and EFI option \r | |
143 | ROMs. See the EFI 1.10 Specification for details. This member function can be used to return \r | |
144 | option ROM images for embedded controllers. Option ROMs for embedded controllers are typically \r | |
145 | stored in platform-specific storage, and this member function can retrieve it from that storage \r | |
146 | and return it to the PCI bus driver. The PCI bus driver will call this member function before \r | |
147 | scanning the ROM that is attached to any controller, which allows a platform to specify a ROM \r | |
148 | image that is different from the ROM image on a PCI card.\r | |
149 | \r | |
150 | @param This Pointer to the EFI_PCI_PLATFORM_PROTOCOL instance.\r | |
151 | @param PciHandle The handle of the PCI device.\r | |
152 | @param RomImage If the call succeeds, the pointer to the pointer to the option ROM image.\r | |
153 | Otherwise, this field is undefined. The memory for RomImage is allocated\r | |
154 | by EFI_PCI_PLATFORM_PROTOCOL.GetPciRom() using the EFI Boot Service AllocatePool().\r | |
155 | It is the caller's responsibility to free the memory using the EFI Boot Service\r | |
156 | FreePool(), when the caller is done with the option ROM.\r | |
157 | @param RomSize If the call succeeds, a pointer to the size of the option ROM size. Otherwise,\r | |
158 | this field is undefined.\r | |
159 | \r | |
160 | @retval EFI_SUCCESS The option ROM was available for this device and loaded into memory.\r | |
161 | @retval EFI_NOT_FOUND No option ROM was available for this device.\r | |
162 | @retval EFI_OUT_OF_RESOURCES No memory was available to load the option ROM.\r | |
163 | @retval EFI_DEVICE_ERROR An error occurred in getting the option ROM.\r | |
164 | \r | |
165 | **/\r | |
166 | typedef\r | |
167 | EFI_STATUS\r | |
168 | (EFIAPI *EFI_PCI_PLATFORM_GET_PCI_ROM) ( \r | |
169 | IN EFI_PCI_PLATFORM_PROTOCOL *This,\r | |
170 | IN EFI_HANDLE PciHandle,\r | |
171 | OUT VOID **RomImage,\r | |
172 | OUT UINTN *RomSize \r | |
173 | )\r | |
174 | ;\r | |
175 | \r | |
176 | /**\r | |
177 | @par Protocol Description:\r | |
178 | This protocol provides the interface between the PCI bus driver/PCI Host \r | |
179 | Bridge Resource Allocation driver and a platform-specific driver to describe \r | |
180 | the unique features of a platform.\r | |
181 | \r | |
182 | @param PlatformNotify\r | |
183 | The notification from the PCI bus enumerator to the platform that it is \r | |
184 | about to enter a certain phase during the enumeration process.\r | |
185 | \r | |
186 | @param PlatformPrepController\r | |
187 | The notification from the PCI bus enumerator to the platform for each PCI \r | |
188 | controller at several predefined points during PCI controller initialization.\r | |
189 | \r | |
190 | @param GetPlatformPolicy\r | |
191 | Retrieves the platform policy regarding enumeration.\r | |
192 | \r | |
193 | @param GetPciRom\r | |
194 |