2 * This file is part of the coreboot project.
4 * Copyright (C) 2006 Indrek Kruusa <indrek.kruusa@artecdesign.ee>
5 * Copyright (C) 2006 Ronald G. Minnich <rminnich@gmail.com>
6 * Copyright (C) 2007 Advanced Micro Devices, Inc.
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
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.
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
23 #include <console/console.h>
26 #include <device/device.h>
30 #include <cpu/x86/msr.h>
31 #include <cpu/amd/lxdef.h>
33 /**************************************************************************
37 * Bugtool #465 and #609
39 * There is also fix code in cache and PCI functions. This bug is very is pervasive.
41 **************************************************************************/
42 static void pcideadlock(void)
47 * forces serialization of all load misses. Setting this bit prevents the
48 * DM pipe from backing up if a read request has to be held up waiting
49 * for PCI writes to complete.
51 msr = rdmsr(CPU_DM_CONFIG0);
52 msr.lo |= DM_CONFIG0_LOWER_MISSER_SET;
53 wrmsr(CPU_DM_CONFIG0, msr);
55 /* write serialize memory hole to PCI. Need to unWS when something is
56 * shadowed regardless of cachablility.
60 wrmsr(CPU_RCONF_A0_BF, msr);
61 wrmsr(CPU_RCONF_C0_DF, msr);
62 wrmsr(CPU_RCONF_E0_FF, msr);
65 /****************************************************************************/
67 /** DisableMemoryReorder*/
70 /** The MC reordered transactions incorrectly and breaks coherency.*/
71 /** Disable reording and take a potential performance hit.*/
72 /** This is safe to do here and not in MC init since there is nothing*/
73 /** to maintain coherency with and the cache is not enabled yet.*/
75 /****************************************************************************/
76 static void disablememoryreadorder(void)
80 msr = rdmsr(MC_CF8F_DATA);
81 msr.hi |= CF8F_UPPER_REORDER_DIS_SET;
82 wrmsr(MC_CF8F_DATA, msr);
85 /* For cpu version C3. Should be the only released version */
89 disablememoryreadorder();
90 printk(BIOS_DEBUG, "Done cpubug fixes \n");