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