3 Copyright (c) 2006 - 2007, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
14 #ifndef __PCICFGPPI_INTERLNAL_H_
15 #define __PCICFGPPI_INTERLNAL_H_
18 #include <FrameworkPei.h>
20 #include <Ppi/PciCfg2.h>
21 #include <Ppi/PciCfg.h>
23 #include <Library/BaseLib.h>
24 #include <Library/PcdLib.h>
25 #include <Library/DebugLib.h>
26 #include <Library/PciLib.h>
27 #include <Library/PeimEntryPoint.h>
29 #include <IndustryStandard/Pci.h>
33 Convert EFI_PEI_PCI_CFG_PPI_PCI_ADDRESS to PCI_LIB_ADDRESS.
35 @param Address PCI address with
36 EFI_PEI_PCI_CFG_PPI_PCI_ADDRESS format.
38 @return The PCI address with PCI_LIB_ADDRESS format.
42 PciCfgAddressConvert (
43 EFI_PEI_PCI_CFG_PPI_PCI_ADDRESS
*Address
48 Reads from a given location in the PCI configuration space.
50 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
52 @param This Pointer to local data for the interface.
54 @param Width The width of the access. Enumerated in bytes.
55 See EFI_PEI_PCI_CFG_PPI_WIDTH above.
57 @param Address The physical address of the access. The format of
58 the address is described by EFI_PEI_PCI_CFG_PPI_PCI_ADDRESS.
60 @param Buffer A pointer to the buffer of data..
63 @retval EFI_SUCCESS The function completed successfully.
65 @retval EFI_DEVICE_ERROR There was a problem with the transaction.
67 @retval EFI_DEVICE_NOT_READY The device is not capable of supporting the operation at this
74 IN CONST EFI_PEI_SERVICES
**PeiServices
,
75 IN CONST EFI_PEI_PCI_CFG2_PPI
*This
,
76 IN EFI_PEI_PCI_CFG_PPI_WIDTH Width
,
82 Write to a given location in the PCI configuration space.
84 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
86 @param This Pointer to local data for the interface.
88 @param Width The width of the access. Enumerated in bytes.
89 See EFI_PEI_PCI_CFG_PPI_WIDTH above.
91 @param Address The physical address of the access. The format of
92 the address is described by EFI_PEI_PCI_CFG_PPI_PCI_ADDRESS.
94 @param Buffer A pointer to the buffer of data..
97 @retval EFI_SUCCESS The function completed successfully.
99 @retval EFI_DEVICE_ERROR There was a problem with the transaction.
101 @retval EFI_DEVICE_NOT_READY The device is not capable of supporting the operation at this
108 IN CONST EFI_PEI_SERVICES
**PeiServices
,
109 IN CONST EFI_PEI_PCI_CFG2_PPI
*This
,
110 IN EFI_PEI_PCI_CFG_PPI_WIDTH Width
,
117 PCI read-modify-write operation.
119 @param PeiServices An indirect pointer to the PEI Services Table
120 published by the PEI Foundation.
122 @param This Pointer to local data for the interface.
124 @param Width The width of the access. Enumerated in bytes. Type
125 EFI_PEI_PCI_CFG_PPI_WIDTH is defined in Read().
127 @param Address The physical address of the access.
129 @param SetBits Points to value to bitwise-OR with the read configuration value.
131 The size of the value is determined by Width.
133 @param ClearBits Points to the value to negate and bitwise-AND with the read configuration value.
134 The size of the value is determined by Width.
137 @retval EFI_SUCCESS The function completed successfully.
139 @retval EFI_DEVICE_ERROR There was a problem with the transaction.
141 @retval EFI_DEVICE_NOT_READY The device is not capable of supporting
142 the operation at this time.
148 IN CONST EFI_PEI_SERVICES
**PeiServices
,
149 IN CONST EFI_PEI_PCI_CFG2_PPI
*This
,
150 IN EFI_PEI_PCI_CFG_PPI_WIDTH Width
,
161 @param PeiServices An indirect pointer to the PEI Services Table
162 published by the PEI Foundation.
163 @param This Pointer to local data for the interface.
164 @param Width The width of the access. Enumerated in bytes.
165 @param Address The physical address of the access.
166 @param Buffer A pointer to the buffer of data.
168 @retval EFI_SUCCESS The function completed successfully.
169 @retval EFI_NOT_YET_AVAILABLE The service has not been installed.
175 IN EFI_PEI_SERVICES
**PeiServices
,
176 IN EFI_PEI_PCI_CFG_PPI
*This
,
177 IN EFI_PEI_PCI_CFG_PPI_WIDTH Width
,
185 @param PeiServices An indirect pointer to the PEI Services Table
186 published by the PEI Foundation.
187 @param This Pointer to local data for the interface.
188 @param Width The width of the access. Enumerated in bytes.
189 @param Address The physical address of the access.
190 @param Buffer A pointer to the buffer of data.
192 @retval EFI_SUCCESS The function completed successfully.
193 @retval EFI_NOT_YET_AVAILABLE The service has not been installed.
199 IN EFI_PEI_SERVICES
**PeiServices
,
200 IN EFI_PEI_PCI_CFG_PPI
*This
,
201 IN EFI_PEI_PCI_CFG_PPI_WIDTH Width
,
207 PCI read-modify-write operation.
209 @param PeiServices An indirect pointer to the PEI Services Table
210 published by the PEI Foundation.
211 @param This Pointer to local data for the interface.
212 @param Width The width of the access. Enumerated in bytes.
213 @param Address The physical address of the access.
214 @param SetBits Value of the bits to set.
215 @param ClearBits Value of the bits to clear.
217 @retval EFI_SUCCESS The function completed successfully.
223 IN EFI_PEI_SERVICES
**PeiServices
,
224 IN EFI_PEI_PCI_CFG_PPI
*This
,
225 IN EFI_PEI_PCI_CFG_PPI_WIDTH Width
,
234 extern EFI_PEI_PCI_CFG_PPI gPciCfgPpi
;
235 extern EFI_PEI_PPI_DESCRIPTOR gPciCfgPpiList
;