summaryrefslogtreecommitdiff
path: root/Board/EM/Thunderbolt/TbtOemBoard/TbtOemLib.h
blob: ba3ca9132c385e42f993ba02507fc34ba965d9ef (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
//*************************************************************************
//*************************************************************************
//**                                                                     **
//**        (C)Copyright 1985-2012, American Megatrends, Inc.            **
//**                                                                     **
//**                       All Rights Reserved.                          **
//**                                                                     **
//**      5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093           **
//**                                                                     **
//**                       Phone: (770)-246-8600                         **
//**                                                                     **
//*************************************************************************
//*************************************************************************
//*************************************************************************
// $Header: /Alaska/SOURCE/Modules/Thunderbolt/TbtOemBoard/TbtOemLib.h 4     5/19/14 7:38a Barretlin $
//
// $ReviGpion: 1 $
//
// $Date: 5/19/14 7:38a $
//*************************************************************************
// ReviGpion History
// ----------------
// $Log: /Alaska/SOURCE/Modules/Thunderbolt/TbtOemBoard/TbtOemLib.h $
// 
// 4     5/19/14 7:38a Barretlin
// [TAG]  		EIP165410
// [Category]  	New Feature
// [Description]  	Support Thunderbolt AIC at NB PCIE slot
// [Files]  		TbtPei.c TbtDxe.c TbtGpe.asl TbtSmm.c TbtOemBoard.c
// TbtOemLib.c TbtOemLib.h TbtSetup.sdl TbtSetup.sd TbtSetup.uni
// TbtSetupReset.c
// 
// 3     1/05/14 2:06p Barretlin
// [TAG]  		EIP N/A
// [Category]  	New Feature
// [Description]  	Support Thunderbolt feature Enable/Disable in run time
// Support dynamic Thunderbolt AIC location in run time
// [Files]  		TbtOemBoard.h TbtOemBoard.c TbtOemLib.c TbtOemLib.h
// 
// 2     4/03/13 2:47a Barretlin
// [TAG]  		EIP N/A
// [Category]  	Improvement
// [Description]  	Double check Security Level between Thunderbolt host FW
// and BIOS are same or not for Redwood Ridge chip when entering setup
// page.
// [Files]  		TbtOemLib.c TbtOemLib.h TbtSetupReset.c
// 
// 1     1/10/13 4:57a Barretlin
// Change SS path and update module for Thunderbolt Spec 1.6 for Cactus
// Ridge chip and Thunderbolt Spec 0.5 for Redwood Ridge chip
// 
// 7     12/12/12 4:14a Barretlin
// [TAG]  		EIP108272
// [Category]  	Spec Update
// [Severity]  	Important
// [Description]  	Update to Spec 1.4 to support Redwood Ridge chip
// [Files]  		TbtPei.c TbtSmm.c TbtDxe.c TbtDxe.sdl TbtGpe.asl
// TbtOemBoard.c TbtOemBoard.h TbtOemLib.c TbtOemLib.h
// 
// 6     10/28/12 11:50p Barretlin
// [TAG]  		EIP104870
// [Category]  	Spec Update
// [Severity]  	Important
// [Description]  	Change wake up flow for Spec 1.2 and Spec 1.3
// [Files]  		TbtPei.c TbtSmm.c TbtOemBoard.c TbtOemBoard.h
// TbtOemBoard.sdl TbtOemLib.c TbtOemLib.h
// 
// 5     10/04/12 10:42p Barretlin
// [TAG]  		EIP102947
// [Category]  	Spec Update
// [Severity]  	Normal
// [Description]  	Update Thunderbolt Spec to Rev 1.2
// [Files]  		TbtPei.c TbtOemLib.c TbtOemLib.h
// 
// 4     10/03/12 9:27p Barretlin
// [TAG]  		EIP N/A
// [Category]  	Improvement
// [Description]  	Change Programming security level timing for saving
// boot time
// [Files]  		TbtPei.c TbtDxe.c TbtOemBoard.h TbtOemLib.c TbtOemLib.h
// 
// 3     3/05/12 1:16a Barretlin
// [TAG]  		EIP83266
// [Category]  	Spec Update
// [Description]  	Specificatoin Update 0.90
// [Files]  		TbtSetup.sdl
// TbtSetup.sd
// TbtSetup.uni
// TbtSetup.cif
// TbtOemBoard.h
// TbtOemLib.c
// TbtOemLib.h
// TbtSmm.c
// TbtPei..
// 
// 1     2/19/12 11:56p Wesleychen
// [TAG]         None
// [Category]    Improvement
// [Description] Add TbtOemLib.
// [Files]       TbtOemLib.c; TbtOemLib.h; TbtOemBoard,mak;
//               TbtOemBoard.cif.
// 
// 1     12/08/11 4:09a Wesleychen
// Thunderbolt eModule initially releases.
//
//*************************************************************************
#ifndef _THUNDERBOLT_OEM_LIB_
#define _THUNDERBOLT_OEM_LIB_

#include "TbtOemBoard.h"

UINT8 ReadSio(
  IN UINT8           Index
);

VOID WriteSio(
  IN UINT8           Index,
  IN UINT8           Value
);

VOID SetSio(
  IN UINT8           Index,
  IN UINT8           Set
);

VOID ResetSio(
  IN UINT8           Index,
  IN UINT8           Rst
);

VOID OpenSioConfig(
  VOID
);

VOID SetSioLdn(
  IN UINT8           Ldn
);

UINT8 GetHRInfo(
  VOID
);

BOOLEAN TbtSetPCIe2TBTCommand(
  IN UINT8             UpPortBus,
  IN UINT8             Data,
  IN UINT8             Command,
  IN UINTN             Timeout
);

VOID TbtBeforeSxExitFlow(
  IN VOID              *Services,
  IN UINT8             TbtHostSeries
);

UINT8 SynchSecurityLevel(
  IN UINT8             BiosSecurityLevel,
  IN UINT8             TbtHostLocation
);

VOID ProgramTbtSecurityLevel(
  IN UINT8             *TbtSecurityLevel,
  IN UINT8             TbtHostSeries,
  IN UINT8             TbtHostLocation,
  IN BOOLEAN           IsPei
);

VOID PeiFinialProgramTbtSecurityLevel(
  IN UINT8             TbtSecurityLevel
);

VOID FinialProgramTbtSecurityLevel(
  IN AMI_TBT_PLATFORM_POLICY_PROTOCOL *PlatformPolocy
);

EFI_STATUS ActiveTbtGpio2(
  VOID
);

EFI_STATUS InactiveTbtGpio2(
  VOID
);

EFI_STATUS PollTbtGpio9(
  VOID
);

EFI_STATUS PullDownTbtGpio9(
  VOID
);

EFI_STATUS ReleaseTbtGpio9(
  VOID
);

EFI_STATUS PowerOnPOC(
  VOID
);

EFI_STATUS PowerOffPOC(
  VOID
);

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