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