summaryrefslogtreecommitdiff
path: root/Board/EM/MeWrapper/Icc/IccPlatform/IccPlatform.h
blob: fb4bda402c47851d585405a7991fe0bc17a2d3a5 (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
//*************************************************************************
//*************************************************************************
//**                                                                     **
//**        (C)Copyright 1985-2010, American Megatrends, Inc.            **
//**                                                                     **
//**                       All Rights Reserved.                          **
//**                                                                     **
//**      5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093           **
//**                                                                     **
//**                       Phone: (770)-246-8600                         **
//**                                                                     **
//*************************************************************************
//*************************************************************************
//**********************************************************************
//
// $Header: /Alaska/SOURCE/Modules/SharkBayRefCodes/ME/MeWrapper/Icc/IccPlatform/IccPlatform.h 1     2/08/12 1:06a Klzhan $
//
// $Revision: 1 $
//
// $Date: 2/08/12 1:06a $
//
//**********************************************************************
// Revision History
// ----------------
// $Log: /Alaska/SOURCE/Modules/SharkBayRefCodes/ME/MeWrapper/Icc/IccPlatform/IccPlatform.h $
// 
// 1     2/08/12 1:06a Klzhan
// Initial Check in 
// 
// 4     7/27/11 3:21a Klzhan
// Add Elinks for PCIE and PCI config.
// Note: Don't List GBE port on this Elink.
// 
// 3     7/15/11 12:45a Klzhan
// 
// 2     6/27/11 8:38a Klzhan
// Remove un-use define.
// 
// 1     2/25/11 1:42a Klzhan
// Initial Check-in
// 
// 1     12/03/10 5:10a Klzhan
// Initial Check-in.
// 
//
//**********************************************************************

//<AMI_FHDR_START>
//----------------------------------------------------------------------------
//
// Name:            IccPlatform.h
//
// Description:     Platform-specific ICC code
//
//----------------------------------------------------------------------------
//<AMI_FHDR_END>

/*++
Copyright (c)  2009 Intel Corporation. All rights reserved
This software and associated documentation (if any) is furnished
under a license and may only be used or copied in accordance
with the terms of the license. Except as permitted by such
license, no part of this software or documentation may be
reproduced, stored in a retrieval system, or transmitted in any
form or by any means without the express written consent of
Intel Corporation.

Module Name:

  IccPlatform.h

Abstract:

  Platform-specific ICC code

--*/

#ifdef CougarPoint_SUPPORT
#define SOFTSTRAP10 R_PCH_SPI_STRP10
#else
#define SOFTSTRAP10 R_PCH_SPI_PCHSTRP10
#endif

#define ICC_INIT_TIMEOUT 5000     // ms

#define RETAIN_CLOCK_ENABLES_AT_RESUME_FROM_S3  0x1
#define CLOCK_PROFILE_SELECTOR                  BIT22

#define PROFILE_SELECTED_BY_BIOS  0
#define PROFILE_SELECTED_BY_ME    1

//
// 96-bit mask of registers to be locked by LockIccRegister heci message
// 0 = lock, 1 = don't
// see CPT c-spec for register names
//
#define STATIC_REGISTERS_MASK2    0x00000000
#define STATIC_REGISTERS_MASK1    0x0F0f0013
#define STATIC_REGISTERS_MASK0    0x00000000

#define OPTION_DISABLED           0
#define OPTION_ENABLED            1
#define OPTION_MANUAL             2
#define OPTION_AUTO               3
#define OPTION_LOCK_STATIC        4
#define OPTION_LOCK_ALL           5
#define OPTION_USE_OEM            6
#define OPTION_OVERRIDE           7
//
// OCLKEN (ICC clock enables) register bit definitions
//
#define CLOCK_Flex0       BIT0
#define CLOCK_Flex1       BIT1
#define CLOCK_Flex2       BIT2
#define CLOCK_Flex3       BIT3
#define CLOCK_PCI_Clock0  BIT7
#define CLOCK_PCI_Clock1  BIT8
#define CLOCK_PCI_Clock2  BIT9
#define CLOCK_PCI_Clock3  BIT10
#define CLOCK_PCI_Clock4  BIT11
#define CLOCK_SRC0        BIT16
#define CLOCK_SRC1        BIT17
#define CLOCK_SRC2        BIT18
#define CLOCK_SRC3        BIT19
#define CLOCK_SRC4        BIT20
#define CLOCK_SRC5        BIT21
#define CLOCK_SRC6        BIT22
#define CLOCK_SRC7        BIT23
#define CLOCK_CSI_SRC8    BIT24
#define CLOCK_CSI_DP      BIT25
#define CLOCK_PEG_A       BIT26
#define CLOCK_PEG_B       BIT27
#define CLOCK_DMI         BIT28

#define BDS_ALL_DRIVERS_CONNECTED_PROTOCOL_GUID \
  {0xdbc9fd21, 0xfad8, 0x45b0, 0x9e, 0x78, 0x27, 0x15, 0x88, 0x67, 0xcc, 0x93}

typedef struct {
  UINT32  Clock;
  UINT8   DeviceNumber;
  BOOLEAN HotPlugSupport;
} PLATFORM_PCI_SLOTS;

typedef struct {
  UINT32  Clock;
  UINT8   RootPortNumber;
  BOOLEAN HotPlugSupport;
} PLATFORM_PCIE_SLOTS;

typedef struct _ICC_CONFIG {
  UINT8   LockIccRegisters;
  UINT8   SetClkEnables;
  UINT8   ProfileSelection;
  UINT8   SelectedIccProfile;
  UINT32  LockMask[3];
  UINT32  ClkEnables;
  UINT32  ClkEnablesMask;
  UINT8   ClocksModified;
} ICC_CONFIG;

VOID
DisableProfileSelection (
  VOID
  );

EFI_STATUS
ProfileSelection (
  IN UINT8 NewProfile
  );

EFI_STATUS
DetectUsedClocks (
  OUT UINT32 *UsedClocks,
  OUT UINT32 *AllClocks
  );

EFI_STATUS
CallSetClockEnables (
  IN EFI_EVENT Event,
  IN VOID      *Context
  );

EFI_STATUS
ReadMainSetupData (
  ICC_CONFIG* IccConfig
  );

UINT8
ReadIccSoftStraps (
  VOID
  );

EFI_STATUS
WaitForFwInitComplete (
  UINT32 uSeconds
  );

EFI_STATUS
IccFailureNotification (
  VOID
  );

EFI_STATUS 
SendIccMessages (
  IN EFI_EVENT Event,
  IN VOID      *Context
  );

EFI_STATUS
IccMessages (
  VOID
  );

#ifdef CougarPoint_SUPPORT

EFI_STATUS
WdtSupport (
  VOID
  );

EFI_STATUS
FeedWatchdog (
  IN EFI_EVENT Event,
  IN VOID      *Context
  );

EFI_STATUS
StopFeedingWatchdog (
  IN EFI_EVENT Event,
  IN VOID      *Context
  );

#endif;

#if defined PERF_TUNE_SUPPORT && PERF_TUNE_SUPPORT == 1
typedef struct _ACPI_HDR {
    UINT32      Signature;
    UINT32      Length;
    UINT8       Revision;
    UINT8       Checksum;
    UINT8       OemId[6]; 
    UINT8       OemTblId[8];
    UINT32      OemRev;
    UINT32      CreatorId;
    UINT32      CreatorRev;
} ACPI_HDR,*PACPI_HDR;
#endif;
//*************************************************************************
//*************************************************************************
//**                                                                     **
//**        (C)Copyright 1985-2010, American Megatrends, Inc.            **
//**                                                                     **
//**                       All Rights Reserved.                          **
//**                                                                     **
//**      5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093           **
//**                                                                     **
//**                       Phone: (770)-246-8600                         **
//**                                                                     **
//*************************************************************************
//*************************************************************************