]> git.proxmox.com Git - mirror_edk2.git/blob - IntelFrameworkPkg/Include/Ppi/PciCfg.h
e867aeb882d6ab7b92f00b53a9b56a6b415f4a6c
[mirror_edk2.git] / IntelFrameworkPkg / Include / Ppi / PciCfg.h
1 /** @file
2 This file declares PciCfg PPI used to access PCI configuration space in PEI
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: PciCfg.h
14
15 @par Revision Reference:
16 This PPI is defined in PEI CIS
17 Version 0.91.
18
19 **/
20
21 #ifndef __PEI_PCI_CFG_H__
22 #define __PEI_PCI_CFG_H__
23
24 #include <Pi/PiPeiCis.h>
25
26 #define EFI_PEI_PCI_CFG_PPI_INSTALLED_GUID \
27 { \
28 0xe1f2eba0, 0xf7b9, 0x4a26, {0x86, 0x20, 0x13, 0x12, 0x21, 0x64, 0x2a, 0x90 } \
29 }
30
31 typedef struct _EFI_PEI_PCI_CFG_PPI EFI_PEI_PCI_CFG_PPI;
32
33 #define PEI_PCI_CFG_ADDRESS(bus, dev, func, reg) ( \
34 (UINT64) ((((UINTN) bus) << 24) + (((UINTN) dev) << 16) + (((UINTN) func) << 8) + ((UINTN) reg)) \
35 ) & 0x00000000ffffffff
36
37 /**
38 PCI read and write operation.
39
40 @param PeiServices An indirect pointer to the PEI Services Table
41 published by the PEI Foundation.
42 @param This Pointer to local data for the interface.
43 @param Width The width of the access. Enumerated in bytes.
44 @param Address The physical address of the access.
45 @param Buffer A pointer to the buffer of data.
46
47 @retval EFI_SUCCESS The function completed successfully.
48 @retval EFI_NOT_YET_AVAILABLE The service has not been installed.
49
50 **/
51 typedef
52 EFI_STATUS
53 (EFIAPI *EFI_PEI_PCI_CFG_PPI_IO) (
54 IN EFI_PEI_SERVICES **PeiServices,
55 IN EFI_PEI_PCI_CFG_PPI *This,
56 IN EFI_PEI_PCI_CFG_PPI_WIDTH Width,
57 IN UINT64 Address,
58 IN OUT VOID *Buffer
59 );
60
61 /**
62 PCI read-modify-write operation.
63
64 @param PeiServices An indirect pointer to the PEI Services Table
65 published by the PEI Foundation.
66 @param This Pointer to local data for the interface.
67 @param Width The width of the access. Enumerated in bytes.
68 @param Address The physical address of the access.
69 @param SetBits Value of the bits to set.
70 @param ClearBits Value of the bits to clear.
71
72 @retval EFI_SUCCESS The function completed successfully.
73
74 **/
75 typedef
76 EFI_STATUS
77 (EFIAPI *EFI_PEI_PCI_CFG_PPI_RW) (
78 IN EFI_PEI_SERVICES **PeiServices,
79 IN EFI_PEI_PCI_CFG_PPI *This,
80 IN EFI_PEI_PCI_CFG_PPI_WIDTH Width,
81 IN UINT64 Address,
82 IN UINTN SetBits,
83 IN UINTN ClearBits
84 );
85
86 /**
87 The EFI_PEI_PCI_CFG_PPI interfaces are used to abstract accesses to PCI
88 controllers behind a PCI root bridge controller.
89
90 @param Read
91 PCI read services. See the Read() function description.
92
93 @param Write
94 PCI write services. See the Write() function description.
95
96 @param Modify
97 PCI read-modify-write services. See the Modify() function description.
98
99 **/
100 struct _EFI_PEI_PCI_CFG_PPI {
101 EFI_PEI_PCI_CFG_PPI_IO Read;
102 EFI_PEI_PCI_CFG_PPI_IO Write;
103 EFI_PEI_PCI_CFG_PPI_RW Modify;
104 };
105
106 extern EFI_GUID gEfiPciCfgPpiInServiceTableGuid;
107
108 #endif