summaryrefslogtreecommitdiff
path: root/src/cpu/amd/mtrr
diff options
context:
space:
mode:
authorYinghai Lu <yinghailu@gmail.com>2005-12-14 20:16:49 +0000
committerYinghai Lu <yinghailu@gmail.com>2005-12-14 20:16:49 +0000
commit30576601f6d29a72d5057ac0051ebe3479abc03c (patch)
treebc2a673d488c2993d619c1ab91ede0385617171f /src/cpu/amd/mtrr
parent6f63c0297c3e3f31674dbbf193635921b5c20e15 (diff)
from issue 53: don't set TOM2 if 4G less mem installed, opt for init_ecc
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@2144 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'src/cpu/amd/mtrr')
-rw-r--r--src/cpu/amd/mtrr/amd_mtrr.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/cpu/amd/mtrr/amd_mtrr.c b/src/cpu/amd/mtrr/amd_mtrr.c
index e57bb3bec7..b422f9f425 100644
--- a/src/cpu/amd/mtrr/amd_mtrr.c
+++ b/src/cpu/amd/mtrr/amd_mtrr.c
@@ -149,10 +149,12 @@ void amd_setup_mtrrs(void)
msr.lo = state.mmio_basek << 10;
wrmsr(TOP_MEM, msr);
- /* Setup TOP_MEM2 */
- msr.hi = state.tomk >> 22;
- msr.lo = state.tomk << 10;
- wrmsr(TOP_MEM2, msr);
+ if(state.tomk>(4*1024*1024)) {
+ /* Setup TOP_MEM2 */
+ msr.hi = state.tomk >> 22;
+ msr.lo = state.tomk << 10;
+ wrmsr(TOP_MEM2, msr);
+ }
/* zero the IORR's before we enable to prevent
* undefined side effects.