AGESA F15: AMD family15 AGESA code
[coreboot.git] / src / vendorcode / amd / agesa / f15 / Proc / Mem / Ardk / DR / mardr3.c
1 /* $NoKeywords:$ */
2 /**
3  * @file
4  *
5  * mardr3.c
6  *
7  * Memory Controller, registered dimms
8  *
9  * @xrefitem bom "File Content Label" "Release Content"
10  * @e project: AGESA
11  * @e sub-project: (Mem/Ardk)
12  * @e \$Revision: 52286 $ @e \$Date: 2011-05-04 03:48:21 -0600 (Wed, 04 May 2011) $
13  *
14  **/
15 /*****************************************************************************
16   *
17  * Copyright (C) 2012 Advanced Micro Devices, Inc.
18  * All rights reserved.
19  *
20  * Redistribution and use in source and binary forms, with or without
21  * modification, are permitted provided that the following conditions are met:
22  *     * Redistributions of source code must retain the above copyright
23  *       notice, this list of conditions and the following disclaimer.
24  *     * Redistributions in binary form must reproduce the above copyright
25  *       notice, this list of conditions and the following disclaimer in the
26  *       documentation and/or other materials provided with the distribution.
27  *     * Neither the name of Advanced Micro Devices, Inc. nor the names of
28  *       its contributors may be used to endorse or promote products derived
29  *       from this software without specific prior written permission.
30  *
31  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
32  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
33  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
34  * DISCLAIMED. IN NO EVENT SHALL ADVANCED MICRO DEVICES, INC. BE LIABLE FOR ANY
35  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
36  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
37  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
38  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
39  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
40  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
41   *
42   * ***************************************************************************
43   *
44  */
45
46 /* This file contains routine that add platform specific support AM3 */
47
48
49 #include "AGESA.h"
50 #include "ma.h"
51 #include "OptionMemory.h"
52 #include "PlatformMemoryConfiguration.h"
53 #include "mu.h"
54 #include "Ids.h"
55 #include "cpuFamRegisters.h"
56 #include "Filecode.h"
57 CODE_GROUP (G2_PEI)
58 RDATA_GROUP (G2_PEI)
59
60 #define FILECODE PROC_MEM_ARDK_DR_MARDR3_FILECODE
61 /*----------------------------------------------------------------------------
62  *                          DEFINITIONS AND MACROS
63  *
64  *----------------------------------------------------------------------------
65  */
66
67 /*----------------------------------------------------------------------------
68  *                           TYPEDEFS AND STRUCTURES
69  *
70  *----------------------------------------------------------------------------
71  */
72
73 /*----------------------------------------------------------------------------
74  *                        PROTOTYPES OF LOCAL FUNCTIONS
75  *
76  *----------------------------------------------------------------------------
77  */
78
79 /*
80  *-----------------------------------------------------------------------------
81  *                                EXPORTED FUNCTIONS
82  *
83  *-----------------------------------------------------------------------------
84  */
85
86 STATIC CONST UINT8 ROMDATA DrRDdr3CLKDis[] = {0x00, 0x00, 0xC0, 0x30, 0x0C, 0x03, 0x00, 0x00};
87
88 // Even chip select maps to M[B,A]_CKE[0]
89 // Odd chip select maps to M[B,A]_CKE[1]
90 STATIC CONST UINT8 ROMDATA DrRDdr3CKETri[] = {0x55, 0xAA};
91
92 // 2 dimms per channel
93 // Dimm 0: BP_MEMODTx[2,0]
94 // Dimm 1: BP_MEMODTx[3,1]
95 STATIC CONST UINT8 ROMDATA DrRDdr3ODTTri2D[] = {0x03, 0x0C, 0x32, 0xC8};
96 // 3 dimms per channel
97 // Dimm 0: BP_MEMODTx[0]
98 // Dimm 1: BP_MEMODTx[3,1]
99 // Dimm 2: BP_MEMODTx[2]
100 STATIC CONST UINT8 ROMDATA DrRDdr3ODTTri3D[] = {0x03, 0x0C, 0x30, 0xC8};
101 // 4 dimms per channel
102 // Dimm 0: BP_MEMODTx[0]
103 // Dimm 1: BP_MEMODTx[1]
104 // Dimm 2: BP_MEMODTx[2]
105 // Dimm 3: BP_MEMODTx[3]
106 STATIC CONST UINT8 ROMDATA DrRDdr3ODTTri4D[] = {0x03, 0x0C, 0x30, 0xC0};
107
108 // BIOS must not tri-state chip select pin corresponding to the second chip
109 // select of a single rank registered dimm
110 STATIC CONST UINT8 ROMDATA DrRDdr3CSTri[] = {0x01, 0x03, 0x04, 0x0C, 0x10, 0x30, 0x40, 0xC0};
111
112 /* -----------------------------------------------------------------------------*/
113 /**
114  *
115  *         This is function sets the platform specific settings for DR DDR3 L1 system
116  *
117  *     @param[in,out]   *MemData           Pointer to MEM_DATA_STRUCTURE
118  *     @param[in]       SocketID          Socket number
119  *     @param[in,out]   *CurrentChannel       Pointer to CH_DEF_STRUCT
120  *
121  *     @return          AGESA_SUCCESS
122  *     @return          CurrentChannel->MemClkDisMap     Points this pointer to RB MemClkDis table
123  *     @return          CurrentChannel->ChipSelTriMap    Points this pointer to RB CS table
124  *     @return          CurrentChannel->CKETriMap        Points this pointer to RB ODT table
125  *     @return          CurrentChannel->ODTTriMap        Points this pointer to RB CKE table
126  *     @return          CurrentChannel->DctEccDQSLike      Indicates the bytes that should be averaged for ECC
127  *     @return          CurrentChannel->DctEccDQSScale     Indicates the scale that should be used for Averaging ECC byte
128  *     @return          CurrentChannel->DctAddrTmg        Address Command Timing Settings for specified channel
129  *     @return          CurrentChannel->DctOdcCtl         Drive Strength settings for specified channel
130  *     @return          CurrentChannel->SlowMode             Slow Mode
131  *
132  *
133  */
134
135 AGESA_STATUS
136 MemAGetPsCfgRDr3 (
137   IN OUT   MEM_DATA_STRUCT *MemData,
138   IN       UINT8 SocketID,
139   IN OUT   CH_DEF_STRUCT *CurrentChannel
140   )
141 {
142   STATIC CONST ADV_R_PSCFG_ENTRY PSCfg2DIMMs[] = {
143      {DDR800_FREQUENCY, SR_DIMM0 + DR_DIMM0 + SR_DIMM1 + DR_DIMM1, \
144        0x00000000, 0x0000, 1},
145      {DDR800_FREQUENCY, QR_DIMM0 + QR_DIMM1, \
146        0x00000000, 0x0040, 1},
147      {DDR800_FREQUENCY, ANY_DIMM0 + ANY_DIMM1, \
148        0x00000000, 0x4004, 2},
149      {DDR1066_FREQUENCY, SR_DIMM0 + DR_DIMM0 + SR_DIMM1 + DR_DIMM1, \
150        0x003C3C3C, 0x0000,1},
151      {DDR1066_FREQUENCY, QR_DIMM0 + QR_DIMM1, \
152        0x003C3C3C, 0x0040, 1},
153      {DDR1066_FREQUENCY, ANY_DIMM0 + ANY_DIMM1, \
154        0x003A3C3A, 0x4004, 2},
155      {DDR1333_FREQUENCY, SR_DIMM0 + DR_DIMM0 + SR_DIMM1 + DR_DIMM1, \
156        0x003A3A3A, 0x0000, 1},
157      {DDR1333_FREQUENCY, QR_DIMM0 + QR_DIMM1, \
158        0x003A3A3A, 0x0040, 1},
159      {DDR1333_FREQUENCY, SR_DIMM0 + DR_DIMM0 + SR_DIMM1 + DR_DIMM1, \
160        0x00383A38, 0x4040, 2},
161      {DDR1333_FREQUENCY, QR_DIMM0 + QR_DIMM1, \
162        0x00383A38, 0x4004, 2},
163      {DDR1600_FREQUENCY, SR_DIMM0 + DR_DIMM0 + SR_DIMM1 + DR_DIMM1, \
164        0x00373937, 0x0000, 1},
165      {DDR1600_FREQUENCY, QR_DIMM0 + QR_DIMM1, \
166        0x00373937, 0x0040, 1},
167      {DDR1600_FREQUENCY, ANY_DIMM0 + ANY_DIMM1, \
168        0x00353935, 0x4004, 2}
169   };
170
171   STATIC CONST ADV_R_PSCFG_ENTRY PSCfg3DIMMs[] = {
172      {DDR800_FREQUENCY, SR_DIMM0 + DR_DIMM0 + SR_DIMM1 + DR_DIMM1 + SR_DIMM2 + DR_DIMM2, \
173        0x00000000, 0x0000, 1},
174      {DDR800_FREQUENCY, SR_DIMM0 + DR_DIMM0 + SR_DIMM1 + DR_DIMM1 + SR_DIMM2 + DR_DIMM2, \
175        0x00000000, 0x4040, 2},
176      {DDR800_FREQUENCY, SR_DIMM0 + DR_DIMM0 + ANY_DIMM1 + SR_DIMM2 + DR_DIMM2, \
177        0x00380038, 0x4004, 3},
178      {DDR800_FREQUENCY, QR_DIMM1, \
179        0x00000000, 0x0040, 1},
180      {DDR800_FREQUENCY, SR_DIMM0 + DR_DIMM0 + QR_DIMM1 + SR_DIMM2 + DR_DIMM2, \
181        0x00000000, 0x4004, 2},
182      {DDR1066_FREQUENCY, SR_DIMM0 + DR_DIMM0 + SR_DIMM1 + DR_DIMM1 + SR_DIMM2 + DR_DIMM2, \
183        0x003C3C3C, 0x0000, 1},
184      {DDR1066_FREQUENCY, SR_DIMM0 + DR_DIMM0 + SR_DIMM1 + DR_DIMM1 + SR_DIMM2 + DR_DIMM2, \
185        0x003A3C3A, 0x4040, 2},
186      {DDR1066_FREQUENCY, SR_DIMM0 + DR_DIMM0 + SR_DIMM1 + DR_DIMM1 + SR_DIMM2 + DR_DIMM2, \
187        0x00373C37, 0x4040, 3},
188      {DDR1066_FREQUENCY, SR_DIMM0 + DR_DIMM0 + QR_DIMM1 + SR_DIMM2 + DR_DIMM2, \
189        0x00373C37, 0x4004, 3},
190      {DDR1066_FREQUENCY, QR_DIMM1, \
191        0x003C3C3C, 0x0040, 1},
192      {DDR1066_FREQUENCY, SR_DIMM0 + DR_DIMM0 + QR_DIMM1 + SR_DIMM2 + DR_DIMM2, \
193        0x003A3C3A, 0x4004, 2},
194      {DDR1333_FREQUENCY, SR_DIMM0 + DR_DIMM0 + SR_DIMM1 + DR_DIMM1 + SR_DIMM2 + DR_DIMM2, \
195        0x003A3A3A, 0x0000, 1},
196      {DDR1333_FREQUENCY, SR_DIMM0 + DR_DIMM0 + SR_DIMM1 + DR_DIMM1 + SR_DIMM2 + DR_DIMM2, \
197        0x00383A38, 0x4040, 2},
198      {DDR1333_FREQUENCY, SR_DIMM0 + DR_DIMM0 + ANY_DIMM1 + SR_DIMM2 + DR_DIMM2, \
199        0x00343A34, 0x4004, 3},
200      {DDR1333_FREQUENCY, QR_DIMM1, \
201        0x003A3A3A, 0x0040, 1},
202      {DDR1333_FREQUENCY, SR_DIMM0 + DR_DIMM0 + QR_DIMM1 + SR_DIMM2 + DR_DIMM2, \
203        0x00383A38, 0x4004, 2},
204      {DDR1600_FREQUENCY, SR_DIMM0 + DR_DIMM0 + SR_DIMM1 + DR_DIMM1 + SR_DIMM2 + DR_DIMM2, \
205        0x00393939, 0x0000, 1},
206      {DDR1600_FREQUENCY, SR_DIMM0 + DR_DIMM0 + SR_DIMM1 + DR_DIMM1 + SR_DIMM2 + DR_DIMM2, \
207        0x00363936, 0x4040, 2},
208      {DDR1600_FREQUENCY, SR_DIMM0 + DR_DIMM0 + ANY_DIMM1 + SR_DIMM2 + DR_DIMM2, \
209        0x00303930, 0x4004, 3},
210      {DDR1600_FREQUENCY, QR_DIMM1, \
211        0x00393939, 0x0040, 1},
212      {DDR1600_FREQUENCY, SR_DIMM0 + DR_DIMM0 + QR_DIMM1 + SR_DIMM2 + DR_DIMM2, \
213        0x00363936, 0x4004, 2}
214   };
215
216   STATIC CONST ADV_R_PSCFG_WL_ODT_ENTRY PSCfg2DIMMsWlODT[] = {
217     {SR_DIMM0,            {0x01, 0x00, 0x00, 0x00}, 1},
218     {DR_DIMM0,            {0x04, 0x00, 0x00, 0x00}, 1},
219     {SR_DIMM1,            {0x00, 0x02, 0x00, 0x00}, 1},
220     {DR_DIMM1,            {0x00, 0x08, 0x00, 0x00}, 1},
221     {QR_DIMM1,            {0x00, 0x0A, 0x00, 0x00}, 1},
222     {SR_DIMM0 + DR_DIMM0 + SR_DIMM1 + DR_DIMM1, {0x03, 0x03, 0x00, 0x00}, 2},
223     {SR_DIMM0 + QR_DIMM1, {0x0B, 0x03, 0x00, 0x09}, 2},
224     {DR_DIMM0 + QR_DIMM1, {0x0B, 0x03, 0x00, 0x09}, 2},
225     {QR_DIMM0 + SR_DIMM1, {0x03, 0x07, 0x06, 0x00}, 2},
226     {QR_DIMM0 + DR_DIMM1, {0x03, 0x07, 0x06, 0x00}, 2},
227     {QR_DIMM0 + QR_DIMM1, {0x0B, 0x07, 0x0E, 0x0D}, 2}
228   };
229
230   STATIC CONST ADV_R_PSCFG_WL_ODT_ENTRY PSCfg3DIMMsWlODT[] = {
231     {SR_DIMM2 + DR_DIMM2, {0x00, 0x00, 0x04, 0x00}, 1},
232     {SR_DIMM0 + DR_DIMM0, {0x01, 0x02, 0x00, 0x00}, 1},
233     {SR_DIMM0 + DR_DIMM0 + SR_DIMM2 + DR_DIMM2, {0x05, 0x00, 0x05, 0x00}, 2},
234     {SR_DIMM0 + DR_DIMM0 + SR_DIMM1 + DR_DIMM1 + SR_DIMM2 + DR_DIMM2, {0x07, 0x07, 0x07, 0x00}, 3},
235     {QR_DIMM1, {0x00, 0x0A, 0x00, 0x0A}, 1},
236     {QR_DIMM1 + SR_DIMM2 + DR_DIMM2, {0x00, 0x06, 0x0E, 0x0C}, 2},
237     {SR_DIMM0 + DR_DIMM0 + QR_DIMM1, {0x0B, 0x03, 0x00, 0x09}, 2},
238     {SR_DIMM0 + DR_DIMM0 + QR_DIMM1 + SR_DIMM2 + DR_DIMM2, {0x0F, 0x07, 0x0F, 0x0D}, 3}
239   };
240
241   STATIC CONST ADV_R_PSCFG_WL_ODT_ENTRY PSCfg4DIMMsWlODT[] = {
242     {ANY_DIMM3, {0x00, 0x00, 0x00, 0x08}, 1},
243     {ANY_DIMM2 + ANY_DIMM3, {0x00, 0x00, 0x0C, 0x0C}, 2},
244     {ANY_DIMM1 + ANY_DIMM2 + ANY_DIMM3, {0x00, 0x0E, 0x0E, 0x0E}, 3},
245     {ANY_DIMM0 + ANY_DIMM1 + ANY_DIMM2 + ANY_DIMM3, {0x0F, 0x0F, 0x0F, 0x0F}, 4}
246   };
247   UINT16 i;
248   UINT16 j;
249   UINT8  MaxDimmPerCH;
250   UINT8 Dimms;
251   UINT16 Speed;
252   UINT16 DIMMRankType;
253   UINT16 _DIMMRankType;
254   UINT8 DimmTpMatch;
255   UINT32 AddrTmgCTL;
256   UINT32 DctOdcCtl;
257   UINT16 RC2RC8;
258   BOOLEAN SlowMode;
259   UINT8 PSCfgSize;
260   UINT8 PSCfgWlODTSize;
261   UINT8 PhyWLODT[4];
262   CONST ADV_R_PSCFG_ENTRY *PSCfgPtr;
263   CONST ADV_R_PSCFG_WL_ODT_ENTRY *PSCfgWlODTPtr;
264   UINT8 *DimmsPerChPtr;
265
266   AddrTmgCTL = 0;
267   DctOdcCtl = 0;
268   RC2RC8 = 0;
269   SlowMode = FALSE;
270   ASSERT (MemData != NULL);
271   PhyWLODT[0] = 0x0F;
272   PhyWLODT[1] = 0x0F;
273   PhyWLODT[2] = 0x0F;
274   PhyWLODT[3] = 0x0F;
275   if ((CurrentChannel->MCTPtr->LogicalCpuid.Family & AMD_FAMILY_10_RB) == 0) {
276     return AGESA_UNSUPPORTED;
277   }
278   if (CurrentChannel->TechType != DDR3_TECHNOLOGY) {
279     return AGESA_UNSUPPORTED;
280   }
281   if (CurrentChannel->RegDimmPresent != CurrentChannel->ChDimmValid) {
282     return AGESA_UNSUPPORTED;
283   }
284   // Prepare inputs
285   Dimms = CurrentChannel->Dimms;
286   Speed = CurrentChannel->DCTPtr->Timings.Speed;
287
288   DimmsPerChPtr = FindPSOverrideEntry (MemData->ParameterListPtr->PlatformMemoryConfiguration, PSO_MAX_DIMMS, SocketID, CurrentChannel->ChannelID, 0, NULL, NULL);
289   if (DimmsPerChPtr != NULL) {
290     MaxDimmPerCH = *DimmsPerChPtr;
291   } else {
292     MaxDimmPerCH = 2;
293   }
294
295   DIMMRankType = MemAGetPsRankType (CurrentChannel);
296
297   if (MaxDimmPerCH == 4) {
298     PSCfgPtr = NULL;
299     PSCfgSize = NULL;
300     PSCfgWlODTPtr = PSCfg4DIMMsWlODT;
301     PSCfgWlODTSize = sizeof (PSCfg4DIMMsWlODT) / sizeof (ADV_R_PSCFG_WL_ODT_ENTRY);
302   } else if (MaxDimmPerCH == 3) {
303     PSCfgPtr = PSCfg3DIMMs;
304     PSCfgSize = sizeof (PSCfg3DIMMs) / sizeof (ADV_R_PSCFG_ENTRY);
305     PSCfgWlODTPtr = PSCfg3DIMMsWlODT;
306     PSCfgWlODTSize = sizeof (PSCfg3DIMMsWlODT) / sizeof (ADV_R_PSCFG_WL_ODT_ENTRY);
307   } else {
308     PSCfgPtr = PSCfg2DIMMs;
309     PSCfgSize = sizeof (PSCfg2DIMMs) / sizeof (ADV_R_PSCFG_ENTRY);
310     PSCfgWlODTPtr = PSCfg2DIMMsWlODT;
311     PSCfgWlODTSize = sizeof (PSCfg2DIMMsWlODT) / sizeof (ADV_R_PSCFG_WL_ODT_ENTRY);
312   }
313
314   // AddrTmgCTL and DctOdcCtl
315   if (MaxDimmPerCH != 4) {
316     for (i = 0; i < PSCfgSize; i++, PSCfgPtr++) {
317       if ((Speed != PSCfgPtr->Speed) || (Dimms != PSCfgPtr->Dimms)) {
318         continue;
319       }
320       DimmTpMatch = 0;
321       _DIMMRankType = DIMMRankType & PSCfgPtr->DIMMRankType;
322       for (j = 0; j < MAX_DIMMS_PER_CHANNEL; j++) {
323         if ((_DIMMRankType & (UINT16) 0x0F << (j << 2)) != 0) {
324           DimmTpMatch++;
325         }
326       }
327       if (DimmTpMatch == PSCfgPtr->Dimms) {
328         AddrTmgCTL = PSCfgPtr->AddrTmg;
329         DctOdcCtl = 0x00223222;
330         RC2RC8 = PSCfgPtr->RC2RC8;
331         break;
332       }
333     }
334   }
335
336   //
337   // Overrides and/or exceptions
338   //
339   DimmTpMatch = 0;
340   for (j = 0; j < MAX_DIMMS_PER_CHANNEL; j++) {
341     if ((DIMMRankType & (UINT16) 0x03 << (j << 2)) != 0) {
342       DimmTpMatch++;
343     }
344   }
345   if (MaxDimmPerCH == 4) {
346     if (DimmTpMatch > 0) {
347       DctOdcCtl = 0x00223222;
348       if ((Speed == DDR800_FREQUENCY) && (DimmTpMatch == 1)) {
349         DctOdcCtl = 0x00113222;
350       }
351     }
352     if (DimmTpMatch >= 3) {
353       AddrTmgCTL |= 0x002F0000;
354     }
355     if (DimmTpMatch >= 2) {
356       RC2RC8 = 0x4040;
357     }
358   } else {
359     if ((Dimms == 1) && (DimmTpMatch == 1)) {
360       DctOdcCtl = 0x00113222;
361     }
362   }
363
364   //RC2 and RC8
365   for (j = 0; j < MAX_DIMMS_PER_CHANNEL; j++) {
366     // CtrlWrd02(s) will contain the info. of SPD byte 63 after MemTDIMMPresence3 execution.
367     if (CurrentChannel->CtrlWrd02[j] > 0) {
368       if (CurrentChannel->CtrlWrd02[j] == 1) {
369         // Store real RC2 and RC8 value (High byte) into CtrlWrd02(s) and CtrlWrd08(s).
370         CurrentChannel->CtrlWrd02[j] = (UINT8) (RC2RC8 >> 12) & 0x000F;
371         CurrentChannel->CtrlWrd08[j] = (UINT8) (RC2RC8 >> 8) & 0x000F;
372       } else {
373         // Store real RC2 and RC8 value (low byte) into CtrlWrd02(s) and CtrlWrd08(s).
374         CurrentChannel->CtrlWrd02[j] = (UINT8) (RC2RC8 >> 4) & 0x000F;
375         CurrentChannel->CtrlWrd08[j] = (UINT8) RC2RC8 & 0x000F;
376       }
377     }
378   }
379
380
381   //WLODT
382   for (i = 0; i  < PSCfgWlODTSize; i++, PSCfgWlODTPtr++) {
383     if (Dimms != PSCfgWlODTPtr->Dimms) {
384       continue;
385     }
386     DimmTpMatch = 0;
387     _DIMMRankType = DIMMRankType & PSCfgWlODTPtr->DIMMRankType;
388     for (j = 0; j < MAX_DIMMS_PER_CHANNEL; j++) {
389       if ((_DIMMRankType & (UINT16) 0x0F << (j << 2)) != 0) {
390         DimmTpMatch++;
391       }
392     }
393     if (DimmTpMatch == PSCfgWlODTPtr->Dimms) {
394       PhyWLODT[0] = PSCfgWlODTPtr->PhyWrLvOdt[0];
395       PhyWLODT[1] = PSCfgWlODTPtr->PhyWrLvOdt[1];
396       PhyWLODT[2] = PSCfgWlODTPtr->PhyWrLvOdt[2];
397       PhyWLODT[3] = PSCfgWlODTPtr->PhyWrLvOdt[3];
398       break;
399     }
400   }
401
402   // Set ProcODT
403   DctOdcCtl |= 0x20000000;
404
405   CurrentChannel->MemClkDisMap = (UINT8 *) DrRDdr3CLKDis;
406   CurrentChannel->CKETriMap = (UINT8 *) DrRDdr3CKETri;
407   CurrentChannel->ChipSelTriMap = (UINT8 *) DrRDdr3CSTri;
408
409   switch (MaxDimmPerCH) {
410   case 3:
411     CurrentChannel->ODTTriMap = (UINT8 *) DrRDdr3ODTTri3D;
412     break;
413   case 4:
414     CurrentChannel->ODTTriMap = (UINT8 *) DrRDdr3ODTTri4D;
415     break;
416   default:
417     CurrentChannel->ODTTriMap = (UINT8 *) DrRDdr3ODTTri2D;
418   }
419
420   CurrentChannel->DctAddrTmg = AddrTmgCTL;
421   CurrentChannel->DctOdcCtl = DctOdcCtl;
422   for (i = 0; i < sizeof (CurrentChannel->PhyWLODT); i++) {
423     CurrentChannel->PhyWLODT[i] = PhyWLODT[i];
424   }
425   CurrentChannel->SlowMode = SlowMode;
426
427   return AGESA_SUCCESS;
428 }