]>
Commit | Line | Data |
---|---|---|
caf45c98 | 1 | /** @file\r |
2 | This file declares PciCfg PPI used to access PCI configuration space in PEI\r | |
3 | \r | |
2bbaeb0d | 4 | Copyright (c) 2006 - 2009, Intel Corporation \r |
caf45c98 | 5 | All rights reserved. This program and the accompanying materials \r |
6 | are licensed and made available under the terms and conditions of the BSD License \r | |
7 | which accompanies this distribution. The full text of the license may be found at \r | |
8 | http://opensource.org/licenses/bsd-license.php \r | |
9 | \r | |
10 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r | |
11 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r | |
12 | \r | |
13 | Module Name: PciCfg.h\r | |
14 | \r | |
15 | @par Revision Reference:\r | |
16 | This PPI is defined in PEI CIS\r | |
17 | Version 0.91.\r | |
18 | \r | |
19 | **/\r | |
20 | \r | |
21 | #ifndef __PEI_PCI_CFG_H__\r | |
22 | #define __PEI_PCI_CFG_H__\r | |
23 | \r | |
0e0eeeca | 24 | #include <Ppi/PciCfg2.h>\r |
24980534 | 25 | //\r |
26 | // Get the common definitions for EFI_PEI_PCI_CFG_PPI_WIDTH.\r | |
27 | //\r | |
7459094d | 28 | \r |
caf45c98 | 29 | #define EFI_PEI_PCI_CFG_PPI_INSTALLED_GUID \\r |
30 | { \\r | |
31 | 0xe1f2eba0, 0xf7b9, 0x4a26, {0x86, 0x20, 0x13, 0x12, 0x21, 0x64, 0x2a, 0x90 } \\r | |
32 | }\r | |
33 | \r | |
34 | typedef struct _EFI_PEI_PCI_CFG_PPI EFI_PEI_PCI_CFG_PPI;\r | |
35 | \r | |
36 | #define PEI_PCI_CFG_ADDRESS(bus, dev, func, reg) ( \\r | |
37 | (UINT64) ((((UINTN) bus) << 24) + (((UINTN) dev) << 16) + (((UINTN) func) << 8) + ((UINTN) reg)) \\r | |
38 | ) & 0x00000000ffffffff\r | |
39 | \r | |
40 | /**\r | |
41 | PCI read and write operation.\r | |
42 | \r | |
43 | @param PeiServices An indirect pointer to the PEI Services Table\r | |
44 | published by the PEI Foundation.\r | |
45 | @param This Pointer to local data for the interface.\r | |
46 | @param Width The width of the access. Enumerated in bytes.\r | |
47 | @param Address The physical address of the access.\r | |
48 | @param Buffer A pointer to the buffer of data.\r | |
49 | \r | |
50 | @retval EFI_SUCCESS The function completed successfully.\r | |
51 | @retval EFI_NOT_YET_AVAILABLE The service has not been installed.\r | |
52 | \r | |
53 | **/\r | |
54 | typedef\r | |
55 | EFI_STATUS\r | |
69686d56 | 56 | (EFIAPI *EFI_PEI_PCI_CFG_PPI_IO)(\r |
caf45c98 | 57 | IN EFI_PEI_SERVICES **PeiServices,\r |
58 | IN EFI_PEI_PCI_CFG_PPI *This,\r | |
59 | IN EFI_PEI_PCI_CFG_PPI_WIDTH Width,\r | |
60 | IN UINT64 Address,\r | |
61 | IN OUT VOID *Buffer\r | |
62 | );\r | |
63 | \r | |
64 | /**\r | |
65 | PCI read-modify-write operation.\r | |
66 | \r | |
67 | @param PeiServices An indirect pointer to the PEI Services Table\r | |
68 | published by the PEI Foundation.\r | |
69 | @param This Pointer to local data for the interface.\r | |
70 | @param Width The width of the access. Enumerated in bytes.\r | |
71 | @param Address The physical address of the access.\r | |
72 | @param SetBits Value of the bits to set.\r | |
73 | @param ClearBits Value of the bits to clear.\r | |
74 | \r | |
75 | @retval EFI_SUCCESS The function completed successfully.\r | |
76 | \r | |
77 | **/\r | |
78 | typedef\r | |
79 | EFI_STATUS\r | |
69686d56 | 80 | (EFIAPI *EFI_PEI_PCI_CFG_PPI_RW)(\r |
caf45c98 | 81 | IN EFI_PEI_SERVICES **PeiServices,\r |
82 | IN EFI_PEI_PCI_CFG_PPI *This,\r | |
83 | IN EFI_PEI_PCI_CFG_PPI_WIDTH Width,\r | |
84 | IN UINT64 Address,\r | |
85 | IN UINTN SetBits,\r | |
86 | IN UINTN ClearBits\r | |
87 | );\r | |
88 | \r | |
89 | /**\r | |
caf45c98 | 90 | The EFI_PEI_PCI_CFG_PPI interfaces are used to abstract accesses to PCI \r |
91 | controllers behind a PCI root bridge controller.\r | |
caf45c98 | 92 | **/\r |
93 | struct _EFI_PEI_PCI_CFG_PPI {\r | |
2bbaeb0d | 94 | ///\r |
95 | /// PCI read services. See the Read() function description.\r | |
96 | ///\r | |
caf45c98 | 97 | EFI_PEI_PCI_CFG_PPI_IO Read;\r |
2bbaeb0d | 98 | \r |
99 | ///\r | |
100 | /// PCI write services. See the Write() function description.\r | |
101 | ///\r | |
caf45c98 | 102 | EFI_PEI_PCI_CFG_PPI_IO Write;\r |
2bbaeb0d | 103 | \r |
104 | ///\r | |
105 | /// PCI read-modify-write services. See the Modify() function description.\r | |
106 | ///\r | |
caf45c98 | 107 | EFI_PEI_PCI_CFG_PPI_RW Modify;\r |
108 | };\r | |
109 | \r | |
110 | extern EFI_GUID gEfiPciCfgPpiInServiceTableGuid;\r | |
111 | \r | |
112 | #endif\r |