2 This file declares PciCfg2 PPI.
4 This ppi Provides platform or chipset-specific access to
5 the PCI configuration space for a specific PCI segment.
7 Copyright (c) 2006 - 2008, Intel Corporation
8 All rights reserved. This program and the accompanying materials
9 are licensed and made available under the terms and conditions of the BSD License
10 which accompanies this distribution. The full text of the license may be found at
11 http://opensource.org/licenses/bsd-license.php
13 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
14 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
16 @par Revision Reference:
17 This PPI is defined in PI
22 #ifndef __PEI_PCI_CFG2_H__
23 #define __PEI_PCI_CFG2_H__
25 #include <ProcessorBind.h>
26 #include <Pi/PiPeiCis.h>
28 #define EFI_PEI_PCI_CFG2_PPI_GUID \
29 { 0x57a449a, 0x1fdc, 0x4c06, { 0xbf, 0xc9, 0xf5, 0x3f, 0x6a, 0x99, 0xbb, 0x92 } }
32 typedef struct _EFI_PEI_PCI_CFG2_PPI EFI_PEI_PCI_CFG2_PPI
;
34 #define EFI_PEI_PCI_CFG_ADDRESS(bus,dev,func,reg) \
38 ((reg) < 256 ? (reg) : ((UINT64)(reg) << 32)));
41 // EFI_PEI_PCI_CFG_PPI_WIDTH
44 EfiPeiPciCfgWidthUint8
= 0,
45 EfiPeiPciCfgWidthUint16
= 1,
46 EfiPeiPciCfgWidthUint32
= 2,
47 EfiPeiPciCfgWidthUint64
= 3,
48 EfiPeiPciCfgWidthMaximum
49 } EFI_PEI_PCI_CFG_PPI_WIDTH
;
52 // EFI_PEI_PCI_CFG_PPI_PCI_ADDRESS
59 UINT32 ExtendedRegister
;
60 } EFI_PEI_PCI_CFG_PPI_PCI_ADDRESS
;
63 Reads from or write to a given location in the PCI configuration space.
65 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
67 @param This Pointer to local data for the interface.
69 @param Width The width of the access. Enumerated in bytes.
70 See EFI_PEI_PCI_CFG_PPI_WIDTH above.
72 @param Address The physical address of the access. The format of
73 the address is described by EFI_PEI_PCI_CFG_PPI_PCI_ADDRESS.
75 @param Buffer A pointer to the buffer of data..
78 @retval EFI_SUCCESS The function completed successfully.
80 @retval EFI_DEVICE_ERROR There was a problem with the transaction.
82 @retval EFI_DEVICE_NOT_READY The device is not capable of supporting the operation at this
88 (EFIAPI
*EFI_PEI_PCI_CFG2_PPI_IO
)(
89 IN CONST EFI_PEI_SERVICES
**PeiServices
,
90 IN CONST EFI_PEI_PCI_CFG2_PPI
*This
,
91 IN EFI_PEI_PCI_CFG_PPI_WIDTH Width
,
98 Performs a read-modify-write operation on the contents
99 from a given location in the PCI configuration space.
101 @param PeiServices An indirect pointer to the PEI Services Table
102 published by the PEI Foundation.
104 @param This Pointer to local data for the interface.
106 @param Width The width of the access. Enumerated in bytes. Type
107 EFI_PEI_PCI_CFG_PPI_WIDTH is defined in Read().
109 @param Address The physical address of the access.
111 @param SetBits Points to value to bitwise-OR with the read configuration value.
113 The size of the value is determined by Width.
115 @param ClearBits Points to the value to negate and bitwise-AND with the read configuration value.
116 The size of the value is determined by Width.
119 @retval EFI_SUCCESS The function completed successfully.
121 @retval EFI_DEVICE_ERROR There was a problem with the transaction.
123 @retval EFI_DEVICE_NOT_READY The device is not capable of supporting
124 the operation at this time.
129 (EFIAPI
*EFI_PEI_PCI_CFG2_PPI_RW
)(
130 IN CONST EFI_PEI_SERVICES
**PeiServices
,
131 IN CONST EFI_PEI_PCI_CFG2_PPI
*This
,
132 IN EFI_PEI_PCI_CFG_PPI_WIDTH Width
,
134 IN CONST VOID
*SetBits
,
135 IN CONST VOID
*ClearBits
139 @par Ppi Description:
140 The EFI_PEI_PCI_CFG_PPI interfaces are used to abstract accesses to PCI
141 controllers behind a PCI root bridge controller.
143 @param Read PCI read services. See the Read() function description.
145 @param Write PCI write services. See the Write() function description.
147 @param Modify PCI read-modify-write services. See the Modify() function description.
149 @param Segment The PCI bus segment which the specified functions will access.
152 struct _EFI_PEI_PCI_CFG2_PPI
{
153 EFI_PEI_PCI_CFG2_PPI_IO Read
;
154 EFI_PEI_PCI_CFG2_PPI_IO Write
;
155 EFI_PEI_PCI_CFG2_PPI_RW Modify
;
160 extern EFI_GUID gEfiPciCfg2PpiGuid
;