summaryrefslogtreecommitdiff
path: root/src/northbridge
diff options
context:
space:
mode:
authorDan Lykowski <lykowdk@gmail.com>2009-01-15 02:21:27 +0000
committerPeter Stuge <peter@stuge.se>2009-01-15 02:21:27 +0000
commit0f502c7537707c82e4cea124df53eb76a3ddd807 (patch)
treea2794ea6f0148072b40b53fc28d0e9a21d4b92b1 /src/northbridge
parent884e1cbeebeefa2d38f95339545781a8c503a46d (diff)
downloadcoreboot-0f502c7537707c82e4cea124df53eb76a3ddd807.tar.xz
amdk8: This patch fixes ram init problems when using the 9W Sempron part.
Trying to read the FIDVID register when the processor does not support FIDVID control causes a GP Fault. This patch reads the startup FID from a different MSR. I have verified this patch to work on the dbm690t platform. Signed-off-by: Dan Lykowski <lykowdk@gmail.com> Acked-by: Peter Stuge <peter@stuge.se> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3863 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'src/northbridge')
-rw-r--r--src/northbridge/amd/amdk8/raminit_f.c24
-rw-r--r--src/northbridge/amd/amdk8/raminit_f_dqs.c23
2 files changed, 37 insertions, 10 deletions
diff --git a/src/northbridge/amd/amdk8/raminit_f.c b/src/northbridge/amd/amdk8/raminit_f.c
index a883fa401d..0dcb0f6821 100644
--- a/src/northbridge/amd/amdk8/raminit_f.c
+++ b/src/northbridge/amd/amdk8/raminit_f.c
@@ -1656,14 +1656,28 @@ static uint8_t get_exact_divisor(int i, uint8_t divisor)
/*15*/ 200, 160, 120, 100,
};
- unsigned fid_cur;
+
int index;
-
msr_t msr;
- msr = rdmsr(0xc0010042);
- fid_cur = msr.lo & 0x3f;
- index = fid_cur>>1;
+ /* Check for FID control support */
+ struct cpuid_result cpuid1;
+ cpuid1 = cpuid(0x8000007);
+ if( cpuid1.edx & 0x02 ) {
+ /* Use current FID */
+ unsigned fid_cur;
+ msr = rdmsr(0xc0010042);
+ fid_cur = msr.lo & 0x3f;
+
+ index = fid_cur>>1;
+ } else {
+ /* Use startup FID */
+ unsigned fid_start;
+ msr = rdmsr(0xc0010015);
+ fid_start = (msr.lo & (0x3f << 24));
+
+ index = fid_start>>25;
+ }
if (index>12) return divisor;
diff --git a/src/northbridge/amd/amdk8/raminit_f_dqs.c b/src/northbridge/amd/amdk8/raminit_f_dqs.c
index e8add87a7e..dc49d4e893 100644
--- a/src/northbridge/amd/amdk8/raminit_f_dqs.c
+++ b/src/northbridge/amd/amdk8/raminit_f_dqs.c
@@ -432,14 +432,27 @@ static uint16_t get_exact_T1000(unsigned i)
/*15*/ 5000, 4000, 3000, 2500,
};
- unsigned fid_cur;
int index;
-
msr_t msr;
- msr = rdmsr(0xc0010042);
- fid_cur = msr.lo & 0x3f;
- index = fid_cur>>1;
+ /* Check for FID control support */
+ struct cpuid_result cpuid1;
+ cpuid1 = cpuid(0x8000007);
+ if( cpuid1.edx & 0x02 ) {
+ /* Use current FID */
+ unsigned fid_cur;
+ msr = rdmsr(0xc0010042);
+ fid_cur = msr.lo & 0x3f;
+
+ index = fid_cur>>1;
+ } else {
+ /* Use startup FID */
+ unsigned fid_start;
+ msr = rdmsr(0xc0010015);
+ fid_start = (msr.lo & (0x3f << 24));
+
+ index = fid_start>>25;
+ }
if(index>12) return T1000_a[i];