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