diff options
| -rw-r--r-- | arch/x86/kernel/cpu/cpufreq/powernow-k8.c | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/arch/x86/kernel/cpu/cpufreq/powernow-k8.c b/arch/x86/kernel/cpu/cpufreq/powernow-k8.c index feef10c085a1..f6b32d112357 100644 --- a/arch/x86/kernel/cpu/cpufreq/powernow-k8.c +++ b/arch/x86/kernel/cpu/cpufreq/powernow-k8.c | |||
| @@ -649,6 +649,20 @@ static void print_basics(struct powernow_k8_data *data) | |||
| 649 | data->batps); | 649 | data->batps); |
| 650 | } | 650 | } |
| 651 | 651 | ||
| 652 | static u32 freq_from_fid_did(u32 fid, u32 did) | ||
| 653 | { | ||
| 654 | u32 mhz = 0; | ||
| 655 | |||
| 656 | if (boot_cpu_data.x86 == 0x10) | ||
| 657 | mhz = (100 * (fid + 0x10)) >> did; | ||
| 658 | else if (boot_cpu_data.x86 == 0x11) | ||
| 659 | mhz = (100 * (fid + 8)) >> did; | ||
| 660 | else | ||
| 661 | BUG(); | ||
| 662 | |||
| 663 | return mhz * 1000; | ||
| 664 | } | ||
| 665 | |||
| 652 | static int fill_powernow_table(struct powernow_k8_data *data, | 666 | static int fill_powernow_table(struct powernow_k8_data *data, |
| 653 | struct pst_s *pst, u8 maxvid) | 667 | struct pst_s *pst, u8 maxvid) |
| 654 | { | 668 | { |
| @@ -923,8 +937,13 @@ static int fill_powernow_table_pstate(struct powernow_k8_data *data, | |||
| 923 | 937 | ||
| 924 | powernow_table[i].index = index; | 938 | powernow_table[i].index = index; |
| 925 | 939 | ||
| 926 | powernow_table[i].frequency = | 940 | /* Frequency may be rounded for these */ |
| 927 | data->acpi_data.states[i].core_frequency * 1000; | 941 | if (boot_cpu_data.x86 == 0x10 || boot_cpu_data.x86 == 0x11) { |
| 942 | powernow_table[i].frequency = | ||
| 943 | freq_from_fid_did(lo & 0x3f, (lo >> 6) & 7); | ||
| 944 | } else | ||
| 945 | powernow_table[i].frequency = | ||
| 946 | data->acpi_data.states[i].core_frequency * 1000; | ||
| 928 | } | 947 | } |
| 929 | return 0; | 948 | return 0; |
| 930 | } | 949 | } |
