Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 145291
b: refs/heads/master
c: ca446d0
h: refs/heads/master
i:
  145289: 4fcc32e
  145287: 6dc8283
v: v3
  • Loading branch information
Andreas Herrmann authored and Dave Jones committed May 26, 2009
1 parent 01281d4 commit 82324b4
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: df1829770db415dc5a5ed5ada3bd70176c6f0a01
refs/heads/master: ca446d06351992e4f1a7c1e5e99870ab4ec5188f
23 changes: 21 additions & 2 deletions trunk/arch/x86/kernel/cpu/cpufreq/powernow-k8.c
Original file line number Diff line number Diff line change
Expand Up @@ -649,6 +649,20 @@ static void print_basics(struct powernow_k8_data *data)
data->batps);
}

static u32 freq_from_fid_did(u32 fid, u32 did)
{
u32 mhz = 0;

if (boot_cpu_data.x86 == 0x10)
mhz = (100 * (fid + 0x10)) >> did;
else if (boot_cpu_data.x86 == 0x11)
mhz = (100 * (fid + 8)) >> did;
else
BUG();

return mhz * 1000;
}

static int fill_powernow_table(struct powernow_k8_data *data,
struct pst_s *pst, u8 maxvid)
{
Expand Down Expand Up @@ -923,8 +937,13 @@ static int fill_powernow_table_pstate(struct powernow_k8_data *data,

powernow_table[i].index = index;

powernow_table[i].frequency =
data->acpi_data.states[i].core_frequency * 1000;
/* Frequency may be rounded for these */
if (boot_cpu_data.x86 == 0x10 || boot_cpu_data.x86 == 0x11) {
powernow_table[i].frequency =
freq_from_fid_did(lo & 0x3f, (lo >> 6) & 7);
} else
powernow_table[i].frequency =
data->acpi_data.states[i].core_frequency * 1000;
}
return 0;
}
Expand Down

0 comments on commit 82324b4

Please sign in to comment.