blob: c09e2beff70af5aa9c88b39cde535dbc6c63eda3 [file] [log] [blame]
zbao7d94cf92012-07-02 14:19:14 +08001/* $NoKeywords:$ */
2/**
3 * @file
4 *
5 * mn.h
6 *
7 * Common Northbridge
8 *
9 * @xrefitem bom "File Content Label" "Release Content"
10 * @e project: AGESA
11 * @e sub-project: (Mem)
12 * @e \$Revision: 64574 $ @e \$Date: 2012-01-25 01:01:51 -0600 (Wed, 25 Jan 2012) $
13 *
14 **/
15/*****************************************************************************
16 *
Siyuan Wang641f00c2013-06-08 11:50:55 +080017 * Copyright (c) 2008 - 2012, Advanced Micro Devices, Inc.
18 * All rights reserved.
19 *
20 * Redistribution and use in source and binary forms, with or without
21 * modification, are permitted provided that the following conditions are met:
22 * * Redistributions of source code must retain the above copyright
23 * notice, this list of conditions and the following disclaimer.
24 * * Redistributions in binary form must reproduce the above copyright
25 * notice, this list of conditions and the following disclaimer in the
26 * documentation and/or other materials provided with the distribution.
27 * * Neither the name of Advanced Micro Devices, Inc. nor the names of
28 * its contributors may be used to endorse or promote products derived
29 * from this software without specific prior written permission.
30 *
31 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
32 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
33 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
34 * DISCLAIMED. IN NO EVENT SHALL ADVANCED MICRO DEVICES, INC. BE LIABLE FOR ANY
35 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
36 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
37 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
38 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
39 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
40 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
zbao7d94cf92012-07-02 14:19:14 +080041 * ***************************************************************************
42 *
43 */
44
45#ifndef _MN_H_
46#define _MN_H_
47
48/*----------------------------------------------------------------------------
49 * Mixed (DEFINITIONS AND MACROS / TYPEDEFS, STRUCTURES, ENUMS)
50 *
51 *----------------------------------------------------------------------------
52 */
53
54/*-----------------------------------------------------------------------------
55 * DEFINITIONS AND MACROS
56 *
57 *-----------------------------------------------------------------------------
58 */
59#define _4GB_RJ16 (((UINT32) 4) << (30 - 16))
60#define _1TB_RJ16 (((UINT32) 1) << (40 - 16))
61#define HT_REGION_BASE_RJ16 ((UINT32)0x00FD0000ul)
62
63#define DCT_ACCESS_WRITE (UINT32) 0x40000000ul
64#define MTRR_VALID 11
65#define THERMAL_OPT 31
66
67#define NB_ACCESS 0
68#define DCT_PHY_ACCESS 1
69#define DCT_EXTRA 2
70
71#define DCT_PHY_DIRECT 0xF1
72
73#define VT_MSK_VALUE 0
74#define VT_ARRAY 1
75/*---------------------------------------------
76 * TSEFO - Type Start End Function Offset
77 *
78 * 31:30 Type of access (2-bits)
79 * 29:29 Special (1-bit)
80 * 28:28 Phy Direct (1-bit)
81 * 27:27 Whole Register Access (1-bit)
82 * 26:26 Linked (1-bit)
83 * 25:21 Start bit (5-bits)
84 * 20:16 End bit (5-bits)
85 * 15:00 Function_Offset/Index (16-bits)
86 *---------------------------------------------
87 */
88typedef UINT32 TSEFO;
89
90/**
91 MAKE_TSEFO(TableName, a, b, c, d, BitFieldIndex):
92
93 @param[in] TableName
94 @param[in] BitFieldIndex
95 @param[in] a Type of access.
96 @param[in] b Index of register (can be in Function_Offset format).
97 @param[in] c Highest bit of the bit field.
98 @param[in] d Lowest bit of the bit field.
99
100 @return TSEFO Access params encrypted in TSEFO format.
101--*/
102#define MAKE_TSEFO(TableName, a, b, c, d, BitFieldIndex) \
103TableName[BitFieldIndex] = ( \
104 (a == DCT_PHY_DIRECT) ? ( \
105 (((UINT32) DCT_PHY_ACCESS) << 30) | (((UINT32) 1) << 28) | (((UINT32) b) & 0xFFFF) | (\
106 ((c == 15) && (d == 0)) ? ( \
107 (((UINT32) 1) << 27) | (((UINT32) b) & 0xF0000) \
108 ) : ( \
109 (c >= d) ? ( \
110 (((UINT32) c) << 21) | (((UINT32) d) << 16) \
111 ) : ( \
112 (((UINT32) d) << 21) | (((UINT32) c) << 16) \
113 ) \
114 ) \
115 ) \
116 ) : ( \
117 (((UINT32) a) << 30) | (((UINT32) b) & 0xFFFFFFF) | ( \
118 (((UINT32) b) >> 16) ? ( \
119 (((UINT32) 1) << 29) \
120 ) : ( \
121 (c >= d) ? ( \
122 (((UINT32) c) << 21) | (((UINT32) d) << 16) \
123 ) : ( \
124 (((UINT32) d) << 21) | (((UINT32) c) << 16) \
125 ) \
126 ) \
127 ) \
128 ) \
129)
130
131/**
132 LINK_TSEFO(TableName, LowerBitFieldIndex, HigherBitFieldIndex):
133 This is one way link: any write to LowerBitFieldIndex would write to HigherBitFieldIndex,
134 but NOT the other way around.
135 Requirement: LowerBitFieldIndex must be declared *right* before HigherBitFieldIndex.
136
137 @param[in] TableName
138 @param[in] LowerBitFieldIndex
139 @param[in] HigherBitFieldIndex
140
141 @return TSEFO Access params encrypted in TSEFO format.
142--*/
143#define LINK_TSEFO(TableName, LowerBitFieldIndex, HigherBitFieldIndex) { \
144 ASSERT (LowerBitFieldIndex == (HigherBitFieldIndex - 1)) ; \
145 TableName[LowerBitFieldIndex] = TableName[LowerBitFieldIndex] | (((UINT32) 1) << 26); \
146}
147
148// Indicate when a bitfield has multiple memory Pstate copy
149#define MULTI_MPSTATE_COPY_TSEFO(TableName, BitFieldName) \
150 TableName[BitFieldName] = TableName[BitFieldName] | (((UINT32) 1) << 29)
151
152#define TSEFO_TYPE(x) ((UINT8) (((UINT32) (x) >> 30) & 0x03))
153#define TSEFO_START(x) ((UINT8) (((UINT32) (x) >> 21) & 0x1F))
154#define TSEFO_END(x) ((UINT8) (((UINT32) (x) >> 16) & 0x1F))
155#define TSEFO_OFFSET(x) ((UINT32) (x) & 0xFFFF)
156#define TSEFO_LINKED(x) ((UINT8) (((UINT32) (x) >> 26) & 0x01))
157#define TSEFO_DIRECT_EN(x) ((UINT8) (((UINT32) (x) >> 28) & 0x01))
158#define TSEFO_WHOLE_REG_ACCESS(x) ((UINT8) (((UINT32) (x) >> 27) & 0x01))
159#define _FN(x, y) (((UINT32) (x) << 12) + (UINT32) (y))
160#define TSEFO_MULTI_MPSTATE_COPY(x) ((UINT8) (((UINT32) (x) >> 29) & 1))
161#define _NOT_USED_ 0
162
163/* */
164#define B0_DLY 0
165#define B1_DLY 1
166#define B2_DLY 2
167#define B3_DLY 3
168#define B4_DLY 4
169#define B5_DLY 5
170#define B6_DLY 6
171#define B7_DLY 7
172#define ECC_DLY 8
173
174#define DDR2_TRAIN_FLOW 0
175#define DDR3_TRAIN_FLOW 1
176
177//
178// Minimum Data Eye width in consecutive 32nds of a UI of
179// valid data
180//
181#define MIN_RD_DATAEYE_WIDTH_NB 4
182#define MIN_WR_DATAEYE_WIDTH_NB 4
183
184//
185// RELIABLE READ/WRITE MODE DEFINITIONS
186//
187#define PRECHARGE_ALL_BANKS 0xFF ///< Use to specify PrechargeAll Command to Precharge Cmd Function
188#define CMD_TGT_A 0x00 ///< Issue Commands to Command Target A
189#define CMD_TGT_AB 0x01 ///< Issue Commands to Command Targets A and B
190#define CMD_TYPE_READ 0x00 ///< Read Command
191#define CMD_TYPE_WRITE 0x01 ///< Write Command
192#define CMD_TYPE_WR_RD 0x02 ///< Alternating Write and Read Commands
193#define CPG_BANK_ADDRESS_A 0x0 ///< Dimm Bank address used in Reliable RD/RW mode training
194#define CPG_BANK_ADDRESS_B 0x1 ///< Dimm Bank address used in Reliable RD/RW mode training
195#define CPG_ROW_ADDRESS_A 0x0 ///< Dimm Row address used in Reliable RD/RW mode training
196#define CPG_ROW_ADDRESS_B 0x0 ///< Dimm Row address used in Reliable RD/RW mode training
197#define CPG_COL_ADDRESS_A 0x0 ///< Dimm Column address used in Reliable RD/RW mode training
198#define CPG_COL_ADDRESS_B 0x0 ///< Dimm Column address used in Reliable RD/RW mode training
199#define CPG_COMPARE_MASK_LOW 0x00000000ul ///< Dram DQMask[31:0] used to mask comparison on reads. 1=ignore
200#define CPG_COMPARE_MASK_HI 0x00000000ul ///< Dram DQMask[63:32] used to mask comparison on reads. 1=ignore
201#define CPG_COMPARE_MASK_ECC 0x00 ///< Dram EccMask used to mask comparison on reads. 1=ignore
202#define PRBS_SEED_32 0x062221ul ///< Data PRBS Seed
203#define PRBS_SEED_64 0x066665ul ///< Data PRBS Seed
204#define PRBS_SEED_128 0x026666ul ///< Data PRBS Seed
205#define PRBS_SEED_256 0x044443ul ///< Data PRBS Seed
206
207
208/*----------------------------------------------------------------------------
209 * TYPEDEFS, STRUCTURES, ENUMS
210 *
211 *----------------------------------------------------------------------------
212 */
213
214/// Structure for Reliable Read/Write Mode Data
215/// These are values that may need to be referenced by the low level functions
216/// during training and are initialized at the begining of a particular type of training.
217typedef struct _RRW_SETTINGS {
218 UINT8 CmdTgt; ///< Value to program into CmdTgt
219 UINT8 TgtBankAddressA; ///< Target A Bank address
220 UINT32 TgtRowAddressA; ///< Target A Row address
221 UINT32 TgtColAddressA; ///< Target A Column address
222 UINT8 TgtBankAddressB; ///< Target B Bank address
223 UINT32 TgtRowAddressB; ///< Target B Row address
224 UINT32 TgtColAddressB; ///< Target B Column address
225 UINT32 CompareMaskLow; ///< Compare Mask Bits 31:0
226 UINT32 CompareMaskHigh; ///< Compare Mask Bits 63:32
227 UINT8 CompareMaskEcc; ///< Compare Mask Ecc
228 UINT32 DataPrbsSeed; ///< PRBS Seed value
229} RRW_SETTINGS;
230
231/// DQS training related delays
232typedef enum {
233 AccessRcvEnDly, ///< Receiver enable delay
234 AccessWrDatDly, ///< Write data delay
235 AccessRdDqsDly, ///< Read DQS delay
236 AccessWrDqsDly, ///< Write DQS delay
237 AccessPhRecDly, ///< Phase recovery delay
238 excel845
239} TRN_DLY_TYPE;
240
241/// Training patterns for position training
242typedef enum {
243 POS_PATTERN_72B, ///< 72 bit pattern
244 POS_PATTERN_256B, ///< 256 bit pattern
245} POS_TRN_PATTERN_TYPE;
246
247/// ODT mode
248typedef enum {
249 MISSION_MODE, ///< ODT during mission mode
250 WRITE_LEVELING_MODE ///< ODT during write leveling
251} ODT_MODE;
252
253/*
254 * DRBN - Dimm-Rank-Byte-Nibble
255 * 31:12 Reserved
256 * 11:09 Dimm (3-bits)
257 * 08 Rank (1-bit)
258 * 07:05 Reserved
259 * 04:01 Byte (4-bits)
260 * 00 Nibble (1-bit)
261 */
262typedef UINT32 DRBN;
263#define MAKE_DRBN(dimm, rank, byte, nibble) ((((UINT32) (dimm)) << 9) | (((UINT32) (rank)) << 8) | \
264(((UINT32) (byte)) << 1) | ((UINT32) (nibble)) )
265#define DIMM_BYTE_ACCESS(dimm, byte) ((((UINT32) (dimm)) << 9) | (((UINT32) (byte)) << 1))
266#define CS_NBBL_ACCESS(cs, nibble) ((((UINT32) (cs)) << 8) | ((UINT32) (nibble)))
267#define DIMM_NBBL_ACCESS(dimm, nibble) ((((UINT32) (dimm)) << 9) | ((UINT32) (nibble)))
268#define DRBN_DIMM(x) ((UINT8) (((UINT32) (x) >> 9) & 0x07))
269#define DRBN_RANK(x) ((UINT8) (((UINT32) (x) >> 8) & 0x01))
270#define DRBN_BYTE(x) ((UINT8) (((UINT32) (x) >> 1) & 0x0F))
271#define DRBN_NBBL(x) ((UINT8) (((UINT32) (x)) & 0x01))
272#define DRBN_DIMM_NBBL(x) ((UINT8) (((UINT32) (x)) & 0x1F))
273
274/* Dimm Type mask */
275#define DT_X4 0x01
276#define DT_X8 0x02
277#define DT_X16 0x04
278#define DT_SR 0x10
279#define DT_DR 0x20
280#define DT_QR 0x40
281
282#define DT_ANY_X4 0x71
283#define DT_ANY_X8 0x72
284#define DT_ANY_X16 0x74
285#define DT_ANY_SR 0x17
286#define DT_ANY_DR 0x27
287#define DT_ANY_QR 0x47
288#define DT_ANY_SR_DR (DT_ANY_SR | DT_ANY_DR)
289#define DT_ANY (DT_ANY_SR | DT_ANY_DR | DT_ANY_QR)
290
291/// Delay Scaling Info Struct - Describes number of delay increments per UI of a delay type
292///
293typedef struct _TRN_DLY_PARMS {
294 UINT8 Min; ///< Minimum Value
295 UINT8 Max; ///< Maximum Value
296 UINT8 Mask; ///< Mask to be applied (i.e. 0xFF if adjustable by one, 0xFE if adjustable by 2, etc.)
297} TRN_DLY_PARMS;
298
299/// Structure for certain data saving needed for DCT.
300typedef struct {
301 UINT8 RcvEnDlyCounts[8]; ///< DQS Receiver Enable Delay counts
302 UINT32 PhRecReg[3]; ///< 3 Phase recovery control registers
303 BOOLEAN excel846;
304} MEM_DCT_CACHE;
305
306/// Structure for table driven support.
307typedef struct _MEM_TBL_ALIAS {
308 UINT8 time; ///< Modification time.
309 UINT8 node:4; ///< Node on which to make modification.
310 UINT8 dct:4; ///< DCT on which to make modification.
311 UINT8 dimm:4; ///< Dimm on which to make modification.
312 UINT8 attr:3; ///< Attribute of modification.
313 UINT8 vtype:1; ///< Flag indicating value type.
314 UINT32 bfindex; ///< Bit field index that need to be modified.
315 union { ///< Union is defined to easy select between single and multiple bytelane cases.
316 struct { ///< Sub-struct used for one bytelane value.
317 UINT16 bytelane:16; ///< Bytelane on which to make modification.
318 UINT32 value; ///< Modified value.
319 UINT8 reserved[3]; ///< Reserved for this purpose
320 } s; ///< single value to one or multiple bytelanes
321 UINT8 bytelanevalue[9]; ///< Array to specify individual bytelane values
322 } data;
323} MEM_TABLE_ALIAS;
324
325/// Structure for Platform Specific Block.
326typedef struct _MEM_PS_BLOCK {
327 UINT8 DramTerm; ///< Dram Term
328 UINT8 QR_DramTerm; ///< Dram Term for QR
329 UINT8 DynamicDramTerm; ///< Dynamic Dram Term
330 UINT8 NumOfReg[MAX_DIMMS_PER_CHANNEL]; ///< Number of registers on each RDIMM (From SPD)
331 UINT8 MR0WR; ///< MR0WR
332 UINT8 MR0CL31; ///< MR0[CL][3:1]
333 UINT8 MR0CL0; ///< MR0CL[0]
334 UINT8 RttNom[8]; ///< RttNom value for maximum 8 chipsels per channel
335 UINT8 RttWr[8]; ///< RttWr value for maximum 8 chipsels per channel
336 UINT8 F0RC8; ///< F0RC8
337 UINT8 F1RC0; ///< F1RC0
338 UINT8 F1RC1; ///< F1RC1
339 UINT8 F1RC2; ///< F1RC2
340 UINT8 RC10OpSpd; ///< RC10[OperatingSpeed]
341 UINT8 LrdimmRowAddrBits[MAX_DIMMS_PER_CHANNEL]; ///< Effective Row address bits used by LRDIMMS
342 UINT16 SpeedLimit[VOLT1_25_ENCODED_VAL + 1]; ///< SpeedLimit of individual VDDIO
343 UINT8 WLSeedVal; ///< Seed value of WL training extracted from PSC table
344 UINT16 HWRxENSeedVal; ///< Seed value of HW RxEn training extracted from PSC table
345
346 /* PUBLIC functions */
347 BOOLEAN (*MemPDoPs) (struct _MEM_NB_BLOCK *NBPtr); ///< Function that gets Form factor info.
348 VOID (*MemPGetPORFreqLimit) (struct _MEM_NB_BLOCK *NBPtr); ///< Function that gets the speed limit of a dimm population.
349 BOOLEAN (*MemPGetPass1Seeds) (struct _MEM_NB_BLOCK *NBPtr); ///< Function that gets pass1 seeds of WL and RxEn training.
350} MEM_PS_BLOCK;
351
352/// Structure parameters needed in frequency change of client NB.
353typedef struct _MEM_FREQ_CHANGE_PARAM {
354 UINT16 PllLockTimeDefault; ///< Default PllLockTime
355 UINT8 RdPtrInit667orHigher; ///< RdPtrInit for frequency 667MHz and higher
356 UINT8 RdPtrInitLower667; ///< RdPtrInit for frequency lower than 667MHz
357 UINT8 NclkPeriodMul2x; ///< Multiplier for NclkPeriod in parial sum calculation x 2
358 UINT8 MemClkPeriodMul2x; ///< Multiplier for MemClkPeriod in parial sum calculation x 2
359 UINT8 SyncTimeMul4x; ///< Multiplier for SyncTime
360 UINT16 TDataProp800orHigher; ///< TDataProp for frequency 800MHz or higher
361 UINT16 TDataPropLower800; ///< TDataProp for frequency lower than 800MHz
362} MEM_FREQ_CHANGE_PARAM;
363
364/// List for NB items that are supported
365typedef enum {
366 SetSpareEn, ///< Sets spare enable
367 CheckSpareEn, ///< Spare enabled
368 SetDllShutDown, ///< Sets DllShutDown
369 CheckEccDLLPwrDnConfig, ///< Checks to determine if EccDLLPwrDnConf needs to be adjusted
370 DimmBasedOnSpeed, ///< Checks to determine if Dimm number needs to be adjusted based on speed
371 CheckMaxDramRate, ///< Checks to determine the maximum rate
372 Check1GAlign, ///< Checks to determine if 1 GB alignment is supported
373 DramModeBeforeDimmPres, ///< Check to determine if DRAM mode needs to be set before dimm presence
374 DramModeAfterDimmPres, ///< Check to determine if DRAM mode needs to be set after dimm presence
375 CheckClearOnDimmMirror, ///< Check to determine if we need to clear on DIMM mirror
376 CheckDisDllShutdownSR, ///< Check to determine if DisDllShutdown needs to be set
377 CheckMemClkCSPresent, ///< Check to determine if chipselect needs to be set based on disabled memclocks
378 CheckChangeAvgValue, ///< Check to determine if we need to change average value
379 CheckMaxRdDqsDlyPtr, ///< Check to determine change Max Rd Dqs Delay
380 CheckPhyFenceTraining, ///< Check to determine if we need to Phy Fence training
381 CheckGetMCTSysAddr, ///< Check to determine if we need to GetMCTSysAddr
382 CheckSendAllMRCmds, ///< Check to determine if we need to SendAllMRCmds
383 CheckFindPSOverideWithSocket, ///< Check to determine if we need to Find PSOveride With Socket
384 CheckFindPSDct, ///< Check to determine if we need to Find PSOveride With DCT
385 CheckODTControls, ///< Check to determine if we need to set ODT controls
386 CheckDummyCLRead, ///< Check to determine if an extra dummy read is required
387 CheckDllStdBy, ///< Check to determine if setting DLL stand by is required
388 CheckSlewWithMarginImprv, ///< Check to determine if setting of Slew With MarginImprv is required
389 CheckSlewWithoutMarginImprv, ///< Check to determine if setting of Slew Without MarginImprv is required
390 CheckDllSpeedUp, ///< Check to determine if setting of Dll SpeedUp is required
391 CheckDllRegDis, ///< Check to determine if setting of DLL Regulator Disable is required
392 FenceTrnBeforeDramInit, ///< Check to determine if fence training has been done before Dram init
393 WLSeedAdjust, ///< Check to determine if WL seed needs to be adjusted
394 UnifiedNbFence, ///< Check to determine if Phy fence is of Unified NB
395 AdjustTwr, ///< Check to determine if Twr needs to be adjusted
396 ChannelPDMode, ///< Check to determine if channel power down mode is the only that is supported
397 ForceEnMemHoleRemapping, ///< Check to determine if we need to force enabling memory hole remapping
398 AdjustTrdrdSD, ///< Check to determine if we need to adjust TrdrdSD
399 ReverseMaxRdLatTrain, ///< Check to determine if reverse (pass to fail) algorithm is supported for MaxRdLat training
400 SkipErrTrain, ///< Check to determine if skip error training is supported
401 DramSrHys, ///< Check to determine if DRAM SR hysteresis is supported
402 PchgPDMode, ///< Check to determine if Precharge powerdown mode is supported
403 EccByteTraining, ///< Check to determine if DRAM ECC Byte training
404 CheckDrvImpCtrl, ///< Check to determine if we need to set DrvImpCtrl
405 CheckDramTerm, ///< Check to determine if we need to set DramTerm
406 CheckDramTermDyn, ///< Check to determine if we need to set DramTermDyn
407 CheckQoff, ///< Check to determine if we need to set Qoff
408 CheckSetSameDctODTsEn, ///< Check to defermine if we need to set "ODTsEn" the same on each DCT
409 WLNegativeDelay, ///< Check to determine if the NB can tolerate a negtive WL delay value
410 SchedDlySlot1Extra, ///< Check to determine if DataTxSchedDly Slot1 equation in slowMode to subtract an extra MEMCLK
411 TwoStageDramInit, ///< Check to determine if we need to seperate Draminit into 2 stages. The first one processes info on all nodes. The second one does Dram Init.
412 ExtraPclkInMaxRdLat, ///< Check to determine if an extra PCLK is needed for MaxRdLat
413 CsrPhyPllPdEn, ///< Check to determine if CSR Phy PLL Powerdown is enabled or not
414 AdjustTrc, ///< Check to determine if we need to adjust Trc
415 ProgramCsrComparator, ///< Check to determine if we need to program CsrComparator with the same value as D18F2x09C_x0D0F_0[7:0]1F[RxVioLvl]
416 EnProcOdtAdvForUDIMM, ///< Check to determine if we need to always enable ProcOdtAdv for UDIMM
417 SetTDqsForx8DimmOnly, ///< Only set MR1[TDQS] for x8 DIMMs when x4 and x8 DIMMs are both present on a channel
418 WlRttNomFor1of3Cfg, ///< Set Rtt_Nom = Rtt_Wr in one of three DIMMs per channel configurations
419 PerformanceOnly, ///< Only support performance policy, does not support battery life policy
420 AdjustTrp, ///< Check to determin if Trp needs to be adjusted
421 DllStaggerEn, ///< Check to determin if Dll Stagger should be turned on
422 ForcePhyToM0, ///< Force Phy to M0
423 excel847_0,
424 excel847_1,
425 excel848_0,
426 excel848_1,
427
428 EnumSize ///< Size of list
429} NB_SUPPORTED;
430
431/// List for family specific functions that are supported
432typedef enum {
433 BeforePhyFenceTraining, ///< Family specific tasks before Phy Fence Training
434 BeforeMemClkFreqVal, ///< hook before setting MemClkFreqVal bit
435 AfterMemClkFreqVal, ///< Override PllMult and PllDiv
436 OverridePllMult, ///< Override PllMult
437 OverridePllDiv, ///< Override PllDiv
438 BeforeMemClr, ///< Before MemClr
439 SendMrsCmdsPerCs, ///< Send MRS commands per CS
440 SetupHwTrainingEngine, ///< Setup Hardware training engine for specific training type
441 OverrideRcvEnSeed, ///< Override seed for hardware based RcvEn training
442 AddlMaxRdLatTrain, ///< Perform additional MaxRdLat training if needed
443 ForceAutoComp, ///< Force Auto Comp
444 DetectMemPllError, ///< Detect MemPll Divide by 3 bug
445 ReEnablePhyComp, ///< Re-Enable Phy Compensation after RcvEn Training
446 ExtractWLODT, ///< Extract WL ODT value thr given ODT pattern
447 DCTSelectSwitch, ///< Select DCT when we switch DCT
448 ScrubberErratum, ///< Erratum for setting scrubber rate
449 MR0_PPD, ///< Override MR0[PPD]
450 GetDdrMaxRate, ///< Interpret DdrMaxRate with Familiy-specific encoding
451 ExitPhyAssistedTraining, ///< Perform family specific tasks when exiting phy assisted training
452 AfterSaveRestore, ///< Action after save/restore execution
453 OverrideDataTxFifoWrDly, ///< Override DataTxFifoWrDly based on training result of WrDatDly
454 OverrideRcvEnSeedPassN, ///< Override seed for hardware based RcvEn training where N greater than 0
455 AfterMemClkFreqChg, ///< Reprogram DIMMs' buffers after MEMCLK frequency change
456 AdjustTxpdll, ///< Adjust Txpdll value to encoded register value
457 CalcWrDqDqsEarly, ///< Calculate WrDqDqsEarly
458 TrainWlPerNibble, ///< Train Write Leveling per nibble
459 TrainWlPerNibbleAdjustWLDly, ///< Train WL per nibble and adjust the WL delay
460 TrainWlPerNibbleSeed, ///< Save the seed for WL nibble based training
461 TrainRxEnPerNibble, ///< Train Rx Enable Training per nibble
462 TrainRxEnAdjustDlyPerNibble, ///< Train Rx Enable Training nibble and adjust the RxEn delay
463 TrainRxEnGetAvgDlyPerNibble, ///< Display Rx Enable Training average nibble value for each BL
464 InitPerNibbleTrn, ///< Initiates Per Nibble Training.
465 BeforeSetCsTri, ///< Modify CS tri-state bit map.
466 ForceRdDqsPhaseB, ///< Force RdDqsDly to phase B
467 SetDqsODT, ///< Set DQS ODT
468 DisLowPwrDrvStr, ///< Hook to skip setting LowPowerDriveStrengthEn
469 AdjustRdDqsDlyOffset, ///< Adjust the bit offset of the RdDqsDly Bit Bitfield before writing and after reading
470 ResetRxFifoPtr, ///< Reset RxFifo pointer during Read DQS training
471 EnableParityAfterMemRst, ///< Enable DRAM Address Parity after memory reset.
472 FinalizeVDDIO, ///< Finalize VDDIO
473 TrainingNibbleZero, ///< Check for see Nibble zero is being trained (individually or with x8 training)
474 ProgOdtControl, ///< Calculate RdOdtTrnOnDly and RdOdtOnDuration
475 SetSkewMemClk, ///< Set SkewMemClk
476 OverrideWLSeed, ///< Override WL seed
477 AdjustCSIntLvLowAddr, ///< Adjust CS interleaving low address
478 Adjust2DVrefStepSize, ///< Adjusts the step size for Vref during 2D RdDqs training
479 Adjust2DRdDqsStepSize, ///< Adjusts the step size for RdDqs during 2D RdDqs training
480 ReleaseNbPstate, ///< Release NB P-state
481 InitializeRxEnSeedlessTraining, ///< Initializes RxEn Seedless Training
482 TrackRxEnSeedlessRdWrNoWindBLError, ///< Track Bytelane Errors resulting from No window for RxEn Seedless Training
483 TrackRxEnSeedlessRdWrSmallWindBLError, ///< Track Bytelane Errors resulting from Small window for RxEn Seedless Training
484 InitialzeRxEnSeedlessByteLaneError, ///< Initializes ByteLaneError to False for RxEn Seedless Training
485 InitExtMMIOAddr, ///< Initializes extended MMIO address space
486 MemPstateStageChange, ///< handle training when multiple memory pstate is supported
487 ProgramFence2RxDll, ///< program RxDll in a different register
488 RdDqsDlyRestartChk, ///< Check to see if we need to restart RdDqsDly
489 BeforeWrDatTrn, ///< Check to see if special handling is needed before WrDatDly Training
490 ForceLvDimmVoltage, ///< Force LVDIMM voltage to 1.5V
491 BfAfExcludeDimm, ///< Workaround before and after excluding dimms
492 AdjustWrDqsBeforeSeedScaling, ///< For some family, negative WL is compensated and WrDqs needs to be adjusted before seed scaling
493 OverridePrevPassRcvEnDly, ///< Check to determine if we need override PrevPassRcvEnDly
494 AdjustRdPtrInit, ///< Adjust RdPtrInit value according to certain conditions
495 Adjust2DPhaseMaskBasedOnEcc, ///< Adjusts the Phase Mask Based on ECC
496 FixupSysAddr, ///< Adjust physical address before identifying DIMM.
497 RegAccessFence, ///< Make sure previous phy registers writes are done
498 WLMR1, ///< Check to see if we need to do special things when sending MR1 during WL
499
500 NumberOfHooks ///< Size of list
501} FAMILY_SPECIFIC_FUNC_INDEX;
502
503///< Entry for SPD Timing
504typedef struct {
505 BIT_FIELD_NAME BitField; ///< Bit field name of the timing
506 UINT8 Min; ///< Minimum value for timing
507 UINT8 Max; ///< Maximum value for timing
508 UINT8 Bias; ///< Bias from actual value
509 UINT8 Ratio_x2; ///< Actual value will be multiplied by (Ratio_x2/2)
510} CTENTRY;
511
512/// Structure for northbridge block.
513typedef struct _MEM_NB_BLOCK {
514 MEM_DATA_STRUCT *MemPtr; ///< Point to MEM_DATA_STRUCT.
515 MEM_PARAMETER_STRUCT *RefPtr; ///< Point to MEM_PARAMETER_STRUCT.
516 DIE_STRUCT *MCTPtr; ///< point to current Node's MCT struct
517 DCT_STRUCT *DCTPtr; ///< point to current Node's DCT struct
518 DCT_STRUCT *AllDCTPtr; ///< point to all Node's DCT structs
519 CH_DEF_STRUCT *ChannelPtr; ///< point to current channel data
520 SPD_DEF_STRUCT *SPDPtr; ///< Point to SPD data for current DCT.
521 struct _MEM_TECH_BLOCK *TechPtr; ///< point to technology block.
522 struct _MEM_FEAT_BLOCK_NB *FeatPtr; ///< point to NB Specific feature block.
523 struct _MEM_SHARED_DATA *SharedPtr; ///< Pointer to Memory scratchpad area
524 struct _MEM_NB_BLOCK *AdjacentDieNBPtr; ///< Pointer to Adjacent Die In same socket
525 BOOLEAN DieEnabled[MAX_NODES_SUPPORTED];///< Indicates the Dies that are enabled
526 SPD_DEF_STRUCT *AllNodeSPDPtr; ///< Point to SPD data for the system.
527 DIE_STRUCT *AllNodeMCTPtr; ///< point to all Node's MCT structs
528 UINT8 DimmToBeUsed; ///< Dimm to be used in recovery mode.
529 MEM_PS_BLOCK *PsPtr; ///< point to platform specific block
530 MEM_PS_BLOCK *PSBlock; ///< point to the first platform specific block on this node.
531 MEM_FREQ_CHANGE_PARAM *FreqChangeParam; ///< pointer to parameter of frequency change.
532
533 PCI_ADDR PciAddr; ///< PCI address for this node
534 TSEFO *NBRegTable; ///< contains all bit field definitions
535
536 UINT8 Node; ///< current node.
537 UINT8 Dct; ///< current DCT.
538 UINT8 Channel; ///< current channel.
539 UINT8 DctCount; ///< number of DCTs on the current NB.
540 UINT8 ChannelCount; ///< number of channels per DCT of the current NB.
541 UINT8 NodeCount; ///< number of Nodes supported
542 UINT8 CsPerDelay; ///< number of CS controlled per set of delay registers.
543 UINT8 CsPerChannel; ///< number of CS per channel.
544 BOOLEAN Ganged; ///< mode for current MCT controller.
545 POS_TRN_PATTERN_TYPE PosTrnPattern; ///< specifies the pattern that should be used for position training.
546 BOOLEAN MemCleared; ///< memory clear flag.
547 UINT32 CPGInit; ///< continuous pattern generation flag.
548 UINT16 StartupSpeed; ///< startup speed for DDR3.
549 UINT16 RcvrEnDlyLimit; ///< maximum value that RcvrEnDly field can take.
550 UINT32 McaNbCtlReg; ///< reserve MCA reports.
551 UINT32 VarMtrrHiMsk; ///< variable MTRR mask for upper 32 bits.
552 UINT32 CsRegMsk; ///< mask for CS base register
553 UINT32 NBClkFreq; ///< Current NB Clock frequency
554 UINT8 DefDctSelIntLvAddr; ///< Default DctSelIntLvAddr
555 UINT8 TrainingSequenceIndex; ///< Index into the Training Sequence
556 RRW_SETTINGS RrwSettings; ///<Settings for Reliable Read/Write mode
557 UINT8 TotalRdDQSDlyRange; ///< Max number of RdDQS Delays
558 INT16 MinRxEnSeedGross; ///< Minimum value of the Receiver Enable
559 INT16 MaxRxEnSeedTotal; ///< Maximum value of the Receiver Enable
560 UINT8 TotalMaxVrefRange; ///< Max number of Vref settings
561 UINT8 MaxSeedCount; ///< Max number of Data patterns to be generated
562 UINT8 Vref; ///< Vref setting
563 UINT8 RdDqsDly; ///< RdDQSDly setting
564 UINT16 MaxFreqVDDIO[VOLT1_25 + 1]; ///< Max Frequency each voltage supports.
565 UINT32 PhaseLaneMask; ///< Lane Mask for Inphase and 180 phase registers
566 UINT8 MaxDiamondStep; ///< Maximum Diamond step Size
567 UINT8 CurrentAggressorCSTarget[MAX_CHANNELS_PER_SOCKET]; ///< Current Aggressor CS targeted
568 UINT8 MaxAggressorCSEnabled[MAX_CHANNELS_PER_SOCKET]; ///< Maximum Number of Aggressor CS targeted
569 UINT8 MaxAggressorDimms[MAX_CHANNELS_PER_SOCKET]; ///< Maximum Number of Aggressor CS DIMMs
570 UINT8 InitialAggressorCSTarget[MAX_CHANNELS_PER_SOCKET]; ///< Initial Number of the first CS Aggressor
571 BOOLEAN OrigDisAutoRefreshState; ///< Original state of Dis Auto Refresh
572 BOOLEAN Execute1dMaxRdLatTraining; ///< Indicates if 1D training should be executed
573 BOOLEAN Override2DTraining; ///< 2D training has been overriden
574
575 MEM_DCT_CACHE DctCache[MAX_CHANNELS_PER_SOCKET]; ///< Allocate space for MCT_DCT_CACHE.
576 MEM_DCT_CACHE *DctCachePtr; ///< pointer to current Node's Node struct
577
578 /* Temporary storage */
579 BOOLEAN ClToNbFlag; ///< is used to restore ClLinesToNbDis bit after memory
580 UINT8 NbFreqChgState; ///< is used as a state index in NB frequency change state machine
581 UINT32 NbPsCtlReg; ///< is used to save/restore NB Pstate control register
582 MEM_PSTATE MemPstate; ///< is used to save current memory Pstate context
583 MEM_PSTATE_STAGE MemPstateStage; ///< is used to save the current stage status of memory pstate
584 RDDQSDLY_RTN_STAT RdDqsDlyRetrnStat; ///< is used to check if RdDqsDly training needs to be restarted
585 CONST UINT32 *RecModeDefRegArray; ///< points to an array of default register values that are set for recovery mode
586 struct _MEM_DRAM_INFO *DevInfoArray; ///< points to an array of DRAM device info
587
588 ///< Determines if code should be executed on a give NB
589 BOOLEAN IsSupported[EnumSize];
590 BOOLEAN (*FamilySpecificHook[NumberOfHooks]) (struct _MEM_NB_BLOCK *NBPtr, VOID *OptParam); ///< This array of pointers point to
591 ///< family specific functions.
592
593 /* PUBLIC functions */
594 VOID (*SwitchDCT) (struct _MEM_NB_BLOCK *NBPtr, UINT8 DCT); ///< Switch to current DCT.
595 VOID (*SwitchChannel) (struct _MEM_NB_BLOCK *NBPtr, UINT8 Channel); ///< Switch to current channel.
596 VOID (*SetMaxLatency) (struct _MEM_NB_BLOCK *NBPtr, UINT16 MaxRcvEnDly); ///< Set Max Rd Latency.
597 VOID (*getMaxLatParams) (struct _MEM_NB_BLOCK *NBPtr, UINT16 MaxDlyForMaxRdLat, UINT16 *MinDly, UINT16 *MaxDly, UINT16 *DlyBias); ///< retrieves the Max latency parameters.
598 BOOLEAN (*GetSysAddr) (struct _MEM_NB_BLOCK *NBPtr, UINT8 Receiver, UINT32 *Addr); ///< Get system address for training dimm.
599 BOOLEAN (*RankEnabled) (struct _MEM_NB_BLOCK *NBPtr, UINT8 Receiver); ///< Check if a rank has been enabled.
600 BOOLEAN (*InitializeMCT) (struct _MEM_NB_BLOCK *NBPtr); ///< MCT initialization.
601 BOOLEAN (*FinalizeMCT) (struct _MEM_NB_BLOCK *NBPtr); ///< sets final values in BUCFG and BUCFG2.
602 BOOLEAN (*InitMCT) (struct _MEM_NB_BLOCK *NBPtr); ///< main entry call for memory initialization.
603 VOID (*SendMrsCmd) (struct _MEM_NB_BLOCK *NBPtr); ///< send MRS command.
604 VOID (*sendZQCmd) (struct _MEM_NB_BLOCK *NBPtr); ///< send ZQ command.
605 VOID (*TrainingFlow) (struct _MEM_NB_BLOCK *NBPtr); ///< Set the training flow control
606 VOID (*WritePattern) (struct _MEM_NB_BLOCK *NBPtr, UINT32 Address, UINT8 Pattern[], UINT16 ClCount); ///< Write training pattern.
607 VOID (*ReadPattern) (struct _MEM_NB_BLOCK *NBPtr, UINT8 Buffer[], UINT32 Address, UINT16 ClCount); ///< Read training pattern.
608 VOID (*GenHwRcvEnReads) (struct _MEM_NB_BLOCK *NBPtr, UINT32 Address); ///< generates a continuous burst of reads during HW RcvEn training.
609 UINT16 (*CompareTestPattern) (struct _MEM_NB_BLOCK *NBPtr, UINT8 Buffer[], UINT8 Pattern[], UINT16 ByteCount); ///< Compare training pattern.
610 UINT16 (*InsDlyCompareTestPattern) (struct _MEM_NB_BLOCK *NBPtr, UINT8 Buffer[], UINT8 Pattern[], UINT16 ByteCount); ///< Compare training pattern using 1 beat offset to check for insertion delay
611 BOOLEAN (*StitchMemory) (struct _MEM_NB_BLOCK *NBPtr); ///< combines all the memory into a contiguous map.
612 VOID (*ProgramCycTimings) (struct _MEM_NB_BLOCK *NBPtr); ///< programs the memory controller with SPD timings.
613 BOOLEAN (*AutoConfig) (struct _MEM_NB_BLOCK *NBPtr); ///< programs the memory controller with configuration parameters
614 BOOLEAN (*PlatformSpec) (struct _MEM_NB_BLOCK *NBPtr); ///< programs platform specific parameters.
615 VOID (*DisableDCT) (struct _MEM_NB_BLOCK *NBPtr); ///< disable a DCT if no dimm presents.
616 VOID (*StartupDCT) (struct _MEM_NB_BLOCK *NBPtr); ///< start a DCT.
617 VOID (*SyncTargetSpeed) (struct _MEM_NB_BLOCK *NBPtr); ///< Check and sync the target speed of all channels of this node.
618 VOID (*ChangeFrequency) (struct _MEM_NB_BLOCK *NBPtr); ///< Frequency change sequence.
619 BOOLEAN (*RampUpFrequency) (struct _MEM_NB_BLOCK *NBPtr); ///< Change frequency to the next supported level.
620 BOOLEAN (*ChangeNbFrequency) (struct _MEM_NB_BLOCK *NBPtr); ///< Change NB frequency.
621 VOID (*PhyFenceTraining) (struct _MEM_NB_BLOCK *NBPtr); ///< Phy fence training.
622 BOOLEAN (*SyncDctsReady) (struct _MEM_NB_BLOCK *NBPtr); ///< Synchronize DCTs.
623 BOOLEAN (*HtMemMapInit) (struct _MEM_NB_BLOCK *NBPtr); ///< Memory map initialization.
624 VOID (*SyncAddrMapToAllNodes) (struct _MEM_NB_BLOCK *NBPtr); ///< copies the Node 0 map to all the other nodes.
625 BOOLEAN (*CpuMemTyping) (struct _MEM_NB_BLOCK *NBPtr); ///< MTRR and TOM setting.
626 VOID (*BeforeDqsTraining) (struct _MEM_NB_BLOCK *NBPtr); ///< processes needed before DQS training.
627 VOID (*AfterDqsTraining) (struct _MEM_NB_BLOCK *NBPtr); ///< processes needed after DQS training.
628 BOOLEAN (*OtherTiming) (struct _MEM_NB_BLOCK *NBPtr); ///< setting non-spd timing.
629 VOID (*UMAMemTyping) (struct _MEM_NB_BLOCK *NBPtr); ///< MTRR and TOM setting needed for UMA platform.
630 VOID (*Feature) (struct _MEM_NB_BLOCK *NBPtr); ///< Feature support.
631 UINT8 (*GetSocketRelativeChannel) (struct _MEM_NB_BLOCK *NBPtr, UINT8 Dct, UINT8 Channel); ///< Get channel number relative to a socket.
632 VOID (*SetDramOdtRec) (struct _MEM_NB_BLOCK *NBPtr, ODT_MODE OdtMode, UINT8 ChipSelect, UINT8 TargetCS); ///< Set Dram ODT.
633 UINT32 (*GetSysAddrRec) ( VOID ); ///< Get system address for training.
634 VOID (*SwitchNodeRec) (struct _MEM_NB_BLOCK *NBPtr, UINT8 NodeID); ///< Switch to current node.
635 VOID (*TechBlockSwitch) (struct _MEM_NB_BLOCK *NBPtr); ///< Selects appropriate Tech functions for the NB.
636 VOID (*SetEccSymbolSize) (struct _MEM_NB_BLOCK *NBPtr); ///< Set Ecc Symbol Size.
637 VOID (*GetTrainDlyParms) (struct _MEM_NB_BLOCK *NBPtr, TRN_DLY_TYPE TrnDly, TRN_DLY_PARMS *Parms); ///< Retrieve Specific Delay range info for current NB under current conditions.
638 AGESA_STATUS (*TrainingPatternInit) (struct _MEM_NB_BLOCK *NBPtr); ///< Initialize the training Pattern
639 AGESA_STATUS (*TrainingPatternFinalize) (struct _MEM_NB_BLOCK *NBPtr); ///< Finalize the training Pattern
640 BOOLEAN (*GetApproximateWriteDatDelay) (struct _MEM_NB_BLOCK *NBPtr, UINT8 Index, UINT8 *Value); ///< Retrieve the next WrDat Delay Approximation
641 VOID (*FlushPattern) (struct _MEM_NB_BLOCK *NBPtr, UINT32 Address, UINT16 ClCount); ///<Flush the training pattern
642 UINT8 (*MinDataEyeWidth) (struct _MEM_NB_BLOCK *NBPtr); ///<Get Min Data Eye Width in 32nds of a UI
643 VOID (*MemNCapSpeedBatteryLife) (struct _MEM_NB_BLOCK *NBPtr); ///< Caps speed based on battery life check.
644 UINT32 (*GetUmaSize) (struct _MEM_NB_BLOCK *NBPtr); ///< Get Uma Size
645 UINT8 (*GetMemClkFreqId) (struct _MEM_NB_BLOCK *NBPtr, UINT16 Speed); ///< Translate MemClk frequency in MHz to MemClkFreq value
646 VOID (*EnableSwapIntlvRgn) (struct _MEM_NB_BLOCK *NBPtr, UINT32 Base, UINT32 Limit); ///< Enable swapped interleaving region
647 BOOLEAN (*ChangeNbFrequencyWrap) (struct _MEM_NB_BLOCK *NBPr, UINT32 NBPstate); ///< Wrapper for NB Pstate change function
648 VOID (*WaitXMemClks) (struct _MEM_NB_BLOCK *NBPr, UINT32 MemClkCount); ///< Waits a specified number of MemClks
649 VOID (*ProgramNbPsDependentRegs) (struct _MEM_NB_BLOCK *NBPtr); ///< Programs NB Pstate dependent registers
650 VOID (*AllocateC6Storage) (struct _MEM_NB_BLOCK *NBPtr); ///< Allocates DRAM region for Core C6
651
652 /* PUBLIC Get/Set register field functions */
653 UINT32 (*GetBitField) (struct _MEM_NB_BLOCK *NBPtr, BIT_FIELD_NAME FieldName); ///< Pci register bit field read.
654 VOID (*SetBitField) (struct _MEM_NB_BLOCK *NBPtr, BIT_FIELD_NAME FieldName, UINT32 Value); ///< Pci register bit field write.
655 BOOLEAN (*BrdcstCheck) (struct _MEM_NB_BLOCK *NBPtr, BIT_FIELD_NAME FieldName, UINT32 Value); ///< Pci register bit field broadcast read.
656 VOID (*BrdcstSet) (struct _MEM_NB_BLOCK *NBPtr, BIT_FIELD_NAME FieldName, UINT32 Value); ///< Pci register bit field broadcast write.
657 VOID (*PollBitField) (struct _MEM_NB_BLOCK *NBPtr, BIT_FIELD_NAME FieldName, UINT32 Field, UINT32 MicroSecond, BOOLEAN IfBroadCast); ///< Poll a Pci register bitfield.
658 UINT32 (*GetTrainDly) (struct _MEM_NB_BLOCK *NBPtr, TRN_DLY_TYPE TrnDly, DRBN DrbnVar); ///< Training register bit field read.
659 VOID (*SetTrainDly) (struct _MEM_NB_BLOCK *NBPtr, TRN_DLY_TYPE TrnDly, DRBN DrbnVar, UINT16 Value); ///< Training register bit field write.
660 AGESA_STATUS (*InitRecovery) (struct _MEM_NB_BLOCK *NBPtr); ///< Recover mode memory init
661 VOID (*MemRecNInitializeMctNb) (struct _MEM_NB_BLOCK *NBPtr); ///< Initialize MCT changes
662 VOID (*MemRecNFinalizeMctNb) (struct _MEM_NB_BLOCK *NBPtr); ///< Finalize MCT changes
663 VOID (*MemNInitPhyComp) (struct _MEM_NB_BLOCK *NBPtr); ///< Init Phy compensation
664 VOID (*MemNBeforeDramInitNb) (struct _MEM_NB_BLOCK *NBPtr); ///< Before Dram init
665 BOOLEAN (*MemNIsIdSupportedNb) (struct _MEM_NB_BLOCK *NBPtr, CPU_LOGICAL_ID *LogicalIdPtr); ///< Determines if a given CPU id is supported
666 BOOLEAN (*MemNPlatformSpecificFormFactorInitNb) (struct _MEM_NB_BLOCK *NBPtr); ///< Platform specific functions
667 VOID (*MemNSetOtherTimingNb) (struct _MEM_NB_BLOCK *NBPtr); ///< Set non-spd timings
668 VOID (*MemNBeforePlatformSpecNb) (struct _MEM_NB_BLOCK *NBPtr); ///< Apply settings prior to platform specific settings
669 UINT32 (*MemNCmnGetSetFieldNb) (struct _MEM_NB_BLOCK *NBPtr, UINT8 IsSet, BIT_FIELD_NAME FieldName, UINT32 Field); ///< Sets a register value
670 UINT32 (*MemNcmnGetSetTrainDly) (struct _MEM_NB_BLOCK *NBPtr, UINT8 IsSet, TRN_DLY_TYPE TrnDly, DRBN DrbnVar, UINT16 Field); ///< Sets a training delay field
671 VOID (*MemPPhyFenceTrainingNb) (struct _MEM_NB_BLOCK *NBPtr); ///< Phy Fence training
672 VOID (*MemPNodeMemBoundaryNb) (struct _MEM_NB_BLOCK *NBPtr, UINT32 *NodeSysLimit); ///< Phy Fence training
673 UINT32 (*MemRecNCmnGetSetFieldNb) (struct _MEM_NB_BLOCK *NBPtr, UINT8 IsSet, BIT_FIELD_NAME FieldName, UINT32 Field); ///< This functions sets bit fields in recover mode
674 UINT32 (*MemRecNcmnGetSetTrainDlyNb) (struct _MEM_NB_BLOCK *NBPtr, UINT8 IsSet, TRN_DLY_TYPE TrnDly, DRBN DrbnVar, UINT16 Field); ///< This functions sets bit fields in recover mode
675 VOID (*MemRecNSwitchDctNb) (struct _MEM_NB_BLOCK *NBPtr, UINT8 NodeID); ///< S3 Exit self refresh register
676 VOID (*MemNPFenceAdjustNb) (struct _MEM_NB_BLOCK *NBPtr, INT16 *Value16); ///< Adjust Avg PRE value of Phy fence training
677 VOID (*MemNPrepareRcvrEnDlySeed) (struct _MEM_NB_BLOCK *NBPtr); ///< Seed valude for HW RxEn training
678 UINT8 (*MemNGetDramTerm) (struct _MEM_NB_BLOCK *NBPtr, UINT8 ChipSel); ///< Dram Term value
679 UINT8 (*MemNGetDynDramTerm) (struct _MEM_NB_BLOCK *NBPtr, UINT8 ChipSel); ///< Dynamic Dram Term value
680 VOID (*MemNSaveMR0) (struct _MEM_NB_BLOCK *NBPtr, UINT32 MrsAddress); ///< Save MR0 during memory initialization
681 UINT32 (*MemNGetMR0CL) (struct _MEM_NB_BLOCK *NBPtr); ///< MR0[CL] value
682 UINT32 (*MemNGetMR0WR) (struct _MEM_NB_BLOCK *NBPtr); ///< MR0[WR] value
683 UINT32 (*MemNGetMR2CWL) (struct _MEM_NB_BLOCK *NBPtr); ///< MR2[CWL] value
684 UINT32 (*InPhaseCompareRdDqs2DPattern) (struct _MEM_NB_BLOCK *NBPtr, UINT8 Buffer[], UINT8 Pattern[], UINT16 ByteCount); ///< InPhase Compare training pattern for RdDQS 2D training
685 UINT32 (*Phase180CompareRdDqs2DPattern) (struct _MEM_NB_BLOCK *NBPtr, UINT8 Buffer[], UINT8 Pattern[], UINT16 ByteCount); ///< 180 Compare training pattern for RdDQS 2D training
686 VOID (*AgressorContinuousWrites) (struct _MEM_NB_BLOCK *NBPtr, UINT8 SeedCount, BOOLEAN TurnOnInfinite); ///< Enables/Disables continuous writes on unused agressor channels
687 UINT32 (*GetPrbs2dRdDqsSeed) (struct _MEM_NB_BLOCK *NBPtr, UINT8 SeedCount); ///< Prbs Seed for 2d RdDqs training
688 VOID (*DisableInfiniteWritePattern) (struct _MEM_NB_BLOCK *NBPtr); ///< Disables infinite Write training pattern.
689 VOID (*EnableInfiniteWritePattern) (struct _MEM_NB_BLOCK *NBPtr); ///< Enables infinite training pattern.
690 VOID (*InitializeRdDqs2dVictimContinuousWrites) (struct _MEM_NB_BLOCK *NBPtr); ///< Initializes victim infinite training pattern for RdDqs2d Training.
691 VOID (*FinalizeRdDqs2dVictimContinuousWrites) (struct _MEM_NB_BLOCK *NBPtr); ///< Finalizes victim infinite training pattern for RdDqs2d Training.
692 VOID (*InitializeRdDqs2dVictimChipSelContinuousWrites) (struct _MEM_NB_BLOCK *NBPtr); ///< Initializes victim infinite training pattern for RdDqs2d Training for victim CS.
693 VOID (*StartRdDqs2dVictimContinuousWrites) (struct _MEM_NB_BLOCK *NBPtr , UINT8 SeedCount); ///< Starts victim infinite training pattern for RdDqs2d Training.
694 BOOLEAN (*ConfigureDCTForGeneral) (struct _MEM_NB_BLOCK *NBPtr); ///< Configure DCT For General use.
695 BOOLEAN (*ConfigureDCTForTraining) (struct _MEM_NB_BLOCK *NBPtr); ///< Configure DCT For Training.
696 BOOLEAN (*ConfigureDCTNonExplicitSeq) (struct _MEM_NB_BLOCK *NBPtr); ///< Configure DCT for Non Explicit Seq.
697 BOOLEAN (*SynchronizeChannels) (struct _MEM_NB_BLOCK *NBPtr); ///< Synchronize Channels.
698 BOOLEAN (*ConfigureDCTNormal) (struct _MEM_NB_BLOCK *NBPtr); ///< Configure DCT for Normal operation.
699 BOOLEAN (*MemN2DRdDQSDataCollection) (struct _MEM_NB_BLOCK *NBPtr); ///< 2D training data collection method
700 UINT32 (*MemNGetMemoryWidth) (struct _MEM_NB_BLOCK *NBPtr); ///< Get memory width
701} MEM_NB_BLOCK;
702
703/*----------------------------------------------------------------------------
704 * FUNCTIONS PROTOTYPE
705 *
706 *----------------------------------------------------------------------------
707 */
708VOID
709MemNInitNBDataNb (
710 IN OUT MEM_NB_BLOCK *NBPtr
711 );
712
713VOID
714MemNSwitchDCTNb (
715 IN OUT MEM_NB_BLOCK *NBPtr,
716 IN UINT8 Dct
717 );
718
719VOID
720MemNSwitchChannelNb (
721 IN OUT MEM_NB_BLOCK *NBPtr,
722 IN UINT8 Channel
723 );
724
725UINT32
726MemNGetBitFieldNb (
727 IN OUT MEM_NB_BLOCK *NBPtr,
728 IN BIT_FIELD_NAME FieldName
729 );
730
731VOID
732MemNSetBitFieldNb (
733 IN OUT MEM_NB_BLOCK *NBPtr,
734 IN BIT_FIELD_NAME FieldName,
735 IN UINT32 Field
736 );
737
738BOOLEAN
739MemNBrdcstCheckNb (
740 IN OUT MEM_NB_BLOCK *NBPtr,
741 IN BIT_FIELD_NAME FieldName,
742 IN UINT32 Field
743 );
744
745VOID
746MemNBrdcstSetNb (
747 IN OUT MEM_NB_BLOCK *NBPtr,
748 IN BIT_FIELD_NAME FieldName,
749 IN UINT32 Field
750 );
751
752
753UINT32
754MemNGetTrainDlyNb (
755 IN OUT MEM_NB_BLOCK *NBPtr,
756 IN TRN_DLY_TYPE TrnDly,
757 IN DRBN DrbnVar
758 );
759
760VOID
761MemNSetTrainDlyNb (
762 IN OUT MEM_NB_BLOCK *NBPtr,
763 IN TRN_DLY_TYPE TrnDly,
764 IN DRBN DrbnVar,
765 IN UINT16 Field
766 );
767
768BOOLEAN
769MemNRankEnabledNb (
770 IN OUT MEM_NB_BLOCK *NBPtr,
771 IN UINT8 Receiver
772 );
773
774UINT8 MemNGetSocketRelativeChannelNb (
775 IN OUT MEM_NB_BLOCK *NBPtr,
776 IN UINT8 Dct,
777 IN UINT8 Channel
778 );
779
780VOID
781MemNPhyFenceTrainingNb (
782 IN OUT MEM_NB_BLOCK *NBPtr
783 );
784
785BOOLEAN
786MemNGetMCTSysAddrNb (
787 IN OUT MEM_NB_BLOCK *NBPtr,
788 IN UINT8 Receiver,
789 OUT UINT32 *AddrPtr
790 );
791
792BOOLEAN
793MemNPlatformSpecNb (
794 IN OUT MEM_NB_BLOCK *NBPtr
795 );
796
797BOOLEAN
798MemNStitchMemoryNb (
799 IN OUT MEM_NB_BLOCK *NBPtr
800 );
801
802VOID
803MemNDisableDCTNb (
804 IN OUT MEM_NB_BLOCK *NBPtr
805 );
806
807VOID
808MemNDisableDCTClientNb (
809 IN OUT MEM_NB_BLOCK *NBPtr
810 );
811
812VOID
813MemNDisableDCTUnb (
814 IN OUT MEM_NB_BLOCK *NBPtr
815 );
816
817VOID
818MemNStartupDCTNb (
819 IN OUT MEM_NB_BLOCK *NBPtr
820 );
821
822VOID
823MemNStartupDCTUnb (
824 IN OUT MEM_NB_BLOCK *NBPtr
825 );
826
827VOID
828MemNChangeFrequencyNb (
829 IN OUT MEM_NB_BLOCK *NBPtr
830 );
831
832BOOLEAN
833MemNRampUpFrequencyNb (
834 IN OUT MEM_NB_BLOCK *NBPtr
835 );
836
837VOID
838MemNProgramCycTimingsNb (
839 IN OUT MEM_NB_BLOCK *NBPtr
840 );
841
842VOID
843MemNGetMaxLatParamsNb (
844 IN OUT MEM_NB_BLOCK *NBPtr,
845 IN UINT16 MaxRcvEnDly,
846 IN OUT UINT16 *MinDlyPtr,
847 IN OUT UINT16 *MaxDlyPtr,
848 IN OUT UINT16 *DlyBiasPtr
849 );
850
851UINT16
852MemNTotalSyncComponentsNb (
853 IN OUT MEM_NB_BLOCK *NBPtr
854 );
855
856VOID
857MemNSetMaxLatencyNb (
858 IN OUT MEM_NB_BLOCK *NBPtr,
859 IN UINT16 MaxRcvEnDly
860 );
861
862VOID
863MemNSendZQCmdNb (
864 IN OUT MEM_NB_BLOCK *NBPtr
865 );
866
867VOID
868MemNSwapBitsNb (
869 IN OUT MEM_NB_BLOCK *NBPtr
870 );
871
872VOID
873MemNSwapBitsUnb (
874 IN OUT MEM_NB_BLOCK *NBPtr
875 );
876
877VOID
878MemNTrainPhyFenceNb (
879 IN OUT MEM_NB_BLOCK *NBPtr
880 );
881
882VOID
883MemNInitPhyCompNb (
884 IN OUT MEM_NB_BLOCK *NBPtr
885 );
886
887VOID
888MemNGetTrainDlyParmsNb (
889 IN OUT MEM_NB_BLOCK *NBPtr,
890 IN TRN_DLY_TYPE TrnDly,
891 IN OUT TRN_DLY_PARMS *Parms
892 );
893
894
895VOID
896MemNGetTrainDlyParmsClientNb (
897 IN OUT MEM_NB_BLOCK *NBPtr,
898 IN TRN_DLY_TYPE TrnDly,
899 IN OUT TRN_DLY_PARMS *Parms
900 );
901
902VOID
903MemNBeforeDQSTrainingNb (
904 IN OUT MEM_NB_BLOCK *NBPtr
905 );
906
907UINT32
908MemNcmnGetSetTrainDlyNb (
909 IN OUT MEM_NB_BLOCK *NBPtr,
910 IN UINT8 IsSet,
911 IN TRN_DLY_TYPE TrnDly,
912 IN DRBN DrbnVar,
913 IN UINT16 Field
914 );
915
916UINT32
917MemNcmnGetSetTrainDlyClientNb (
918 IN OUT MEM_NB_BLOCK *NBPtr,
919 IN UINT8 IsSet,
920 IN TRN_DLY_TYPE TrnDly,
921 IN DRBN DrbnVar,
922 IN UINT16 Field
923 );
924
925UINT32
926MemNcmnGetSetTrainDlyUnb (
927 IN OUT MEM_NB_BLOCK *NBPtr,
928 IN UINT8 IsSet,
929 IN TRN_DLY_TYPE TrnDly,
930 IN DRBN DrbnVar,
931 IN UINT16 Field
932 );
933
934VOID
935MemNSyncTargetSpeedNb (
936 IN OUT MEM_NB_BLOCK *NBPtr
937 );
938
939BOOLEAN
940MemNSyncDctsReadyNb (
941 IN OUT MEM_NB_BLOCK *NBPtr
942 );
943
944BOOLEAN
945MemNHtMemMapInitNb (
946 IN OUT MEM_NB_BLOCK *NBPtr
947 );
948
949UINT8
950MemNGetTrdrdNb (
951 IN OUT MEM_NB_BLOCK *NBPtr
952 );
953
954UINT8
955MemNGetTwrwrNb (
956 IN OUT MEM_NB_BLOCK *NBPtr
957 );
958
959UINT8
960MemNGetTwrrdNb (
961 IN OUT MEM_NB_BLOCK *NBPtr
962 );
963
964UINT8
965MemNGetTrwtTONb (
966 IN OUT MEM_NB_BLOCK *NBPtr
967 );
968
969UINT8
970MemNGetTrwtWBNb (
971 IN OUT MEM_NB_BLOCK *NBPtr
972 );
973
974VOID
975MemNPowerDownCtlNb (
976 IN OUT MEM_NB_BLOCK *NBPtr
977 );
978
979BOOLEAN
980MemNCPUMemTypingNb (
981 IN OUT MEM_NB_BLOCK *NBPtr
982 );
983
984VOID
985MemNUMAMemTypingNb (
986 IN OUT MEM_NB_BLOCK *NBPtr
987 );
988
989VOID
990MemNSyncAddrMapToAllNodesNb (
991 IN OUT MEM_NB_BLOCK *NBPtr
992 );
993
994BOOLEAN
995MemNInitMCTNb (
996 IN OUT MEM_NB_BLOCK *NBPtr
997 );
998
999VOID
1000MemNTechBlockSwitchNb (
1001 IN OUT MEM_NB_BLOCK *NBPtr
1002 );
1003
1004UINT32
1005MemRecNGetBitFieldNb (
1006 IN OUT MEM_NB_BLOCK *NBPtr,
1007 IN BIT_FIELD_NAME FieldName
1008 );
1009
1010VOID
1011MemRecNSetBitFieldNb (
1012 IN OUT MEM_NB_BLOCK *NBPtr,
1013 IN BIT_FIELD_NAME FieldName,
1014 IN UINT32 Field
1015 );
1016
1017UINT32
1018MemRecNGetTrainDlyNb (
1019 IN OUT MEM_NB_BLOCK *NBPtr,
1020 IN TRN_DLY_TYPE TrnDly,
1021 IN DRBN DrbnVar
1022 );
1023
1024VOID
1025MemRecNSetTrainDlyNb (
1026 IN OUT MEM_NB_BLOCK *NBPtr,
1027 IN TRN_DLY_TYPE TrnDly,
1028 IN DRBN DrbnVar,
1029 IN UINT16 Field
1030 );
1031
1032BOOLEAN
1033MemRecNAutoConfigNb (
1034 IN OUT MEM_NB_BLOCK *NBPtr
1035 );
1036
1037BOOLEAN
1038MemRecNPlatformSpecNb (
1039 IN OUT MEM_NB_BLOCK *NBPtr
1040 );
1041
1042VOID
1043MemRecNStartupDCTNb (
1044 IN OUT MEM_NB_BLOCK *NBPtr
1045 );
1046
1047VOID
1048MemRecNSetMaxLatencyNb (
1049 IN OUT MEM_NB_BLOCK *NBPtr,
1050 IN UINT16 MaxRcvEnDly
1051 );
1052
1053VOID
1054MemRecNSetDramOdtNb (
1055 IN OUT MEM_NB_BLOCK *NBPtr,
1056 IN ODT_MODE OdtMode,
1057 IN UINT8 ChipSelect,
1058 IN UINT8 TargetCS
1059 );
1060
1061VOID
1062MemRecNSendMrsCmdNb (
1063 IN OUT MEM_NB_BLOCK *NBPtr
1064 );
1065
1066
1067VOID
1068MemRecNSendZQCmdNb (
1069 IN OUT MEM_NB_BLOCK *NBPtr
1070 );
1071
1072VOID
1073MemRecNContReadPatternClientNb (
1074 IN OUT MEM_NB_BLOCK *NBPtr,
1075 IN UINT8 Buffer[],
1076 IN UINT32 Address,
1077 IN UINT16 ClCount
1078 );
1079
1080AGESA_STATUS
1081MemRecNMemInitNb (
1082 IN OUT MEM_NB_BLOCK *NBPtr
1083 );
1084
1085VOID
1086MemRecNCPUMemRecTypingNb (
1087 IN OUT MEM_NB_BLOCK *NBPtr
1088 );
1089
1090UINT32
1091MemRecNGetMCTSysAddrNb ( VOID );
1092
1093UINT32
1094MemRecGetVarMtrrHiMsk (
1095 IN CPU_LOGICAL_ID *LogicalIdPtr,
1096 IN AMD_CONFIG_PARAMS *StdHeader
1097 );
1098
1099INT8
1100MemNGetOptimalCGDDNb (
1101 IN OUT MEM_NB_BLOCK *NBPtr,
1102 IN TRN_DLY_TYPE TrnDly1,
1103 IN TRN_DLY_TYPE TrnDly2
1104 );
1105
1106VOID
1107MemNPollBitFieldNb (
1108 IN OUT MEM_NB_BLOCK *NBPtr,
1109 IN BIT_FIELD_NAME FieldName,
1110 IN UINT32 Field,
1111 IN UINT32 MicroSecond,
1112 IN BOOLEAN IfBroadCast
1113 );
1114
1115VOID
1116MemNSetEccSymbolSizeNb (
1117 IN OUT MEM_NB_BLOCK *NBPtr
1118 );
1119
1120BOOLEAN
1121MemNDQSTiming3Nb (
1122 IN OUT MEM_NB_BLOCK *NBPtr
1123 );
1124
1125BOOLEAN
1126MemNDQSTiming2Nb (
1127 IN OUT MEM_NB_BLOCK *NBPtr
1128 );
1129
1130BOOLEAN
1131MemNTrainingFlowNb (
1132 IN OUT MEM_NB_BLOCK *NBPtr
1133 );
1134
1135VOID
1136MemNRecTrainingFlowNb (
1137 IN OUT MEM_NB_BLOCK *NBPtr
1138 );
1139
1140VOID
1141MemNRecTrainingFlowClientNb (
1142 IN OUT MEM_NB_BLOCK *NBPtr
1143 );
1144
1145VOID
1146MemNRecTrainingFlowUnb (
1147 IN OUT MEM_NB_BLOCK *NBPtr
1148 );
1149
1150UINT32
1151MemRecNTotalSyncComponentsClientNb (
1152 IN OUT MEM_NB_BLOCK *NBPtr
1153 );
1154
1155VOID
1156MemRecNStartupDCTClientNb (
1157 IN OUT MEM_NB_BLOCK *NBPtr
1158 );
1159
1160
1161VOID
1162MemRecNPhyVoltageLevelNb (
1163 IN OUT MEM_NB_BLOCK *NBPtr
1164 );
1165
1166AGESA_STATUS
1167MemNTrainingPatternInitNb (
1168 IN OUT MEM_NB_BLOCK *NBPtr
1169 );
1170
1171BOOLEAN
1172MemNGetApproximateWriteDatDelayNb (
1173 IN OUT MEM_NB_BLOCK *NBPtr,
1174 IN UINT8 Index,
1175 IN OUT UINT8 *Value
1176 );
1177
1178AGESA_STATUS
1179MemNTrainingPatternFinalizeNb (
1180 IN OUT MEM_NB_BLOCK *NBPtr
1181 );
1182
1183VOID
1184MemNFlushPatternNb (
1185 IN OUT MEM_NB_BLOCK *NBPtr,
1186 IN UINT32 Address,
1187 IN UINT16 ClCount
1188 );
1189
1190UINT8
1191MemNCSPerDelayNb (
1192 IN OUT MEM_NB_BLOCK *NBPtr
1193 );
1194
1195UINT8
1196MemNMinDataEyeWidthNb (
1197 IN OUT MEM_NB_BLOCK *NBPtr
1198 );
1199
1200UINT16
1201MemNCompareTestPatternNb (
1202 IN OUT MEM_NB_BLOCK *NBPtr,
1203 IN UINT8 Buffer[],
1204 IN UINT8 Pattern[],
1205 IN UINT16 ByteCount
1206 );
1207
1208UINT16
1209MemNInsDlyCompareTestPatternNb (
1210 IN MEM_NB_BLOCK *NBPtr,
1211 IN UINT8 Buffer[],
1212 IN UINT8 Pattern[],
1213 IN UINT16 ByteCount
1214 );
1215
1216
1217UINT32
1218MemNGetUmaSizeNb (
1219 IN OUT MEM_NB_BLOCK *NBPtr
1220 );
1221
1222BOOLEAN
1223MemNSetMTRRUmaRegionUCNb (
1224 IN OUT MEM_NB_BLOCK *NBPtr,
1225 IN UINT32 *BasePtr,
1226 IN OUT UINT32 *LimitPtr
1227 );
1228
1229UINT8
1230MemNGetMemClkFreqIdNb (
1231 IN OUT MEM_NB_BLOCK *NBPtr,
1232 IN UINT16 Speed
1233 );
1234
1235UINT8
1236MemNGetMemClkFreqIdClientNb (
1237 IN OUT MEM_NB_BLOCK *NBPtr,
1238 IN UINT16 Speed
1239 );
1240
1241UINT8
1242MemNGetMemClkFreqIdUnb (
1243 IN OUT MEM_NB_BLOCK *NBPtr,
1244 IN UINT16 Speed
1245 );
1246
1247UINT16
1248MemNGetMemClkFreqUnb (
1249 IN OUT MEM_NB_BLOCK *NBPtr,
1250 IN UINT8 FreqId
1251 );
1252
1253BOOLEAN
1254MemNGetPlatformCfgNb (
1255 IN OUT MEM_NB_BLOCK *NBPtr
1256 );
1257
1258BOOLEAN
1259MemNPlatformSpecUnb (
1260 IN OUT MEM_NB_BLOCK *NBPtr
1261 );
1262
1263VOID
1264MemNProgramPlatformSpecNb (
1265 IN OUT MEM_NB_BLOCK *NBPtr
1266 );
1267
1268VOID
1269MemNProgramCycTimingsClientNb (
1270 IN OUT MEM_NB_BLOCK *NBPtr
1271 );
1272
1273INT16
1274MemNCalcCDDNb (
1275 IN OUT MEM_NB_BLOCK *NBPtr,
1276 IN TRN_DLY_TYPE TrnDlyType1,
1277 IN TRN_DLY_TYPE TrnDlyType2,
1278 IN BOOLEAN SameDimm,
1279 IN BOOLEAN DiffDimm
1280 );
1281
1282VOID
1283MemNChangeFrequencyClientNb (
1284 IN OUT MEM_NB_BLOCK *NBPtr
1285 );
1286
1287VOID
1288MemNChangeFrequencyUnb (
1289 IN OUT MEM_NB_BLOCK *NBPtr
1290 );
1291
1292VOID
zbao7d94cf92012-07-02 14:19:14 +08001293MemNProgramNbPstateDependentRegistersClientNb (
1294 IN OUT MEM_NB_BLOCK *NBPtr
1295 );
1296
1297VOID
1298MemNAllocateC6StorageClientNb (
1299 IN OUT MEM_NB_BLOCK *NBPtr
1300 );
1301
1302VOID
1303MemNAllocateC6StorageUnb (
1304 IN OUT MEM_NB_BLOCK *NBPtr
1305 );
1306
1307VOID
1308MemNPhyVoltageLevelNb (
1309 IN OUT MEM_NB_BLOCK *NBPtr
1310 );
1311
1312VOID
1313MemNPhyFenceTrainingUnb (
1314 IN OUT MEM_NB_BLOCK *NBPtr
1315 );
1316
1317VOID
1318MemNPFenceAdjustUnb (
1319 IN OUT MEM_NB_BLOCK *NBPtr,
1320 IN OUT INT16 *Value16
1321 );
1322
1323VOID
1324MemNInitPhyCompClientNb (
1325 IN OUT MEM_NB_BLOCK *NBPtr
1326 );
1327
1328UINT32
1329MemNTotalSyncComponentsClientNb (
1330 IN OUT MEM_NB_BLOCK *NBPtr
1331 );
1332
1333VOID
1334MemNEnableSwapIntlvRgnNb (
1335 IN OUT MEM_NB_BLOCK *NBPtr,
1336 IN UINT32 Base,
1337 IN UINT32 Limit
1338 );
1339
1340VOID
1341MemNPhyPowerSavingClientNb (
1342 IN OUT MEM_NB_BLOCK *NBPtr
1343 );
1344
1345VOID
1346MemNPhyPowerSavingUnb (
1347 IN OUT MEM_NB_BLOCK *NBPtr
1348 );
1349
1350VOID
1351MemNSetASRSRTNb (
1352 IN OUT MEM_NB_BLOCK *NBPtr
1353 );
1354
1355VOID
1356MemNPrepareRcvrEnDlySeedNb (
1357 IN OUT MEM_NB_BLOCK *NBPtr
1358 );
1359
1360BOOLEAN
1361MemNChangeNbFrequencyUnb (
1362 IN OUT MEM_NB_BLOCK *NBPtr
1363 );
1364
1365BOOLEAN
1366MemNChangeNbFrequencyNb (
1367 IN OUT MEM_NB_BLOCK *NBPtr
1368 );
1369
1370VOID
1371MemNWaitXMemClksNb (
1372 IN OUT MEM_NB_BLOCK *NBPtr,
1373 IN UINT32 MemClkCount
1374 );
1375
1376BOOLEAN
1377memNSequenceDDR3Nb (
1378 IN OUT MEM_NB_BLOCK *NBPtr
1379 );
1380
1381UINT16
1382GetTrainDlyFromHeapNb (
1383 IN OUT MEM_NB_BLOCK *NBPtr,
1384 IN TRN_DLY_TYPE TrnDlyType,
1385 IN DRBN Drbn
1386 );
1387
Martin Roth73e86a82013-01-17 16:28:30 -07001388VOID
zbao7d94cf92012-07-02 14:19:14 +08001389MemNTrainingFlowUnb (
1390 IN OUT MEM_NB_BLOCK *NBPtr
1391 );
1392
1393BOOLEAN
1394MemNSetupHwTrainingEngineUnb (
1395 IN OUT MEM_NB_BLOCK *NBPtr,
1396 IN VOID* OptParam
1397 );
1398
1399BOOLEAN
1400MemNBeforePhyFenceTrainingClientNb (
1401 IN OUT MEM_NB_BLOCK *NBPtr,
1402 IN OUT VOID *OptParam
1403 );
1404
1405BOOLEAN
1406MemNReEnablePhyCompNb (
1407 IN OUT MEM_NB_BLOCK *NBPtr,
1408 IN OUT VOID *OptParam
1409 );
1410
1411UINT8
1412MemNGetDramTermNb (
1413 IN OUT MEM_NB_BLOCK *NBPtr,
1414 IN UINT8 ChipSel
1415 );
1416
1417UINT8
1418MemNGetDynDramTermNb (
1419 IN OUT MEM_NB_BLOCK *NBPtr,
1420 IN UINT8 ChipSel
1421 );
1422
1423UINT32
1424MemNGetMR0CLNb (
1425 IN OUT MEM_NB_BLOCK *NBPtr
1426 );
1427
1428UINT32
1429MemNGetMR0WRNb (
1430 IN OUT MEM_NB_BLOCK *NBPtr
1431 );
1432
1433UINT32
1434MemNGetMR2CWLNb (
1435 IN OUT MEM_NB_BLOCK *NBPtr
1436 );
1437
1438BOOLEAN
1439MemNDctCfgSelectUnb (
1440 IN OUT MEM_NB_BLOCK *NBPtr,
1441 IN VOID *Dct
1442 );
1443
1444BOOLEAN
1445MemNGetMaxDdrRateUnb (
1446 IN OUT MEM_NB_BLOCK *NBPtr,
1447 IN VOID *DdrMaxRate
1448 );
1449
1450BOOLEAN
1451MemRecNReEnablePhyCompNb (
1452 IN OUT MEM_NB_BLOCK *NBPtr,
1453 IN OUT VOID *OptParam
1454 );
1455
1456UINT32
1457MemRecNcmnGetSetTrainDlyClientNb (
1458 IN OUT MEM_NB_BLOCK *NBPtr,
1459 IN UINT8 IsSet,
1460 IN TRN_DLY_TYPE TrnDly,
1461 IN DRBN DrbnVar,
1462 IN UINT16 Field
1463 );
1464
1465VOID
1466MemNSetTxpNb (
1467 IN OUT MEM_NB_BLOCK *NBPtr
1468 );
1469
1470BOOLEAN
1471MemNAdjustTxpdllClientNb (
1472 IN OUT MEM_NB_BLOCK *NBPtr,
1473 IN OUT VOID *OptParam
1474 );
1475
1476BOOLEAN
1477MemNCalcWrDqDqsEarlyUnb (
1478 IN OUT MEM_NB_BLOCK *NBPtr,
1479 IN OUT VOID *OptParam
1480 );
1481
1482VOID
1483MemNGetTrainDlyParmsUnb (
1484 IN OUT MEM_NB_BLOCK *NBPtr,
1485 IN TRN_DLY_TYPE TrnDly,
1486 IN OUT TRN_DLY_PARMS *Parms
1487 );
1488
1489BOOLEAN
1490MemNPlatformSpecificFormFactorInitTblDrvNb (
1491 IN OUT MEM_NB_BLOCK *NBPtr
1492 );
1493
1494BOOLEAN
1495MemNChangeNbFrequencyWrapUnb (
1496 IN OUT MEM_NB_BLOCK *NBPtr,
1497 IN UINT32 NBPstate
1498 );
1499
1500VOID
1501MemNForcePhyToM0Unb (
1502 IN OUT MEM_NB_BLOCK *NBPtr
1503 );
1504
1505VOID
1506MemNProgramCycTimingsUnb (
1507 IN OUT MEM_NB_BLOCK *NBPtr
1508 );
1509
1510BOOLEAN
1511MemNSetSkewMemClkUnb (
1512 IN OUT MEM_NB_BLOCK *NBPtr,
1513 IN OUT VOID *OptParam
1514 );
1515
1516VOID
1517MemNSendMrsCmdUnb (
1518 IN OUT MEM_NB_BLOCK *NBPtr
1519 );
1520
1521UINT8
1522MemNGetDramTermTblDrvNb (
1523 IN OUT MEM_NB_BLOCK *NBPtr,
1524 IN UINT8 ChipSel
1525 );
1526
1527UINT8
1528MemNGetDynDramTermTblDrvNb (
1529 IN OUT MEM_NB_BLOCK *NBPtr,
1530 IN UINT8 ChipSel
1531 );
1532
1533UINT32
1534MemNGetMR2CWLUnb (
1535 IN OUT MEM_NB_BLOCK *NBPtr
1536 );
1537
1538UINT32
1539MemNGetMR0CLTblDrvNb (
1540 IN OUT MEM_NB_BLOCK *NBPtr
1541 );
1542
1543UINT32
1544MemNGetMR0WRTblDrvNb (
1545 IN OUT MEM_NB_BLOCK *NBPtr
1546 );
1547
1548BOOLEAN
1549MemNRampUpFrequencyUnb (
1550 IN OUT MEM_NB_BLOCK *NBPtr
1551 );
1552
1553BOOLEAN
1554MemNAfterSaveRestoreUnb (
1555 IN OUT MEM_NB_BLOCK *NBPtr,
1556 IN OUT VOID *OptParam
1557 );
1558
1559BOOLEAN
1560MemNAdjustRdDqsDlyOffsetUnb (
1561 IN OUT MEM_NB_BLOCK *NBPtr,
1562 IN OUT VOID *Offset
1563 );
1564
1565BOOLEAN
1566MemNCalcWrDqDqsEarlyClientNb (
1567 IN OUT MEM_NB_BLOCK *NBPtr,
1568 IN OUT VOID *OptParam
1569 );
1570
1571BOOLEAN
1572MemNSlot1MaxRdLatTrainClientNb (
1573 IN OUT MEM_NB_BLOCK *NBPtr,
1574 IN OUT VOID *TestAddrRJ16
1575 );
1576
1577VOID
1578MemNC6AdjustMSRs (
1579 IN OUT MEM_NB_BLOCK *NBPtr
1580 );
1581
1582BOOLEAN
1583MemNInitializeRxEnSeedlessTrainingUnb (
1584 IN OUT MEM_NB_BLOCK *NBPtr,
1585 IN OUT VOID *OptParam
1586 );
1587
1588BOOLEAN
1589MemNTrackRxEnSeedlessRdWrNoWindBLErrorUnb (
1590 IN OUT MEM_NB_BLOCK *NBPtr,
1591 IN OUT VOID *OptParam
1592 );
1593
1594BOOLEAN
1595MemNTrackRxEnSeedlessRdWrSmallWindBLErrorUnb (
1596 IN OUT MEM_NB_BLOCK *NBPtr,
1597 IN OUT VOID *OptParam
1598 );
1599
1600BOOLEAN
1601MemNInitialzeRxEnSeedlessByteLaneErrorUnb (
1602 IN OUT MEM_NB_BLOCK *NBPtr,
1603 IN OUT VOID *OptParam
1604 );
1605
1606VOID
1607MemNPhyPowerSavingMPstateUnb (
1608 IN OUT MEM_NB_BLOCK *NBPtr
1609 );
1610
1611VOID
1612MemNChangeMemPStateContextNb (
1613 IN OUT MEM_NB_BLOCK *NBPtr,
1614 IN MEM_PSTATE MemPstate
1615 );
1616
1617VOID
1618MemNDramPowerMngTimingNb (
1619 IN OUT MEM_NB_BLOCK *NBPtr
1620 );
1621
1622BOOLEAN
1623MemNBfAfExcludeDimmClientNb (
1624 IN OUT MEM_NB_BLOCK *NBPtr,
1625 IN OUT VOID *IsBefore
1626 );
1627
1628
1629BOOLEAN
1630MemNAllocateNBRegTableNb (
1631 IN OUT MEM_NB_BLOCK *NBPtr,
1632 IN NB_REG_TAB_HANDLE Handle
1633 );
1634
1635VOID
1636MemTResetRcvFifoUnb (
1637 IN OUT struct _MEM_TECH_BLOCK *TechPtr,
1638 IN UINT8 Dummy
1639 );
1640
1641VOID
1642MemRecNContReadPatternUnb (
1643 IN OUT MEM_NB_BLOCK *NBPtr,
1644 IN UINT8 Buffer[],
1645 IN UINT32 Address,
1646 IN UINT16 ClCount
1647 );
1648
1649VOID
1650MemRecNContWritePatternUnb (
1651 IN OUT MEM_NB_BLOCK *NBPtr,
1652 IN UINT32 Address,
1653 IN UINT8 Pattern[],
1654 IN UINT16 ClCount
1655 );
1656
1657UINT16
1658MemRecNCompareTestPatternUnb (
1659 IN OUT MEM_NB_BLOCK *NBPtr,
1660 IN UINT8 Buffer[],
1661 IN UINT8 Pattern[],
1662 IN UINT16 ByteCount
1663 );
1664
1665BOOLEAN
1666MemNResetRxFifoPtrClientNb (
1667 IN OUT MEM_NB_BLOCK *NBPtr,
1668 IN OUT VOID *OptParam
1669 );
1670
1671
1672UINT32
1673MemNInPhaseCompareRdDqs2DPatternUnb (
1674 IN OUT MEM_NB_BLOCK *NBPtr,
1675 IN UINT8 Buffer[],
1676 IN UINT8 Pattern[],
1677 IN UINT16 ByteCount
1678 );
1679
1680UINT32
1681MemN180CompareRdDqs2DPatternUnb (
1682 IN OUT MEM_NB_BLOCK *NBPtr,
1683 IN UINT8 Buffer[],
1684 IN UINT8 Pattern[],
1685 IN UINT16 ByteCount
1686 );
1687
1688VOID
1689MemNAgressorContinuousWritesUnb (
1690 IN OUT MEM_NB_BLOCK *NBPtr,
1691 IN UINT8 SeedCount,
1692 IN BOOLEAN TurnOnInfinite
1693 );
1694
1695UINT32
1696MemNGetPrbs2dRdDqsSeedUnb (
1697 IN OUT MEM_NB_BLOCK *NBPtr,
1698 IN UINT8 SeedCount
1699 );
1700
1701
1702VOID
1703MemNRrwPrechargeCmd (
1704 IN OUT MEM_NB_BLOCK *NBPtr,
1705 IN UINT8 ChipSelect,
1706 IN UINT8 Bank
1707 );
1708
1709VOID
1710MemNRrwActivateCmd (
1711 IN OUT MEM_NB_BLOCK *NBPtr,
1712 IN UINT8 ChipSelect,
1713 IN UINT8 Bank,
1714 IN UINT32 RowAddress
1715 );
1716
1717VOID
1718MemNStartRdDqs2dVictimContinuousWritesUnb (
1719 IN OUT MEM_NB_BLOCK *NBPtr,
1720 IN UINT8 SeedCount
1721 );
1722
1723VOID
1724MemNInitializeRdDqs2dVictimChipSelContinuousWritesUnb (
1725 IN OUT MEM_NB_BLOCK *NBPtr
1726 );
1727
1728VOID
1729MemNFinalizeRdDqs2dVictimContinuousWritesUnb (
1730 IN OUT MEM_NB_BLOCK *NBPtr
1731 );
1732
1733VOID
1734MemNInitializeRdDqs2dVictimContinuousWritesUnb (
1735 IN OUT MEM_NB_BLOCK *NBPtr
1736 );
1737
1738BOOLEAN
1739MemNAdjustWrDqsBeforeSeedScalingUnb (
1740 IN OUT MEM_NB_BLOCK *NBPtr,
1741 IN OUT VOID *WrDqsBias
1742 );
1743
1744BOOLEAN
1745MemNDefaultFamilyHookNb (
1746 IN OUT MEM_NB_BLOCK *NBPtr,
1747 IN OUT VOID *OptParam
1748 );
1749
1750VOID
1751MemNBrdcstSetUnConditionalNb (
1752 IN OUT MEM_NB_BLOCK *NBPtr,
1753 IN BIT_FIELD_NAME FieldName,
1754 IN UINT32 Field
1755 );
1756
1757
1758VOID
1759MemNContReadPatternUnb (
1760 IN OUT MEM_NB_BLOCK *NBPtr,
1761 IN UINT8 Buffer[],
1762 IN UINT32 Address,
1763 IN UINT16 ClCount
1764 );
1765
1766VOID
1767MemNContWritePatternUnb (
1768 IN OUT MEM_NB_BLOCK *NBPtr,
1769 IN UINT32 Address,
1770 IN UINT8 Pattern[],
1771 IN UINT16 ClCount
1772 );
1773
1774UINT16
1775MemNCompareTestPatternUnb (
1776 IN OUT MEM_NB_BLOCK *NBPtr,
1777 IN UINT8 Buffer[],
1778 IN UINT8 Pattern[],
1779 IN UINT16 ByteCount
1780 );
1781
1782UINT32
1783MemNGetMemoryWidthUnb (
1784 IN OUT MEM_NB_BLOCK *NBPtr
1785 );
1786
1787#endif /* _MN_H_ */
1788