Chameleon

Chameleon Commit Details

Date:2011-01-10 23:03:37 (13 years 3 months ago)
Author:valv
Commit:702
Parents: 701
Message:bug-fix: AMD instant reboot; omitting wrong section for now
Changes:
M/branches/valv/i386/libsaio/cpu.c
M/branches/valv/revision

File differences

branches/valv/i386/libsaio/cpu.c
717717
718718
719719
720
721
720722
721723
722724
723725
724
725
726
727
726728
727729
728730
729731
730
731
732
733
732734
733
735
736
734737
735738
736739
737740
738741
739
742
740743
741744
742745
743746
744747
745748
746
749
747750
748751
749752
}
else if(p->CPU.ExtFamily >= 0x01 /* K10+ */)
{
msr = rdmsr64(K10_COFVID_STATUS);
currdiv = (2 << ((msr >> 6) & 0x07)) / 2;
msr = rdmsr64(AMD_10H_11H_CONFIG);
if(p->CPU.ExtFamily == 0x01 /* K10 */)
{
bus_ratio_max = ((msr) & 0x3F);
currdiv = (((msr) >> 6) & 0x07);
cpuFrequency = 100 * (bus_ratio_max + 0x08) / (1 << currdiv);
//currdiv = (((msr) >> 6) & 0x07);
//cpuFrequency = 100 * (bus_ratio_max + 0x08) / (1 << currdiv);
}
else /* K11+ */
{
bus_ratio_max = ((msr) & 0x3F);
currdiv = (((msr) >> 6) & 0x07);
cpuFrequency = 100 * (bus_ratio_max + 0x10) / (1 << currdiv);
//currdiv = (((msr) >> 6) & 0x07);
//cpuFrequency = 100 * (bus_ratio_max + 0x10) / (1 << currdiv);
}
fsbFrequency = (cpuFrequency / bus_ratio_max);
fsbFrequency = (tscFrequency / bus_ratio_max);
cpuFrequency = tscFrequency;
}
p->CPU.MaxRatio = bus_ratio_max * 10;
// valv: to be moved to acpi_patcher when ready
msr_t amsr = rdmsr(K8_FIDVID_STATUS);
/*msr_t amsr = rdmsr(K8_FIDVID_STATUS);
uint8_t max_fid = (amsr.lo & 0x3F) >> 16;
uint8_t min_fid = (amsr.lo & 0x3F) >> 8;
uint8_t max_vid = (amsr.hi & 0x3F) >> 16;
uint8_t min_vid = (amsr.hi & 0x3F) >> 8;
verbose("AMD: max[fid: %d, vid: %d] min[fid: %d, vid: %d]\n", max_fid, max_vid, min_fid, min_vid);
/*
case 0x10:// phenom
msr = rdmsr64(AMD_10H_11H_CONFIG);
bus_ratio_max = ((msr) & 0x3F);
branches/valv/revision
1
1
665:698
665:701

Archive Download the corresponding diff file

Revision: 702