summaryrefslogtreecommitdiff
path: root/Include/PPI/CspLibPPI.h
blob: cd5cf801f0e879083656e3d367b1116fe01826e1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
//*************************************************************************
//*************************************************************************
//**                                                                     **
//**        (C)Copyright 1985-2008, American Megatrends, Inc.            **
//**                                                                     **
//**                       All Rights Reserved.                          **
//**                                                                     **
//**      5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093           **
//**                                                                     **
//**                       Phone: (770)-246-8600                         **
//**                                                                     **
//*************************************************************************
//*************************************************************************

//**********************************************************************
// $Header: /Alaska/BIN/Chipset/Template/CSPLibrary/CspLibPPI.h 7     7/14/11 2:45p Artems $
//
// $Revision: 7 $
//
// $Date: 7/14/11 2:45p $
//*****************************************************************************
// Revision History
// ----------------
// $Log: /Alaska/BIN/Chipset/Template/CSPLibrary/CspLibPPI.h $
// 
// 7     7/14/11 2:45p Artems
// EIP 64106: Updated source to be UEFI 2.3.1 and PI 1.2 compliant
// 
// 6     2/22/11 4:41p Artems
// EIP 51548 - Added AMI copyright headers, replaced TABs with spaces
// 
// 5     6/12/09 10:55a Robert
// updated headers
// 
// 4     6/12/09 10:51a Robert
// CHM and comment updates
// 
// 3     10/13/07 11:53p Michaela
// Added ProgramPciTable to AMI_PEI_PCI_TABLE_INIT_PPI to
// support multiple access widths
// 
// 2     3/13/06 3:42p Felixp
// 
// 1     1/21/05 12:46p Sivagarn
// Initial Checkin - Version 0.05
//
//
//*****************************************************************************

//<AMI_FHDR_START>
//----------------------------------------------------------------------------
//
// Name:        CspLibPPI.h
//
// Description: 
//  This file contains PPI definitions that are defined in the CSP Library
//
//----------------------------------------------------------------------------
//<AMI_FHDR_END>
#ifndef __CSP_LIB_PPI_H__
#define __CSP_LIB_PPI_H__
#ifdef __cplusplus
extern "C" {
#endif
#include <PEI.h>

//<AMI_GHDR_START>
//============================================================================
//
// Name:        AMI_PEI_PCI_TABLE_INIT_PPI_GUID
//
// Description: 
//  This is the GUID to use to locate the the instance of the
//  AMI_PEI_PCI_TABLE_INIT_PPI
//
// Notes:
//  #define AMI_PEI_PCI_TABLE_INIT_PPI_GUID \
//      { 0x97f91e78, 0xea12, 0x4ea6, 0xb7, 0xb3, 0x7b, 0x6, 0x78, 0xc2, 0x86, 0x73 }
//
//============================================================================
//<AMI_GHDR_END>
#define AMI_PEI_PCI_TABLE_INIT_PPI_GUID \
{   0x97f91e78, 0xea12, 0x4ea6, 0xb7, 0xb3, 0x7b, 0x6, 0x78, 0xc2, 0x86, 0x73 }

GUID_VARIABLE_DECLARATION(gPeiPciTableInitPpiGuid,AMI_PEI_PCI_TABLE_INIT_PPI_GUID);

#ifndef GUID_VARIABLE_DEFINITION
#include <PPI/PciCfg2.h>

typedef struct  _AMI_PEI_PCI_TABLE_INIT_PPI     AMI_PEI_PCI_TABLE_INIT_PPI;

//<AMI_GHDR_START>
//------------------------------------------------------------------
//
// Name:        AMI_PEI_PCI_INIT_TABLE_STRUCT
//
// Fields:      Type    ParameterName    Description
//------------------------------------------------------------------
//  UINT8 bRegIndex - PCI Register to program
//  UINT8 bANDMask - AND mask to apply to data in PCI register
//  UINT8 bORMask - OR mask to apply to data in PCI register after AND mask
//
// Description: 
//  This data structure contains the information that is used to 
//  modify PCI register of a PCI specific device
//  
//
// Notes:   
//  Only can modify a one byte register at a time.  
//  See AMI_PEI_PCI_INIT_TABLE_STRUCT2 to modify lager register
//  at once
//      
//------------------------------------------------------------------
//<AMI_GHDR_END>
typedef struct _AMI_PEI_PCI_INIT_TABLE_STRUCT
{
    UINT8       bRegIndex;
    UINT8       bANDMask;
    UINT8       bORMask;
}   AMI_PEI_PCI_INIT_TABLE_STRUCT;

//<AMI_GHDR_START>
//------------------------------------------------------------------
//
// Name:        AMI_PEI_PCI_INIT_TABLE_STRUCT2
//
// Fields:      Type    ParameterName    Description
//------------------------------------------------------------------
//  UINT8 bRegIndex - PCI Register to program
//  UINTN bANDMask - AND mask to apply to data in PCI register
//  UINTN bORMask - OR mask to apply to data in PCI register after AND mask
//
// Description: 
//  This data structure contains the information that is used to 
//  modify PCI register of a PCI specific device
//  
//
// Notes:
//  This Structure is almost the same as AMI_PEI_PCI_INIT_TABLE_STRUCT
//  The difference is in the size of the AND and OR masks. to allow
//  modification of PCI registers larger than one byte
//      
//------------------------------------------------------------------
//<AMI_GHDR_END>
typedef struct 
{
    UINT8       bRegIndex;          // register offset to modify
    UINTN       bANDMask;           // specified bits will be cleared
    UINTN       bORMask;            // specified bits will be set
} AMI_PEI_PCI_INIT_TABLE_STRUCT2;

typedef
EFI_STATUS
(EFIAPI * AMI_PEI_PCI_TABLE_INIT_FUNCTION) (
    IN          EFI_PEI_SERVICES                **PeiServices,
    IN          AMI_PEI_PCI_TABLE_INIT_PPI      *This,
    IN          EFI_PEI_PCI_CFG2_PPI            *PciCfg,        // OPTIONAL
    IN          UINT64                          Address,
    IN          AMI_PEI_PCI_INIT_TABLE_STRUCT   PCIInitTable[],
    IN          UINT16                          wSize
    );

// This version allows a table of specified access width up to UINTN
typedef
EFI_STATUS
(EFIAPI * AMI_PEI_PCI_TABLE_INIT_FUNCTION_VARACCESS) (
    IN          EFI_PEI_SERVICES                **PeiServices,
    IN          AMI_PEI_PCI_TABLE_INIT_PPI      *This,
    IN          EFI_PEI_PCI_CFG2_PPI            *PciCfg,        // OPTIONAL
    IN          UINT64                          CfgAddress,
    IN          AMI_PEI_PCI_INIT_TABLE_STRUCT2  *PciInitTable,
    IN          UINT16                          TableEntries,
    IN          EFI_PEI_PCI_CFG_PPI_WIDTH       AccessWidth
);

//<AMI_GHDR_START>
//------------------------------------------------------------------
//
// Name:        AMI_PEI_PCI_TABLE_INIT_PPI
//
// Description: 
//  This data structure is the AMI_PEI_PCI_TABLE_INIT_PPI definition 
//  This provides this PPI to any module that includes the chipset 
//  library.  This provides a mechanism to program a table full of
//  PCI information in one function call
//  
// Fields:      Type    ParameterName    Description
//------------------------------------------------------------------
//  AMI_PEI_PCI_TABLE_INIT_FUNCTION AMIPEIProgramPCITable - PciTableInit
//  AMI_PEI_PCI_TABLE_INIT_FUNCTION_VARACCESS ProgramPciTable - PciTableInit2
//
// Notes:
//  See the function headers for descriptions
//
//------------------------------------------------------------------
//<AMI_GHDR_END>
typedef struct _AMI_PEI_PCI_TABLE_INIT_PPI
{
    AMI_PEI_PCI_TABLE_INIT_FUNCTION             AMIPEIProgramPCITable;
    AMI_PEI_PCI_TABLE_INIT_FUNCTION_VARACCESS   ProgramPciTable;
} AMI_PEI_PCI_TABLE_INIT_PPI;


/****** DO NOT WRITE BELOW THIS LINE *******/
#endif // #ifndef GUID_VARIABLE_DEFINITION
#ifdef __cplusplus
}
#endif

#endif
//*************************************************************************
//*************************************************************************
//**                                                                     **
//**        (C)Copyright 1985-2008, American Megatrends, Inc.            **
//**                                                                     **
//**                       All Rights Reserved.                          **
//**                                                                     **
//**      5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093           **
//**                                                                     **
//**                       Phone: (770)-246-8600                         **
//**                                                                     **
//*************************************************************************
//*************************************************************************