Added FID check in raminit_f.c.
Same problem that was fixed by my last patch just in a different location.
Trying to read MSR(0xC0010042) causes a GP fault on a processor that does not
support changing FIDVID.
I believe that if the FID support check fails the startup FID should be used.
It can be read from MSR(0xC0010015).
Thanks,
Dan Lykowski
Signed-off-by: Dan Lykowski <[email protected]>
---
Index: src/northbridge/amd/amdk8/raminit_f.c
===================================================================
--- src/northbridge/amd/amdk8/raminit_f.c (revision 3855)
+++ src/northbridge/amd/amdk8/raminit_f.c (working copy)
@@ -1656,15 +1656,29 @@
/*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;
if (i>3) return divisor;
--
coreboot mailing list: [email protected]
http://www.coreboot.org/mailman/listinfo/coreboot