7 * Llano initializer for MCT and DCT
9 * @xrefitem bom "File Content Label" "Release Content"
11 * @e sub-project: (Mem/Main)
12 * @e \$Revision: 34897 $ @e \$Date: 2010-07-14 10:07:10 +0800 (Wed, 14 Jul 2010) $
16 *****************************************************************************
18 * Copyright (c) 2011, Advanced Micro Devices, Inc.
19 * All rights reserved.
21 * Redistribution and use in source and binary forms, with or without
22 * modification, are permitted provided that the following conditions are met:
23 * * Redistributions of source code must retain the above copyright
24 * notice, this list of conditions and the following disclaimer.
25 * * Redistributions in binary form must reproduce the above copyright
26 * notice, this list of conditions and the following disclaimer in the
27 * documentation and/or other materials provided with the distribution.
28 * * Neither the name of Advanced Micro Devices, Inc. nor the names of
29 * its contributors may be used to endorse or promote products derived
30 * from this software without specific prior written permission.
32 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
33 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
34 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
35 * DISCLAIMED. IN NO EVENT SHALL ADVANCED MICRO DEVICES, INC. BE LIABLE FOR ANY
36 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
37 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
38 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
39 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
40 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
41 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
43 * ***************************************************************************
48 *----------------------------------------------------------------------------
51 *----------------------------------------------------------------------------
57 #include "AdvancedApi.h"
60 #include "OptionMemory.h"
65 #include "GeneralServices.h"
66 #define FILECODE PROC_MEM_NB_ON_MNFLOWON_FILECODE
69 /*----------------------------------------------------------------------------
70 * DEFINITIONS AND MACROS
72 *----------------------------------------------------------------------------
75 /*----------------------------------------------------------------------------
76 * TYPEDEFS AND STRUCTURES
78 *----------------------------------------------------------------------------
81 /*----------------------------------------------------------------------------
82 * PROTOTYPES OF LOCAL FUNCTIONS
84 *----------------------------------------------------------------------------
87 /*----------------------------------------------------------------------------
90 *----------------------------------------------------------------------------
92 extern MEM_PLAT_SPEC_CFG* memPlatSpecFFInstalledON[MAX_FF_TYPES];
94 /* -----------------------------------------------------------------------------*/
98 * This function initializes the platform specific block
101 * @param[in,out] *NBPtr - Pointer to the MEM_NB_BLOCK
103 * @return TRUE - AGESA_SUCCESS at least one dorm factor was found
104 * @return FALSE - AGESA_UNSUPPORTED - Error indicating that no form factors were found
108 MemNPlatformSpecificFormFactorInitON (
109 IN OUT MEM_NB_BLOCK *NBPtr
114 if (NBPtr->MCTPtr->DimmValid == 0) {
115 PutEventLog (AGESA_FATAL, MEM_ERROR_NO_DIMM_FOUND_ON_SYSTEM, 0, 0, 0, 0, &(NBPtr->MemPtr->StdHeader));
116 SetMemError (AGESA_FATAL, NBPtr->MCTPtr);
117 ASSERT(FALSE); // Size of memory on BSP = 0, so no DIMM found
118 return FALSE; // There is no dimm present on the system.
120 for (f = 0; memPlatSpecFFInstalledON[f] != NULL; f++) {
121 if (memPlatSpecFFInstalledON[f] (NBPtr->MemPtr, NBPtr->ChannelPtr, NBPtr->PsPtr) == AGESA_SUCCESS) {
125 if (memPlatSpecFFInstalledON[f] == NULL) {
126 return FALSE; // No FF types are supported
131 /* -----------------------------------------------------------------------------*/
134 * This function selects appropriate Tech functions for the NB.
136 * @param[in,out] *NBPtr - Pointer to the MEM_NB_BLOCK
141 MemNTechBlockSwitchON (
142 IN OUT MEM_NB_BLOCK *NBPtr
145 MEM_TECH_BLOCK *TechPtr;
147 TechPtr = NBPtr->TechPtr;
149 // Specify Dimm-Byte training for Nb
150 MemTDimmByteTrainInit (TechPtr);
152 // Remove the following functions because they are not needed for ON
153 TechPtr->SetDramMode = (BOOLEAN (*) (MEM_TECH_BLOCK *)) memDefTrue;
154 TechPtr->SpdCalcWidth = (BOOLEAN (*) (MEM_TECH_BLOCK *)) memDefTrue;
155 TechPtr->SetDqsEccTmgs = (BOOLEAN (*) (MEM_TECH_BLOCK *)) memDefTrue;
156 TechPtr->AdjustTwrwr = (VOID (*) (MEM_TECH_BLOCK *)) memDefRet;
157 TechPtr->AdjustTwrrd = (VOID (*) (MEM_TECH_BLOCK *)) memDefRet;
158 TechPtr->GetLD = (INT8 (*) (MEM_TECH_BLOCK *)) memDefRet;
159 TechPtr->FindMaxDlyForMaxRdLat = MemTFindMaxRcvrEnDlyRdDqsDlyByte;
160 TechPtr->ResetDCTWrPtr = (VOID (*) (MEM_TECH_BLOCK *, UINT8)) memDefRet;
163 /*----------------------------------------------------------------------------
166 *----------------------------------------------------------------------------