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; version 2 of the License.
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.
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
20 static u32 mct_MR1Odt_RDimm(struct MCTStatStruc *pMCTstat,
21 struct DCTStatStruc *pDCTstat, u8 dct, u32 MrsChipSel)
23 u8 Speed = pDCTstat->Speed;
25 u8 DimmsInstalled, DimmNum, ChipSelect;
27 ChipSelect = (MrsChipSel >> 20) & 0xF;
28 DimmNum = ChipSelect & 0xFE;
29 DimmsInstalled = pDCTstat->MAdimms[dct];
34 if (mctGet_NVbits(NV_MAX_DIMMS) == 4) {
35 if (DimmsInstalled == 1)
38 if (pDCTstat->CSPresent & 0xF0) {
39 if (pDCTstat->DimmQRPresent & (1 << DimmNum)) {
40 if (!(ChipSelect & 1))
51 } else if (DimmsInstalled == 1)
62 static u32 mct_DramTermDyn_RDimm(struct MCTStatStruc *pMCTstat,
63 struct DCTStatStruc *pDCTstat, u8 dimm)
65 u8 DimmsInstalled = dimm;
67 u8 Speed = pDCTstat->Speed;
69 if (mctGet_NVbits(NV_MAX_DIMMS) == 4) {
70 if (pDCTstat->CSPresent & 0xF0) {
71 if (DimmsInstalled == 1)
73 DramTermDyn |= 1 << 10;
75 DramTermDyn |= 1 << 11;
78 DramTermDyn |= 1 << 11;
80 DramTermDyn |= 1 << 10;
82 if (DimmsInstalled != 1) {
84 DramTermDyn |= 1 << 10;
86 DramTermDyn |= 1 << 11;
90 if (DimmsInstalled != 1)
91 DramTermDyn |= 1 << 11;