2 This file declares the PciCfg PPI used to access the PCI configuration space in PEI
4 Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
7 @par Revision Reference:
8 This PPI is defined in PEI CIS
13 #ifndef __PEI_PCI_CFG_H__
14 #define __PEI_PCI_CFG_H__
16 #include <Ppi/PciCfg2.h>
18 // Get the common definitions for EFI_PEI_PCI_CFG_PPI_WIDTH.
21 #define EFI_PEI_PCI_CFG_PPI_INSTALLED_GUID \
23 0xe1f2eba0, 0xf7b9, 0x4a26, {0x86, 0x20, 0x13, 0x12, 0x21, 0x64, 0x2a, 0x90 } \
26 typedef struct _EFI_PEI_PCI_CFG_PPI EFI_PEI_PCI_CFG_PPI
;
28 #define PEI_PCI_CFG_ADDRESS(bus, dev, func, reg) ( \
29 (UINT64) ((((UINTN) bus) << 24) + (((UINTN) dev) << 16) + (((UINTN) func) << 8) + ((UINTN) reg)) \
30 ) & 0x00000000ffffffff
33 PCI read and write operation.
35 @param PeiServices An indirect pointer to the PEI Services Table
36 published by the PEI Foundation.
37 @param This Pointer to local data for the interface.
38 @param Width The width of the access. Enumerated in bytes.
39 @param Address The physical address of the access.
40 @param Buffer A pointer to the buffer of data.
42 @retval EFI_SUCCESS The function completed successfully.
43 @retval EFI_NOT_YET_AVAILABLE The service has not been installed.
48 (EFIAPI
*EFI_PEI_PCI_CFG_PPI_IO
)(
49 IN EFI_PEI_SERVICES
**PeiServices
,
50 IN EFI_PEI_PCI_CFG_PPI
*This
,
51 IN EFI_PEI_PCI_CFG_PPI_WIDTH Width
,
57 PCI read-modify-write operation.
59 @param PeiServices An indirect pointer to the PEI Services Table
60 published by the PEI Foundation.
61 @param This The pointer to local data for the interface.
62 @param Width The width of the access. Enumerated in bytes.
63 @param Address The physical address of the access.
64 @param SetBits Value of the bits to set.
65 @param ClearBits Value of the bits to clear.
67 @retval EFI_SUCCESS The function completed successfully.
72 (EFIAPI
*EFI_PEI_PCI_CFG_PPI_RW
)(
73 IN EFI_PEI_SERVICES
**PeiServices
,
74 IN EFI_PEI_PCI_CFG_PPI
*This
,
75 IN EFI_PEI_PCI_CFG_PPI_WIDTH Width
,
82 The EFI_PEI_PCI_CFG_PPI interfaces are used to abstract accesses to PCI
83 controllers behind a PCI root bridge controller.
85 struct _EFI_PEI_PCI_CFG_PPI
{
87 /// PCI read services. See the Read() function description.
89 EFI_PEI_PCI_CFG_PPI_IO Read
;
92 /// PCI write services. See the Write() function description.
94 EFI_PEI_PCI_CFG_PPI_IO Write
;
97 /// PCI read-modify-write services. See the Modify() function description.
99 EFI_PEI_PCI_CFG_PPI_RW Modify
;
102 extern EFI_GUID gEfiPciCfgPpiInServiceTableGuid
;