9 * @xrefitem bom "File Content Label" "Release Content"
11 * @e sub-project: (Mem)
12 * @e \$Revision: 55046 $ @e \$Date: 2011-06-15 23:59:07 -0600 (Wed, 15 Jun 2011) $
15 /*****************************************************************************
17 * Copyright (C) 2012 Advanced Micro Devices, Inc.
18 * All rights reserved.
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.
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.
42 * ***************************************************************************
49 /*----------------------------------------------------------------------------
50 * Mixed (DEFINITIONS AND MACROS / TYPEDEFS, STRUCTURES, ENUMS)
52 *----------------------------------------------------------------------------
55 /*-----------------------------------------------------------------------------
56 * DEFINITIONS AND MACROS
58 *-----------------------------------------------------------------------------
60 #define _4GB_RJ16 (((UINT32) 4) << (30 - 16))
61 #define _1TB_RJ16 (((UINT32) 1) << (40 - 16))
62 #define HT_REGION_BASE_RJ16 ((UINT32)0x00FD0000)
64 #define DCT_ACCESS_WRITE (UINT32) 0x40000000
66 #define THERMAL_OPT 31
69 #define DCT_PHY_ACCESS 1
72 #define DCT_PHY_DIRECT 0xF1
74 #define VT_MSK_VALUE 0
76 /*---------------------------------------------
77 * TSEFO - Type Start End Function Offset
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 *---------------------------------------------
92 MAKE_TSEFO(TableName, a, b, c, d, BitFieldIndex):
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.
101 @return TSEFO Access params encrypted in TSEFO format.
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) \
111 (((UINT32) c) << 21) | (((UINT32) d) << 16) \
113 (((UINT32) d) << 21) | (((UINT32) c) << 16) \
118 (((UINT32) a) << 30) | (((UINT32) b) & 0xFFFFFFF) | ( \
119 (((UINT32) b) >> 16) ? ( \
120 (((UINT32) 1) << 29) \
123 (((UINT32) c) << 21) | (((UINT32) d) << 16) \
125 (((UINT32) d) << 21) | (((UINT32) c) << 16) \
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.
139 @param[in] LowerBitFieldIndex
140 @param[in] HigherBitFieldIndex
142 @return TSEFO Access params encrypted in TSEFO format.
144 #define LINK_TSEFO(TableName, LowerBitFieldIndex, HigherBitFieldIndex) { \
145 ASSERT (LowerBitFieldIndex == (HigherBitFieldIndex - 1)) ; \
146 TableName[LowerBitFieldIndex] = TableName[LowerBitFieldIndex] | (((UINT32) 1) << 26); \
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)
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))
175 #define DDR2_TRAIN_FLOW 0
176 #define DDR3_TRAIN_FLOW 1
179 // Minimum Data Eye width in consecutive 32nds of a UI of
182 #define MIN_RD_DATAEYE_WIDTH_NB 4
183 #define MIN_WR_DATAEYE_WIDTH_NB 4
186 // RELIABLE READ/WRITE MODE DEFINITIONS
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
209 /*----------------------------------------------------------------------------
210 * TYPEDEFS, STRUCTURES, ENUMS
212 *----------------------------------------------------------------------------
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
232 /// DQS training related delays
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
242 /// Training patterns for position training
244 POS_PATTERN_72B, ///< 72 bit pattern
245 POS_PATTERN_256B, ///< 256 bit pattern
246 } POS_TRN_PATTERN_TYPE;
250 MISSION_MODE, ///< ODT during mission mode
251 WRITE_LEVELING_MODE ///< ODT during write leveling
255 * DRBN - Dimm-Rank-Byte-Nibble
257 * 11:09 Dimm (3-bits)
260 * 04:01 Byte (4-bits)
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))
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)
292 /// Delay Scaling Info Struct - Describes number of delay increments per UI of a delay type
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.)
300 /// Structure for certain data saving needed for DCT.
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
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
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
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.
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;
365 /// List for NB items that are supported
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
424 EnumSize ///< Size of list
427 /// List for family specific functions that are supported
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
496 NumberOfHooks ///< Size of list
497 } FAMILY_SPECIFIC_FUNC_INDEX;
499 ///< Entry for SPD Timing
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)
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.
529 PCI_ADDR PciAddr; ///< PCI address for this node
530 TSEFO *NBRegTable; ///< contains all bit field definitions
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
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
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
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.
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
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.
691 /*----------------------------------------------------------------------------
692 * FUNCTIONS PROTOTYPE
694 *----------------------------------------------------------------------------
698 IN OUT MEM_NB_BLOCK *NBPtr
703 IN OUT MEM_NB_BLOCK *NBPtr,
708 MemNSwitchChannelNb (
709 IN OUT MEM_NB_BLOCK *NBPtr,
715 IN OUT MEM_NB_BLOCK *NBPtr,
716 IN BIT_FIELD_NAME FieldName
721 IN OUT MEM_NB_BLOCK *NBPtr,
722 IN BIT_FIELD_NAME FieldName,
728 IN OUT MEM_NB_BLOCK *NBPtr,
729 IN BIT_FIELD_NAME FieldName,
735 IN OUT MEM_NB_BLOCK *NBPtr,
736 IN BIT_FIELD_NAME FieldName,
743 IN OUT MEM_NB_BLOCK *NBPtr,
744 IN TRN_DLY_TYPE TrnDly,
750 IN OUT MEM_NB_BLOCK *NBPtr,
751 IN TRN_DLY_TYPE TrnDly,
758 IN OUT MEM_NB_BLOCK *NBPtr,
762 UINT8 MemNGetSocketRelativeChannelNb (
763 IN OUT MEM_NB_BLOCK *NBPtr,
769 MemNPhyFenceTrainingNb (
770 IN OUT MEM_NB_BLOCK *NBPtr
774 MemNGetMCTSysAddrNb (
775 IN OUT MEM_NB_BLOCK *NBPtr,
782 IN OUT MEM_NB_BLOCK *NBPtr
787 IN OUT MEM_NB_BLOCK *NBPtr
792 IN OUT MEM_NB_BLOCK *NBPtr
796 MemNDisableDCTClientNb (
797 IN OUT MEM_NB_BLOCK *NBPtr
802 IN OUT MEM_NB_BLOCK *NBPtr
807 IN OUT MEM_NB_BLOCK *NBPtr
812 IN OUT MEM_NB_BLOCK *NBPtr
816 MemNChangeFrequencyNb (
817 IN OUT MEM_NB_BLOCK *NBPtr
821 MemNRampUpFrequencyNb (
822 IN OUT MEM_NB_BLOCK *NBPtr
826 MemNProgramCycTimingsNb (
827 IN OUT MEM_NB_BLOCK *NBPtr
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
840 MemNTotalSyncComponentsNb (
841 IN OUT MEM_NB_BLOCK *NBPtr
845 MemNSetMaxLatencyNb (
846 IN OUT MEM_NB_BLOCK *NBPtr,
847 IN UINT16 MaxRcvEnDly
852 IN OUT MEM_NB_BLOCK *NBPtr
857 IN OUT MEM_NB_BLOCK *NBPtr
862 IN OUT MEM_NB_BLOCK *NBPtr
866 MemNTrainPhyFenceNb (
867 IN OUT MEM_NB_BLOCK *NBPtr
872 IN OUT MEM_NB_BLOCK *NBPtr
876 MemNGetTrainDlyParmsNb (
877 IN OUT MEM_NB_BLOCK *NBPtr,
878 IN TRN_DLY_TYPE TrnDly,
879 IN OUT TRN_DLY_PARMS *Parms
884 MemNGetTrainDlyParmsClientNb (
885 IN OUT MEM_NB_BLOCK *NBPtr,
886 IN TRN_DLY_TYPE TrnDly,
887 IN OUT TRN_DLY_PARMS *Parms
891 MemNBeforeDQSTrainingNb (
892 IN OUT MEM_NB_BLOCK *NBPtr
896 MemNcmnGetSetTrainDlyNb (
897 IN OUT MEM_NB_BLOCK *NBPtr,
899 IN TRN_DLY_TYPE TrnDly,
905 MemNcmnGetSetTrainDlyClientNb (
906 IN OUT MEM_NB_BLOCK *NBPtr,
908 IN TRN_DLY_TYPE TrnDly,
914 MemNcmnGetSetTrainDlyUnb (
915 IN OUT MEM_NB_BLOCK *NBPtr,
917 IN TRN_DLY_TYPE TrnDly,
923 MemNSyncTargetSpeedNb (
924 IN OUT MEM_NB_BLOCK *NBPtr
928 MemNSyncDctsReadyNb (
929 IN OUT MEM_NB_BLOCK *NBPtr
934 IN OUT MEM_NB_BLOCK *NBPtr
939 IN OUT MEM_NB_BLOCK *NBPtr
944 IN OUT MEM_NB_BLOCK *NBPtr
949 IN OUT MEM_NB_BLOCK *NBPtr
954 IN OUT MEM_NB_BLOCK *NBPtr
959 IN OUT MEM_NB_BLOCK *NBPtr
964 IN OUT MEM_NB_BLOCK *NBPtr
969 IN OUT MEM_NB_BLOCK *NBPtr
974 IN OUT MEM_NB_BLOCK *NBPtr
978 MemNSyncAddrMapToAllNodesNb (
979 IN OUT MEM_NB_BLOCK *NBPtr
984 IN OUT MEM_NB_BLOCK *NBPtr
988 MemNTechBlockSwitchNb (
989 IN OUT MEM_NB_BLOCK *NBPtr
993 MemRecNGetBitFieldNb (
994 IN OUT MEM_NB_BLOCK *NBPtr,
995 IN BIT_FIELD_NAME FieldName
999 MemRecNSetBitFieldNb (
1000 IN OUT MEM_NB_BLOCK *NBPtr,
1001 IN BIT_FIELD_NAME FieldName,
1006 MemRecNGetTrainDlyNb (
1007 IN OUT MEM_NB_BLOCK *NBPtr,
1008 IN TRN_DLY_TYPE TrnDly,
1013 MemRecNSetTrainDlyNb (
1014 IN OUT MEM_NB_BLOCK *NBPtr,
1015 IN TRN_DLY_TYPE TrnDly,
1021 MemRecNAutoConfigNb (
1022 IN OUT MEM_NB_BLOCK *NBPtr
1026 MemRecNPlatformSpecNb (
1027 IN OUT MEM_NB_BLOCK *NBPtr
1031 MemRecNStartupDCTNb (
1032 IN OUT MEM_NB_BLOCK *NBPtr
1036 MemRecNSetMaxLatencyNb (
1037 IN OUT MEM_NB_BLOCK *NBPtr,
1038 IN UINT16 MaxRcvEnDly
1042 MemRecNSetDramOdtNb (
1043 IN OUT MEM_NB_BLOCK *NBPtr,
1044 IN ODT_MODE OdtMode,
1045 IN UINT8 ChipSelect,
1050 MemRecNSendMrsCmdNb (
1051 IN OUT MEM_NB_BLOCK *NBPtr
1056 MemRecNSendZQCmdNb (
1057 IN OUT MEM_NB_BLOCK *NBPtr
1061 MemRecNContReadPatternClientNb (
1062 IN OUT MEM_NB_BLOCK *NBPtr,
1070 IN OUT MEM_NB_BLOCK *NBPtr
1074 MemRecNCPUMemRecTypingNb (
1075 IN OUT MEM_NB_BLOCK *NBPtr
1079 MemRecNGetMCTSysAddrNb ( VOID );
1082 MemRecGetVarMtrrHiMsk (
1083 IN CPU_LOGICAL_ID *LogicalIdPtr,
1084 IN AMD_CONFIG_PARAMS *StdHeader
1088 MemNGetOptimalCGDDNb (
1089 IN OUT MEM_NB_BLOCK *NBPtr,
1090 IN TRN_DLY_TYPE TrnDly1,
1091 IN TRN_DLY_TYPE TrnDly2
1095 MemNPollBitFieldNb (
1096 IN OUT MEM_NB_BLOCK *NBPtr,
1097 IN BIT_FIELD_NAME FieldName,
1099 IN UINT32 MicroSecond,
1100 IN BOOLEAN IfBroadCast
1104 MemNSetEccSymbolSizeNb (
1105 IN OUT MEM_NB_BLOCK *NBPtr
1110 IN OUT MEM_NB_BLOCK *NBPtr
1115 IN OUT MEM_NB_BLOCK *NBPtr
1119 MemNTrainingFlowNb (
1120 IN OUT MEM_NB_BLOCK *NBPtr
1124 MemNRecTrainingFlowNb (
1125 IN OUT MEM_NB_BLOCK *NBPtr
1129 MemNRecTrainingFlowClientNb (
1130 IN OUT MEM_NB_BLOCK *NBPtr
1134 MemNRecTrainingFlowUnb (
1135 IN OUT MEM_NB_BLOCK *NBPtr
1139 MemRecNTotalSyncComponentsClientNb (
1140 IN OUT MEM_NB_BLOCK *NBPtr
1144 MemRecNStartupDCTClientNb (
1145 IN OUT MEM_NB_BLOCK *NBPtr
1150 MemRecNPhyVoltageLevelNb (
1151 IN OUT MEM_NB_BLOCK *NBPtr
1155 MemNTrainingPatternInitNb (
1156 IN OUT MEM_NB_BLOCK *NBPtr
1160 MemNGetApproximateWriteDatDelayNb (
1161 IN OUT MEM_NB_BLOCK *NBPtr,
1167 MemNTrainingPatternFinalizeNb (
1168 IN OUT MEM_NB_BLOCK *NBPtr
1172 MemNFlushPatternNb (
1173 IN OUT MEM_NB_BLOCK *NBPtr,
1179 MemNCSPerChannelNb (
1180 IN OUT MEM_NB_BLOCK *NBPtr
1185 IN OUT MEM_NB_BLOCK *NBPtr
1189 MemNMinDataEyeWidthNb (
1190 IN OUT MEM_NB_BLOCK *NBPtr
1194 MemNCompareTestPatternNb (
1195 IN OUT MEM_NB_BLOCK *NBPtr,
1202 MemNInsDlyCompareTestPatternNb (
1203 IN MEM_NB_BLOCK *NBPtr,
1212 IN OUT MEM_NB_BLOCK *NBPtr
1216 MemNSetMTRRUmaRegionUCNb (
1217 IN OUT MEM_NB_BLOCK *NBPtr,
1219 IN OUT UINT32 *LimitPtr
1223 MemNGetMemClkFreqIdNb (
1224 IN OUT MEM_NB_BLOCK *NBPtr,
1229 MemNGetMemClkFreqIdClientNb (
1230 IN OUT MEM_NB_BLOCK *NBPtr,
1235 MemNGetMemClkFreqIdUnb (
1236 IN OUT MEM_NB_BLOCK *NBPtr,
1241 MemNGetMemClkFreqUnb (
1242 IN OUT MEM_NB_BLOCK *NBPtr,
1247 MemNGetPlatformCfgNb (
1248 IN OUT MEM_NB_BLOCK *NBPtr
1252 MemNPlatformSpecUnb (
1253 IN OUT MEM_NB_BLOCK *NBPtr
1257 MemNProgramPlatformSpecNb (
1258 IN OUT MEM_NB_BLOCK *NBPtr
1262 MemNProgramCycTimingsClientNb (
1263 IN OUT MEM_NB_BLOCK *NBPtr
1268 IN OUT MEM_NB_BLOCK *NBPtr,
1269 IN TRN_DLY_TYPE TrnDlyType1,
1270 IN TRN_DLY_TYPE TrnDlyType2,
1271 IN BOOLEAN SameDimm,
1276 MemNChangeFrequencyClientNb (
1277 IN OUT MEM_NB_BLOCK *NBPtr
1281 MemNChangeFrequencyUnb (
1282 IN OUT MEM_NB_BLOCK *NBPtr
1286 MemNProgramNbPstateDependentRegistersUnb (
1287 IN OUT MEM_NB_BLOCK *NBPtr
1291 MemNProgramNbPstateDependentRegistersClientNb (
1292 IN OUT MEM_NB_BLOCK *NBPtr
1296 MemNAllocateC6StorageClientNb (
1297 IN OUT MEM_NB_BLOCK *NBPtr
1301 MemNAllocateC6StorageUnb (
1302 IN OUT MEM_NB_BLOCK *NBPtr
1306 MemNPhyVoltageLevelNb (
1307 IN OUT MEM_NB_BLOCK *NBPtr
1311 MemNPhyFenceTrainingUnb (
1312 IN OUT MEM_NB_BLOCK *NBPtr
1316 MemNPFenceAdjustUnb (
1317 IN OUT MEM_NB_BLOCK *NBPtr,
1318 IN OUT INT16 *Value16
1322 MemNInitPhyCompClientNb (
1323 IN OUT MEM_NB_BLOCK *NBPtr
1327 MemNTotalSyncComponentsClientNb (
1328 IN OUT MEM_NB_BLOCK *NBPtr
1332 MemNEnableSwapIntlvRgnNb (
1333 IN OUT MEM_NB_BLOCK *NBPtr,
1339 MemNPhyPowerSavingClientNb (
1340 IN OUT MEM_NB_BLOCK *NBPtr
1344 MemNPhyPowerSavingUnb (
1345 IN OUT MEM_NB_BLOCK *NBPtr
1350 IN OUT MEM_NB_BLOCK *NBPtr
1354 MemNPrepareRcvrEnDlySeedNb (
1355 IN OUT MEM_NB_BLOCK *NBPtr
1359 MemNChangeNbFrequencyUnb (
1360 IN OUT MEM_NB_BLOCK *NBPtr
1364 MemNChangeNbFrequencyNb (
1365 IN OUT MEM_NB_BLOCK *NBPtr
1369 MemNWaitXMemClksNb (
1370 IN OUT MEM_NB_BLOCK *NBPtr,
1371 IN UINT32 MemClkCount
1375 memNSequenceDDR3Nb (
1376 IN OUT MEM_NB_BLOCK *NBPtr
1380 GetTrainDlyFromHeapNb (
1381 IN OUT MEM_NB_BLOCK *NBPtr,
1382 IN TRN_DLY_TYPE TrnDlyType,
1387 MemNTrainingFlowUnb (
1388 IN OUT MEM_NB_BLOCK *NBPtr
1392 MemNSetupHwTrainingEngineUnb (
1393 IN OUT MEM_NB_BLOCK *NBPtr,
1398 MemNBeforePhyFenceTrainingClientNb (
1399 IN OUT MEM_NB_BLOCK *NBPtr,
1400 IN OUT VOID *OptParam
1404 MemNReEnablePhyCompNb (
1405 IN OUT MEM_NB_BLOCK *NBPtr,
1406 IN OUT VOID *OptParam
1411 IN OUT MEM_NB_BLOCK *NBPtr,
1416 MemNGetDynDramTermNb (
1417 IN OUT MEM_NB_BLOCK *NBPtr,
1423 IN OUT MEM_NB_BLOCK *NBPtr
1428 IN OUT MEM_NB_BLOCK *NBPtr
1433 IN OUT MEM_NB_BLOCK *NBPtr
1437 MemNDctCfgSelectUnb (
1438 IN OUT MEM_NB_BLOCK *NBPtr,
1443 MemNGetMaxDdrRateUnb (
1444 IN OUT MEM_NB_BLOCK *NBPtr,
1449 MemRecNReEnablePhyCompNb (
1450 IN OUT MEM_NB_BLOCK *NBPtr,
1451 IN OUT VOID *OptParam
1455 MemRecNcmnGetSetTrainDlyClientNb (
1456 IN OUT MEM_NB_BLOCK *NBPtr,
1458 IN TRN_DLY_TYPE TrnDly,
1465 IN OUT MEM_NB_BLOCK *NBPtr
1469 MemNAdjustTxpdllClientNb (
1470 IN OUT MEM_NB_BLOCK *NBPtr,
1471 IN OUT VOID *OptParam
1475 MemNCalcWrDqDqsEarlyUnb (
1476 IN OUT MEM_NB_BLOCK *NBPtr,
1477 IN OUT VOID *OptParam
1481 MemNGetTrainDlyParmsUnb (
1482 IN OUT MEM_NB_BLOCK *NBPtr,
1483 IN TRN_DLY_TYPE TrnDly,
1484 IN OUT TRN_DLY_PARMS *Parms
1488 MemNPlatformSpecificFormFactorInitTblDrvNb (
1489 IN OUT MEM_NB_BLOCK *NBPtr
1493 MemNChangeNbFrequencyWrapUnb (
1494 IN OUT MEM_NB_BLOCK *NBPtr,
1499 MemNForcePhyToM0Unb (
1500 IN OUT MEM_NB_BLOCK *NBPtr,
1501 IN OUT VOID *OptParam
1505 MemNProgramCycTimingsUnb (
1506 IN OUT MEM_NB_BLOCK *NBPtr
1510 MemNSetSkewMemClkUnb (
1511 IN OUT MEM_NB_BLOCK *NBPtr,
1512 IN OUT VOID *OptParam
1517 IN OUT MEM_NB_BLOCK *NBPtr
1521 MemNGetDramTermTblDrvNb (
1522 IN OUT MEM_NB_BLOCK *NBPtr,
1527 MemNGetDynDramTermTblDrvNb (
1528 IN OUT MEM_NB_BLOCK *NBPtr,
1534 IN OUT MEM_NB_BLOCK *NBPtr
1538 MemNGetMR0CLTblDrvNb (
1539 IN OUT MEM_NB_BLOCK *NBPtr
1543 MemNGetMR0WRTblDrvNb (
1544 IN OUT MEM_NB_BLOCK *NBPtr
1548 MemNRampUpFrequencyUnb (
1549 IN OUT MEM_NB_BLOCK *NBPtr
1553 MemNAfterSaveRestoreUnb (
1554 IN OUT MEM_NB_BLOCK *NBPtr,
1555 IN OUT VOID *OptParam
1559 MemNAdjustRdDqsDlyOffsetUnb (
1560 IN OUT MEM_NB_BLOCK *NBPtr,
1565 MemNCalcWrDqDqsEarlyClientNb (
1566 IN OUT MEM_NB_BLOCK *NBPtr,
1567 IN OUT VOID *OptParam
1571 MemNSlot1MaxRdLatTrainClientNb (
1572 IN OUT MEM_NB_BLOCK *NBPtr,
1573 IN OUT VOID *TestAddrRJ16
1578 IN OUT MEM_NB_BLOCK *NBPtr
1582 MemNInitializeRxEnSeedlessTrainingUnb (
1583 IN OUT MEM_NB_BLOCK *NBPtr,
1584 IN OUT VOID *OptParam
1588 MemNTrackRxEnSeedlessRdWrNoWindBLErrorUnb (
1589 IN OUT MEM_NB_BLOCK *NBPtr,
1590 IN OUT VOID *OptParam
1594 MemNTrackRxEnSeedlessRdWrSmallWindBLErrorUnb (
1595 IN OUT MEM_NB_BLOCK *NBPtr,
1596 IN OUT VOID *OptParam
1600 MemNInitialzeRxEnSeedlessByteLaneErrorUnb (
1601 IN OUT MEM_NB_BLOCK *NBPtr,
1602 IN OUT VOID *OptParam
1606 MemNPhyPowerSavingMPstateUnb (
1607 IN OUT MEM_NB_BLOCK *NBPtr
1611 MemNChangeMemPStateContextNb (
1612 IN OUT MEM_NB_BLOCK *NBPtr,
1613 IN MEM_PSTATE MemPstate
1617 MemNDramPowerMngTimingNb (
1618 IN OUT MEM_NB_BLOCK *NBPtr
1622 MemNBfAfExcludeDimmClientNb (
1623 IN OUT MEM_NB_BLOCK *NBPtr,
1624 IN OUT VOID *IsBefore
1629 MemNAllocateNBRegTableNb (
1630 IN OUT MEM_NB_BLOCK *NBPtr,
1631 IN NB_REG_TAB_HANDLE Handle
1635 MemTResetRcvFifoUnb (
1636 IN OUT struct _MEM_TECH_BLOCK *TechPtr,
1641 MemRecNContReadPatternUnb (
1642 IN OUT MEM_NB_BLOCK *NBPtr,
1649 MemRecNContWritePatternUnb (
1650 IN OUT MEM_NB_BLOCK *NBPtr,
1657 MemRecNCompareTestPatternUnb (
1658 IN OUT MEM_NB_BLOCK *NBPtr,
1665 MemNResetRxFifoPtrClientNb (
1666 IN OUT MEM_NB_BLOCK *NBPtr,
1667 IN OUT VOID *OptParam
1672 MemNInPhaseCompareRdDqs__PatternUnb (
1673 IN OUT MEM_NB_BLOCK *NBPtr,
1680 MemN180CompareRdDqs__PatternUnb (
1681 IN OUT MEM_NB_BLOCK *NBPtr,
1688 MemNAgressorContinuousWritesUnb (
1689 IN OUT MEM_NB_BLOCK *NBPtr,
1691 IN BOOLEAN TurnOnInfinite
1695 MemNGetPrbs__RdDqsSeedUnb (
1696 IN OUT MEM_NB_BLOCK *NBPtr,
1701 MemNAdjust2DPhaseMaskBasedOnEccUnb (
1702 IN OUT MEM_NB_BLOCK *NBPtr,
1703 IN OUT VOID *OptParam
1707 MemNRrwPrechargeCmd (
1708 IN OUT MEM_NB_BLOCK *NBPtr,
1709 IN UINT8 ChipSelect,
1714 MemNRrwActivateCmd (
1715 IN OUT MEM_NB_BLOCK *NBPtr,
1716 IN UINT8 ChipSelect,
1718 IN UINT32 RowAddress
1722 MemNStartRdDqs__VictimContinuousWritesUnb (
1723 IN OUT MEM_NB_BLOCK *NBPtr,
1728 MemNInitializeRdDqs__VictimChipSelContinuousWritesUnb (
1729 IN OUT MEM_NB_BLOCK *NBPtr
1733 MemNFinalizeRdDqs__VictimContinuousWritesUnb (
1734 IN OUT MEM_NB_BLOCK *NBPtr
1738 MemNInitializeRdDqs__VictimContinuousWritesUnb (
1739 IN OUT MEM_NB_BLOCK *NBPtr