]> git.proxmox.com Git - mirror_edk2.git/blob - IntelFrameworkPkg/Include/Ppi/PciCfg.h
Remove IntelFrameworkModulePkg
[mirror_edk2.git] / IntelFrameworkPkg / Include / Ppi / PciCfg.h
1 /** @file
2 This file declares the PciCfg PPI used to access the PCI configuration space in PEI
3
4 Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
6
7 @par Revision Reference:
8 This PPI is defined in PEI CIS
9 Version 0.91.
10
11 **/
12
13 #ifndef __PEI_PCI_CFG_H__
14 #define __PEI_PCI_CFG_H__
15
16 #include <Ppi/PciCfg2.h>
17 //
18 // Get the common definitions for EFI_PEI_PCI_CFG_PPI_WIDTH.
19 //
20
21 #define EFI_PEI_PCI_CFG_PPI_INSTALLED_GUID \
22 { \
23 0xe1f2eba0, 0xf7b9, 0x4a26, {0x86, 0x20, 0x13, 0x12, 0x21, 0x64, 0x2a, 0x90 } \
24 }
25
26 typedef struct _EFI_PEI_PCI_CFG_PPI EFI_PEI_PCI_CFG_PPI;
27
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
31
32 /**
33 PCI read and write operation.
34
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.
41
42 @retval EFI_SUCCESS The function completed successfully.
43 @retval EFI_NOT_YET_AVAILABLE The service has not been installed.
44
45 **/
46 typedef
47 EFI_STATUS
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,
52 IN UINT64 Address,
53 IN OUT VOID *Buffer
54 );
55
56 /**
57 PCI read-modify-write operation.
58
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.
66
67 @retval EFI_SUCCESS The function completed successfully.
68
69 **/
70 typedef
71 EFI_STATUS
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,
76 IN UINT64 Address,
77 IN UINTN SetBits,
78 IN UINTN ClearBits
79 );
80
81 /**
82 The EFI_PEI_PCI_CFG_PPI interfaces are used to abstract accesses to PCI
83 controllers behind a PCI root bridge controller.
84 **/
85 struct _EFI_PEI_PCI_CFG_PPI {
86 ///
87 /// PCI read services. See the Read() function description.
88 ///
89 EFI_PEI_PCI_CFG_PPI_IO Read;
90
91 ///
92 /// PCI write services. See the Write() function description.
93 ///
94 EFI_PEI_PCI_CFG_PPI_IO Write;
95
96 ///
97 /// PCI read-modify-write services. See the Modify() function description.
98 ///
99 EFI_PEI_PCI_CFG_PPI_RW Modify;
100 };
101
102 extern EFI_GUID gEfiPciCfgPpiInServiceTableGuid;
103
104 #endif