So now I will remember to attach the patch. Dan Lykowski
Signed-off-by: Dan Lykowski <lyko...@gmail.com> --- On Wed, 1/14/09, Dan Lykowski <engineerguy3...@yahoo.com> wrote: From: Dan Lykowski <engineerguy3...@yahoo.com> Subject: [coreboot] [PATCH] fixes ram init when processor doesn't have FID control To: coreboot@coreboot.org Date: Wednesday, January 14, 2009, 9:13 PM 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. This patch includes the changes I submitted a few days ago that haven't been acked yet. I now have a working Coreboot system. ( Although SATA needs a little work so I am not booting linux yet. ) But at least FILO comes up. Dan Lykowski Signed-off-by: Dan Lykowski <lyko...@gmail.com> -----Inline Attachment Follows----- -- coreboot mailing list: coreboot@coreboot.org http://www.coreboot.org/mailman/listinfo/coreboot
Index: src/northbridge/amd/amdk8/raminit_f.c =================================================================== --- src/northbridge/amd/amdk8/raminit_f.c (revision 3860) +++ 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; Index: src/northbridge/amd/amdk8/raminit_f_dqs.c =================================================================== --- src/northbridge/amd/amdk8/raminit_f_dqs.c (revision 3860) +++ src/northbridge/amd/amdk8/raminit_f_dqs.c (working copy) @@ -432,15 +432,28 @@ /*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]; return TT_a[index * 4+i];
-- coreboot mailing list: coreboot@coreboot.org http://www.coreboot.org/mailman/listinfo/coreboot