2 * This file is part of the coreboot project.
4 * Copyright (C) 2010 Advanced Micro Devices, Inc.
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21 u8 mct_checkNumberOfDqsRcvEn_Pass(u8 pass)
26 u32 SetupDqsPattern_PassA(u8 Pass)
30 ret = (u32) TestPattern1_D;
32 ret = (u32) TestPattern2_D;
37 u32 SetupDqsPattern_PassB(u8 Pass)
41 ret = (u32) TestPattern0_D;
43 ret = (u32) TestPattern2_D;
48 u8 mct_Get_Start_RcvrEnDly_Pass(struct DCTStatStruc *pDCTstat,
49 u8 Channel, u8 Receiver,
54 if (Pass == FirstPass)
60 u8 *p = pDCTstat->CH_D_B_RCVRDLY[Channel][Receiver>>1];
64 for ( i=0;i<bn; i++) {
77 u8 mct_Average_RcvrEnDly_Pass(struct DCTStatStruc *pDCTstat,
78 u8 RcvrEnDly, u8 RcvrEnDlyLimit,
79 u8 Channel, u8 Receiver, u8 Pass)
91 p = pDCTstat->CH_D_B_RCVRDLY[Channel][Receiver>>1];
93 if (Pass == SecondPass) { /* second pass must average values */
94 /* FIXME: which byte? */
95 p_1 = pDCTstat->B_RCVRDLY_1;
96 /* p_1 = pDCTstat->CH_D_B_RCVRDLY_1[Channel][Receiver>>1]; */
100 if (val != (RcvrEnDlyLimit - 1)) {
101 val -= Pass1MemClkDly;
112 pDCTstat->ErrStatus |= 1<<SB_NORCVREN;
114 pDCTstat->DimmTrainFail &= ~(1<<(Receiver + Channel));
117 for(i=0; i < bn; i++) {
119 /* Add 1/2 Memlock delay */
120 /* val += Pass1MemClkDly; */
121 val += 0x5; /* NOTE: middle value with DQSRCVEN_SAVED_GOOD_TIMES */
124 pDCTstat->DimmTrainFail &= ~(1<<(Receiver + Channel));