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
|
//*************************************************************************
//*************************************************************************
//** **
//** (C)Copyright 1985-2011, American Megatrends, Inc. **
//** **
//** All Rights Reserved. **
//** **
//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
//** **
//** Phone: (770)-246-8600 **
//** **
//*************************************************************************
//*************************************************************************
//
//*************************************************************************
// $Header: /Alaska/BIN/IO/Fintek/F81216_Sec/F81216PEI.C 3 7/04/11 3:22a Kasalinyi $
//
// $Revision: 3 $
//
// $Date: 7/04/11 3:22a $
//*************************************************************************
// Revision History
// ----------------
// $Log: /Alaska/BIN/IO/Fintek/F81216_Sec/F81216PEI.C $
//
// 3 7/04/11 3:22a Kasalinyi
// [Category] Improvement
// [Description] Update to new template
// [Files] IO_F81216.SDL
// F81216.ASL
// F81216.MAK
// F81216.SD
// F81216.UNI
// F81216DXE.C
// F81216PEI.C
// F81216Setup.H
// F81216.CIF
//
// 2 9/06/10 3:50a Mikes
// Fix compile issue with first IO module
//
// 1 3/31/10 5:55a Fantasylai
// Initial release to F81216 just as a second IO
//
//*************************************************************************
//<AMI_FHDR_START>
//
// Name: <F81216PEI.C>
//
// Description: Porting for PEI phase.Just for necessary devices porting.
//
//
//<AMI_FHDR_END>
//*************************************************************************
//-------------------------------------------------------------------------
// Include Files
//-------------------------------------------------------------------------
#include <Pei.h>
#include <Setup.h>
#include <Token.h>
#include <AmiLib.h>
#include <Protocol\AmiSio.h>
#include <AmiCspLib.h>
#include "BSP\PeiIoTable.h"
//-------------------------------------------------------------------------
// Constants, Macros and Type Definitions
//-------------------------------------------------------------------------
//-------------------------------------------------------------------------
//Variable, Prototype, and External Declarations
//-------------------------------------------------------------------------
extern EFI_STATUS PeiLoopCspIoDecodeListInit (
IN VOID *Fun,
IN UINT16 Base,
IN UINT8 DevUid,
IN SIO_DEV_TYPE Type);
static VOID PeiSetLpcDeviceDecoding(VOID); //
VOID F81216SEC_INIT(VOID); //
VOID PeiF81216SECInit (
IN EFI_FFS_FILE_HEADER *FfsHeader,
IN EFI_PEI_SERVICES **PeiServices
);
// <AMI_PHDR_START>
//-------------------------------------------------------------------------
//
// Procedure: PeiF81216SECInit
//
// Description:
// This function provide PEI phase SIO initialization
//
// Input:
// IN EFI_FFS_FILE_HEADER *FfsHeader - Logical Device's information
// IN EFI_PEI_SERVICES **PeiServices - Read/Write PCI config space
//
// Output: None
//
// Modified: Nothing
//
// Referrals: None
//
// Note:
//-------------------------------------------------------------------------
// <AMI_PHDR_END>
VOID PeiF81216SECInit (
IN EFI_FFS_FILE_HEADER *FfsHeader,
IN EFI_PEI_SERVICES **PeiServices
)
{
F81216SEC_INIT();
}
// <AMI_PHDR_START>
//-------------------------------------------------------------------------
//
// Procedure: F81216SEC_INIT
//
// Description:
//
// This function Step through table and initialize the Logic Device
//
// Input: None
//
// Output: EFI_STATUS
//
// Modified: Nothing
//
// Referrals: None
//
// Note:
//-------------------------------------------------------------------------
// <AMI_PHDR_END>
VOID F81216SEC_INIT(VOID)
{
UINTN i;
// Decode neccessary IO resource in PEI phase
PeiSetLpcDeviceDecoding();
// Step through table and initialize the Serial Port
for(i=0; i<(sizeof(F81216SEC_PEI_Init_Table))/(sizeof(SIO_DATA));i++) {
// If Mask=0xFF,only write register.
if(F81216SEC_PEI_Init_Table[i].DataMask == 0xFF) {
IoWrite8(F81216SEC_PEI_Init_Table[i].Addr, F81216SEC_PEI_Init_Table[i].DataValue);
}
// Read and writer register
else {
IoWrite8(F81216SEC_PEI_Init_Table[i].Addr, \
IoRead8(F81216SEC_PEI_Init_Table[i].Addr) \
& F81216SEC_PEI_Init_Table[i].DataMask \
| F81216SEC_PEI_Init_Table[i].DataValue);
}
}
}
//<AMI_PHDR_START>
//-------------------------------------------------------------------------
// Procedure: PeiSetLpcDeviceDecoding
//
// Description:
// This function is used to open IoDecode for logic devices initialized in PEI
//
// Input:
//
// Output: EFI_STATUS
//
// Notes: PORTING REQUIRED
//-------------------------------------------------------------------------
//<AMI_PHDR_END>
static VOID PeiSetLpcDeviceDecoding(VOID)
{
EFI_STATUS Status=EFI_SUCCESS;
UINT8 i;
for(i=0;i<(sizeof(F81216SEC_Decode_Table))/(sizeof(IO_DECODE_DATA));i++)
{
Status = PeiLoopCspIoDecodeListInit( NULL,\
F81216SEC_Decode_Table[i].BaseAdd,\
F81216SEC_Decode_Table[i].UID,\
F81216SEC_Decode_Table[i].Type);
}
}
//*************************************************************************
//*************************************************************************
//** **
//** (C)Copyright 1985-2011, American Megatrends, Inc. **
//** **
//** All Rights Reserved. **
//** **
//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
//** **
//** Phone: (770)-246-8600 **
//** **
//*************************************************************************
//*************************************************************************
|