get rid of even more fam10 and k8 warnings.
[coreboot.git] / src / northbridge / amd / amdmct / mct / mctsrc1p.c
1 /*
2  * This file is part of the coreboot project.
3  *
4  * Copyright (C) 2007 Advanced Micro Devices, Inc.
5  *
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; version 2 of the License.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
18  */
19
20
21 u8 mct_checkNumberOfDqsRcvEn_1Pass(u8 pass)
22 {
23         u8 ret = 1;
24         if (pass == SecondPass)
25                 ret = 0;
26
27         return ret;
28 }
29
30
31 u32 SetupDqsPattern_1PassA(u8 pass)
32 {
33         return (u32) TestPattern1_D;
34 }
35
36
37 u32 SetupDqsPattern_1PassB(u8 pass)
38 {
39         return (u32) TestPattern0_D;
40 }
41
42 u8  mct_Get_Start_RcvrEnDly_1Pass(u8 pass)
43 {
44         return 0;
45 }
46
47 static u8 mct_Average_RcvrEnDly_1Pass(struct DCTStatStruc *pDCTstat, u8 Channel, u8 Receiver,
48                                         u8 Pass)
49 {
50         u8 i, MaxValue;
51         u8 *p;
52         u8 val;
53
54         MaxValue = 0;
55         p = pDCTstat->CH_D_B_RCVRDLY[Channel][Receiver >> 1];
56
57         for(i=0; i < 8; i++) {
58                 /* get left value from DCTStatStruc.CHA_D0_B0_RCVRDLY*/
59                 val = p[i];
60                 /* get right value from DCTStatStruc.CHA_D0_B0_RCVRDLY_1*/
61                 val += Pass1MemClkDly;
62                 /* write back the value to stack */
63                 if (val > MaxValue)
64                         MaxValue = val;
65
66                 p[i] = val;
67         }
68 //      pDCTstat->DimmTrainFail &= ~(1<<Receiver+Channel);
69
70         return MaxValue;
71 }
72
73 #ifdef UNUSED_CODE
74 static u8 mct_AdjustFinalDQSRcvValue_1Pass(u8 val_1p, u8 val_2p)
75 {
76         return (val_1p & 0xff) + ((val_2p & 0xff)<<8);
77 }
78 #endif
79
80 u8 mct_SaveRcvEnDly_D_1Pass(struct DCTStatStruc *pDCTstat, u8 pass)
81 {
82         u8 ret;
83         ret = 0;
84         if((pDCTstat->DqsRcvEn_Pass == 0xff) && (pass== FirstPass))
85                 ret = 2;
86         return ret;
87 }
88
89 u8 mct_Average_RcvrEnDly_Pass(struct DCTStatStruc *pDCTstat,
90                                 u8 RcvrEnDly, u8 RcvrEnDlyLimit,
91                                 u8 Channel, u8 Receiver, u8 Pass)
92
93 {
94         return mct_Average_RcvrEnDly_1Pass(pDCTstat, Channel, Receiver, Pass);
95 }