Changeset 3585

Show
Ignore:
Timestamp:
09/19/08 22:16:25 (2 months ago)
Author:
mjones
Message:

Add AMD K8 S1G1 socket support.

Signed-off-by: Michael Xie Michael.Xie@…
Acked-by: Ronald G. Minnich <rminnich@…>

Location:
trunk/coreboot-v2/src
Files:
4 added
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/coreboot-v2/src/northbridge/amd/amdk8/raminit_f.c

    r2682 r3585  
    1 /*      This should be done by Eric 
    2         2004.11 yhlu add 4 rank DIMM support 
    3         2004.12 yhlu add D0 support 
    4         2005.02 yhlu add E0 memory hole support 
    5         2005.10 yhlu make it support DDR2 only 
     1/* 
     2 * This file is part of the coreboot project. 
     3 * 
     4 * Copyright (C) 2002 Linux Networx 
     5 * (Written by Eric Biederman <ebiederman@lnxi.com> for Linux Networx) 
     6 * Copyright (C) 2004 YingHai Lu 
     7 * Copyright (C) 2008 Advanced Micro Devices, Inc. 
     8 * 
     9 * This program is free software; you can redistribute it and/or modify 
     10 * it under the terms of the GNU General Public License as published by 
     11 * the Free Software Foundation; version 2 of the License. 
     12 * 
     13 * This program is distributed in the hope that it will be useful, 
     14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
     15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
     16 * GNU General Public License for more details. 
     17 * 
     18 * You should have received a copy of the GNU General Public License 
     19 * along with this program; if not, write to the Free Software 
     20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA 
    621*/ 
    722 
     
    820835#if CPU_SOCKET_TYPE == 0x10 /* L1 */ 
    821836                ClkDis0 = DTL_MemClkDis0; 
    822 #else  
    823         #if CPU_SOCKET_TYPE == 0x11 /* AM2 */ 
     837#elif CPU_SOCKET_TYPE == 0x11 /* AM2 */ 
    824838                ClkDis0 = DTL_MemClkDis0_AM2; 
    825         #endif 
     839#elif CPU_SOCKET_TYPE == 0x12   /* S1G1 */ 
     840                ClkDis0 = DTL_MemClkDis0_S1g1; 
    826841#endif  
    827842 
     
    20542069 
    20552070        }        
    2056         dcl = pci_read_config32(ctrl->f2, DRAM_CONFIG_LOW); 
    2057         dcl &= ~(DCL_DramTerm_MASK<<DCL_DramTerm_SHIFT); 
    2058         dcl |= (odt & DCL_DramTerm_MASK) << (DCL_DramTerm_SHIFT); 
    2059         pci_write_config32(ctrl->f2, DRAM_CONFIG_LOW, dcl); 
     2071 
     2072 
     2073#if DIMM_SUPPORT == 0x0204 
     2074        odt = 0x2;              /* 150 ohms */ 
     2075#endif 
     2076 
     2077    dcl = pci_read_config32(ctrl->f2, DRAM_CONFIG_LOW); 
     2078    dcl &= ~(DCL_DramTerm_MASK<<DCL_DramTerm_SHIFT); 
     2079    dcl |= (odt & DCL_DramTerm_MASK) << (DCL_DramTerm_SHIFT); 
     2080    pci_write_config32(ctrl->f2, DRAM_CONFIG_LOW, dcl); 
    20602081} 
    20612082 
     
    22362257        } 
    22372258 
     2259#endif 
     2260 
     2261#if DIMM_SUPPORT==0x0204        /* DDR2 and SO-DIMM, S1G1 */ 
     2262        dword = 0x00111222; 
     2263        dwordx = 0x002F2F00; 
     2264 
     2265        switch (meminfo->memclk_set) { 
     2266        case DCH_MemClkFreq_200MHz:     /* nothing to be set here */ 
     2267                break; 
     2268        case DCH_MemClkFreq_266MHz: 
     2269                if ((meminfo->single_rank_mask == 0) 
     2270                    && (meminfo->x4_mask == 0) && (meminfo->x16_mask)) 
     2271                        dwordx = 0x002C2C00;    /* Double rank x8 */ 
     2272                /* else SRx16, SRx8, DRx16 == 0x002F2F00 */ 
     2273                break; 
     2274        case DCH_MemClkFreq_333MHz: 
     2275                if ((meminfo->single_rank_mask == 1) 
     2276                   && (meminfo->x16_mask == 1)) /* SR x16 */ 
     2277                        dwordx = 0x00272700; 
     2278                else if ((meminfo->x4_mask == 0) && (meminfo->x16_mask == 0) 
     2279                         && (meminfo->single_rank_mask == 0)) { /* DR x8 */ 
     2280                        SlowAccessMode = 1; 
     2281                        dwordx = 0x00002800; 
     2282                } else {        /* SR x8, DR x16 */ 
     2283                        dwordx = 0x002A2A00; 
     2284                } 
     2285                break; 
     2286        case DCH_MemClkFreq_400MHz: 
     2287                if ((meminfo->single_rank_mask == 1) 
     2288                   && (meminfo->x16_mask == 1)) /* SR x16 */ 
     2289                        dwordx = 0x00292900; 
     2290                else if ((meminfo->x4_mask == 0) && (meminfo->x16_mask == 0) 
     2291                         && (meminfo->single_rank_mask == 0)) { /* DR x8 */ 
     2292                        SlowAccessMode = 1; 
     2293                        dwordx = 0x00002A00; 
     2294                } else {        /* SR x8, DR x16 */ 
     2295                        dwordx = 0x002A2A00; 
     2296                } 
     2297                break; 
     2298        } 
    22382299#endif 
    22392300