summaryrefslogtreecommitdiff
path: root/Board/EM/Thunderbolt/TbtOemBoard/TbtOemBoard.h
blob: c4ce1aca9935ab488cd677f1d6eed2c2d35ba9f1 (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
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
//*************************************************************************
//*************************************************************************
//**                                                                     **
//**        (C)Copyright 1985-2011, American Megatrends, Inc.            **
//**                                                                     **
//**                       All Rights Reserved.                          **
//**                                                                     **
//**      5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093           **
//**                                                                     **
//**                       Phone: (770)-246-8600                         **
//**                                                                     **
//*************************************************************************
//*************************************************************************
//*************************************************************************
// $Header: /Alaska/SOURCE/Modules/Thunderbolt/TbtOemBoard/TbtOemBoard.h 11    5/19/14 7:15a Barretlin $
//
// $Revision: 11 $
//
// $Date: 5/19/14 7:15a $
//*************************************************************************
// Revision History
// ----------------
// $Log: /Alaska/SOURCE/Modules/Thunderbolt/TbtOemBoard/TbtOemBoard.h $
// 
// 11    5/19/14 7:15a Barretlin
// [TAG]  		EIP N/A
// [Category]  	Improvement
// [Description]  	Using setup item choose return value of _RMV method in
// ASL code
// [Files]  		TbtDxe.c TbtGpe.asl TbtOemBoard.c TbtOemBoard.h TbtSetup.sd
// TbtSetup.sdl TbtSetup.uni
// 
// 10    2/18/14 7:29a Barretlin
// [TAG]  		EIP152401
// [Category]  	Spec Update
// [Severity]  	Minor
// [Description]  	add new Thunderbolt chip series
// [Files]  		TbtOemBoard.h
// 
// 9     2/10/14 1:26p Barretlin
// [TAG]  		EIP N/A
// [Category]  	Improvement
// [Description]  	remove useless policy item and setup item
// [Files]  		TbtOemBoard.h TbtOemBoard.c TbSetup.sdl TbtSetup.sd
// TbtSetup.uni TbtSmm.c
// 
// 8     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
// 
// 7     7/26/13 1:53a Barretlin
// [TAG]  		EIP N/A
// [Category]  	Improvement
// [Description]  	Fix build error at MahoBay/ChiefRiver platform
// [Files]  		TbtPei.c TbtOemBoard.h
// 
// 6     6/21/13 7:50a Barretlin
// [TAG]  		EIP N/A
// [Category]  	Improvement
// [Description]  	Fix build error with non Intel RC project
// [Files]  		TbtOemBoard.h TbtOemBoard.sdl
// 
// 5     6/17/13 2:18a Barretlin
// [TAG]  		EIP126581
// [Category]  	Improvement
// [Description]  	add new AIC support setup item and change
// TBWakeupSupport name
// [Files]  		TbtOemBoard.h TbtOemBoard.c
// 
// 4     4/24/13 2:40a Barretlin
// [TAG]  		EIP N/A
// [Category]  	Improvement
// [Description]  	Add new series
// [Files]  		TbtOemBoard.h
// 
// 3     4/03/13 3:04a Barretlin
// [TAG]  		EIP N/A
// [Category]  	Improvement
// [Description]  	Adding mask definition for reading Redwood Ridge
// command
// [Files]  		TbtOemBoard.h
// 
// 2     2/06/13 6:33a Barretlin
// [TAG]  		EIP114556
// [Category]  	Spec Update
// [Severity]  	Normal
// [Description]  	Add more definition for Thunderbolt RR Spec 0.9
// [Files]  		TbtOemBoard.h
// 
// 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
// 
// 15    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
// 
// 14    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
// 
// 13    10/28/12 11:21p Barretlin
// [TAG]  		EIP N/A
// [Category]  	Improvement
// [Description]  	Create new setup item for thunderbolt POC handling
// [Files]  		TbtOemBoard.c TbtOemBoard.h TbtSetup.sdl TbtSetup.sd
// TbtSetup.uni
// 
// 12    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
// 
// 11    8/20/12 5:12a Barretlin
// [TAG]  		EIP N/A
// [Category]  	Improvement
// [Description]  	Fix IO resource workaround broken in 4C 2port case
// [Files]  		TbtSmm.c TbtOemBoard.c TbtOemBoard.h TbtSetup.sdl
// TbtSetup.sd TbtSetup.uni
// 
// 10    8/17/12 8:44a Barretlin
// [TAG]  		EIP N/A
// [Category]  	Improvement
// [Description]  	Add IO resource workaround for Thunderbolt Spec1.1
// Because new spec has removed IO resource for Thunderbolt device
// [Files]  		TbtSmm.c TbtOemBoard.h TbtOemBoard.c TbtSetup.sdl
// TbtSetup.sd TbtSetup.uni 
// 
// 9     7/31/12 4:07a Barretlin
// [TAG]  		EIP96350
// [Category]  	Spec Update
// [Severity]  	Critical
// [Description]  	Updated Thunderbolt specification to version 1.00
// [Files]  		TbtDxe.c TbtSmm.c TbtOemBoard.c TbtOemBoard.h
// TbtOemBoard.sdl TbtSetup.sd TbtSetup.uni
// 
// 8     7/31/12 3:15a Barretlin
// [TAG]  		EIP91119
// [Category]  	Improvement
// [Description]  	Resolution for enable/disable Thunderbolt device option
// rom at POST time
// [Files]  		TbtDxe.c TbtOemBoard.c TbtOemBoard.h TbtOemBoard.sdl
// TbtSetup.sdl TbtSetup.sd TbtSetup.uni
// 
// 7     5/22/12 10:00a Barretlin
// [TAG]  		EIP90650
// [Category]  	Spec Update
// [Description]  	Specificatoin Update 0.94 - The default value of
// OPTIONAL workaround for devices that don't support surprise-removal
// should be disable.
// [Files]  		TbtSmm.c TbtOemBoard.c TbtOemBoard.h
// TbtSetup.sdl TbtSetup.sd TbtSetup.uni
// 
// 6     5/07/12 7:00a Barretlin
// [TAG]  		None
// [Category]  	Improvement
// [Description]  	Add three setup items for debug
// [Files]  		TbtDxe.c
// TbtGpe.asl
// TbtSmm.c
// TbtSetup.sd
// TbtSetup.uni
// TbtOemBoard.c
// TbtOemBoard.h
// 
// 5     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..
// 
// 3     2/20/12 12:57a Wesleychen
// Add new policy "SmiNotifyEnabled".
// 
// 1     12/08/11 4:09a Wesleychen
// Thunderbolt eModule initially releases.
//
//*************************************************************************
#ifndef _THUNDERBOLT_OEM_PROTOCOL_
#define _THUNDERBOLT_OEM_PROTOCOL_

#include <Hob.h>

#define AMI_TBT_PLATFROM_POLICY_PROTOCOL_GUID { 0x380D7A5E, 0x1BCA, 0x11E1, 0xA1, 0x10, 0xE8, 0xEB, 0x47, 0x24, 0x01, 0x9B }

#define AMI_TBT_HR_STATUS_GUID { 0x380D7A5E, 0x1BCA, 0x11E1, 0xA1, 0x10, 0xE8, 0x59, 0x87, 0x32, 0xF1, 0x56 }

#define AMI_TBT_HOB_GUID { 0x380D7A5E, 0x1BCA, 0x11E1, 0xA1, 0x10, 0xE8, 0x5A, 0x87, 0x15, 0x15, 0x47 }

#define TBT_HR_STATUS_VARIABLE L"TbtHRStatusVar"

#define RR_PCIE2TBT 0x54C

#define RR_TBT2PCIE 0x548

#define PCIE2TBT_VLD_B 1

#define TBT2PCIE_DON_R 1

#define MASK_DATA (BIT08 | BIT09 | BIT10 | BIT11)

#define MASK_ERROR (BIT12 | BIT13 | BIT14 | BIT15)

#ifdef PCIEX_BASE_ADDRESS 
#define TBT_CFG_ADDRESS(bus, dev, func, reg) NB_PCIE_CFG_ADDRESS(bus, dev, func, reg)
#endif

#ifndef R_PCH_RCRB_PM_CFG
#define R_PCH_RCRB_PM_CFG   0x3318  // Power Management Configuration Register
#endif

typedef enum {
    Cactus_Ridge = 1,
    Redwood_Ridge,
    Falcon_Ridge,
    BDW_TBT_LP
} TBT_HOST_SERIES;

typedef enum {
    TBT_NORMAL_MODE = 1,
    TBT_NORMAL_MODE_WO_NHI,
    TBT_DIRECT_CONNECTED_WO_NHI,
    TBT_REDRIVER_ONLY,
    TBT_OFF_MODE,
    TBT_DEBUG_MODE,
    TBT_RR_LEGACY_CONNECTION = 0,
    TBT_RR_UNIQUIE_ID,
    TBT_RR_ONE_TIME_SAVED_KEY,
    TBT_RR_DPPLUS
} TBT_SECURITY_TYPE;

typedef enum {
    TBT_GO2SX_WITH_WAKE = 2,
    TBT_GO2SX_NO_WAKE,
    TBT_SX_EXIT_TBT_CONNECTED,
    TBT_SX_EXIT_NO_TBT_CONNECTED,
    TBT_OS_UP,
    TBT_SET_SECURITY_LEVEL = 8,
    TBT_GET_SECURITY_LEVEL
} TBT_RR_COMMOND;

typedef VOID (EFIAPI *TBT_PROGRAM_SEURITY_LVL) (
  IN TBT_SECURITY_TYPE   SecurityLevel
 );

typedef struct _AMI_TBT_HR_STATUS_DATA {
  UINT8                    TbtHRSeries;
  UINT8                    TbtHRStatus;
} AMI_TBT_HR_STATUS_DATA;

typedef struct {
  EFI_HOB_GUID_TYPE        Header;
  UINT8                    TbtSecurityLevelFlag;
} TBT_HOB;

typedef struct _AMI_TBT_PLATFORM_POLICY_PROTOCOL {
  UINT8                    TbtEnable;
  UINT8                    TbtGO2SX;
  UINT8                    TbtForcePWR;
  UINT8                    TbtHotPlugEvt;
  UINT8                    TbtOK2GO2SX_N;
  UINT8                    CacheLineSize;
  UINT8                    TbtWakeupSupport;
  UINT8                    TbtAICSupport;
  UINT8                    TbtHandlePOC;
  UINT8                    TbtSecurityLevel;
  UINT8                    Bus;
  UINT8                    Dev;
  UINT8                    Fun;
  UINT16                   ReserveMemoryPerSlot;
  UINT16                   ReservePMemoryPerSlot;
  UINT8                    ReserveIOPerSlot;
  UINT8                    SmiNotifyEnabled;
  UINT8                    SwSmiEnabled;
  UINT8                    NotifyEnabled;
  UINT8                    TbtRmvReturnValue;
  UINT8                    TbtOptionRom;
  UINT8                    TbtIOresourceEnable;
  UINT8                    TbtNVMversion;
} AMI_TBT_PLATFORM_POLICY_PROTOCOL;

#if !defined TBT_INTEL_RC_CONFIG || TBT_INTEL_RC_CONFIG == 0
#define PCI_DEVICE_NUMBER_PCH_LPC       LPC_DEVICE
#define PCI_FUNCTION_NUMBER_PCH_LPC     LPC_FUNC
#define R_PCH_LPC_GPI_ROUT              0xB8
#define R_PCH_PCIE_CLS                  0x0C
#define R_PCH_PCIE_SLCTL                0x58
#define R_PCH_PCIE_SLSTS                0x5A
#define B_PCH_PCIE_SLSTS_PDS            BIT06
#define R_PCH_PCIE_PMCS                 0xA4
#define B_PCH_PCIE_PMCS_PS              (BIT00 | BIT01)
#endif // TBT_INTEL_RC_CONFIG == 0

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