2 * This file is part of the LinuxBIOS project.
4 * Copyright (C) 2007 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
21 static const u8 Tab_GRCLKDis[] = { 8,0,8,8,0,0,8,0 };
24 u32 mct_AdjustMemClkDis_GR(struct DCTStatStruc *pDCTstat, u32 dct,
27 /* Greayhound format -> Griffin format */
29 u32 dev = pDCTstat->dev_dct;
31 u32 reg_off = 0x100 * dct;
36 /* Dram Timing Low (owns Clock Enable bits) */
37 NewDramTimingLo = Get_NB32(dev, 0x88 + reg_off);
38 if(mctGet_NVbits(NV_AllMemClks)==0) {
39 /*Special Jedec SPD diagnostic bit - "enable all clocks"*/
40 if(!(pDCTstat->Status & (1<<SB_DiagClks))) {
41 for(i=0; i<MAX_DIMMS_SUPPORTED; i++) {
42 val = Tab_GRCLKDis[i];
44 if(!(pDCTstat->DIMMValidDCT[dct] & (1<<val))) {
46 NewDramTimingLo |= (1<<(i+1));
52 DramTimingLo &= ~(0xff<<24);
53 DramTimingLo |= NewDramTimingLo & (0xff<<24);
54 DramTimingLo &= (0x4d<<24); /* FIXME - enable all MemClks for now */
60 u32 mct_AdjustDramConfigLo_GR(struct DCTStatStruc *pDCTstat, u32 dct, u32 val)
62 /* Greayhound format -> Griffin format */
63 /*FIXME - BurstLength32 must be 0 when F3x44[DramEccEn]=1. */
65 ; mov cx,PA_NBMISC+44h ;MCA NB Configuration
69 ; btr eax,BurstLength32
76 void mct_AdjustMemHoist_GR(struct DCTStatStruc *pDCTstat, u32 base, u32 HoleSize)
79 if(base >= pDCTstat->DCTHoleBase) {
80 u32 dev = pDCTstat->dev_dct;
83 val = Get_NB32(dev, 0x110);
85 val |= (base & 0xfff)<<11;
86 Set_NB32(dev, 0x110, val);