diff options
author | Gordon Willem Klok <gwk@cvs.openbsd.org> | 2006-09-29 21:09:26 +0000 |
---|---|---|
committer | Gordon Willem Klok <gwk@cvs.openbsd.org> | 2006-09-29 21:09:26 +0000 |
commit | c95b28bc58061d7bf1c582055511d08dc170cf7b (patch) | |
tree | bc13a13fadc28068d6473fd48d565ef02d3b3a12 /sys | |
parent | 45891e1595258793ffd3dbfddb1e1d86d1b65b75 (diff) |
If we don't find a matching CPU signature using the base CPUID call, try
matching against the extended CPUID (0x80000001) signature. Problem
found by, and patch based on work by jason@.
ok jason@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/i386/i386/powernow-k7.c | 48 |
1 files changed, 27 insertions, 21 deletions
diff --git a/sys/arch/i386/i386/powernow-k7.c b/sys/arch/i386/i386/powernow-k7.c index 491ac1c6425..76b920ef419 100644 --- a/sys/arch/i386/i386/powernow-k7.c +++ b/sys/arch/i386/i386/powernow-k7.c @@ -1,4 +1,4 @@ -/* $OpenBSD: powernow-k7.c,v 1.25 2006/09/25 22:28:11 gwk Exp $ */ +/* $OpenBSD: powernow-k7.c,v 1.26 2006/09/29 21:09:25 gwk Exp $ */ /* * Copyright (c) 2004 Martin Végiard. @@ -133,7 +133,8 @@ extern int setperf_prio; * Prototypes */ int k7pnow_decode_pst(struct k7pnow_cpu_state *, uint8_t *, int); -int k7pnow_states(struct k7pnow_cpu_state *, uint32_t, unsigned int, unsigned int); +int k7pnow_states(struct k7pnow_cpu_state *, uint32_t, unsigned int, + unsigned int); int k7_powernow_setperf(int level) @@ -311,11 +312,14 @@ k7_powernow_init(void) if (!(regs[3] & AMD_PN_FID_VID)) return; + /* Extended CPUID signature value */ + cpuid(0x80000001, regs); + cstate = malloc(sizeof(struct k7pnow_cpu_state), M_DEVBUF, M_NOWAIT); if (!cstate) return; - cstate->flags = 0; + cstate->flags = cstate->n_states = 0; if (ci->ci_signature == AMD_ERRATA_A0_CPUSIG) cstate->flags |= PN7_FLAG_ERRATA_A0; @@ -325,25 +329,27 @@ k7_powernow_init(void) currentfid = PN7_STA_CFID(status); cstate->fsb = pentium_mhz / (k7pnow_fid_to_mult[currentfid]/10); - if (k7pnow_states(cstate, ci->ci_signature, maxfid, startvid)) { - if (cstate->n_states) { - if (cstate->flags & PN7_FLAG_DESKTOP_VRM) - techname = "Cool`n'Quiet K7"; - else - techname = "Powernow! K7"; - printf("%s: %s %d Mhz: speeds:", - ci->ci_dev.dv_xname, techname, pentium_mhz); - for (i = cstate->n_states; i > 0; i--) { - state = &cstate->state_table[i-1]; - printf(" %d", state->freq); - } - printf(" Mhz\n"); - - k7pnow_current_state = cstate; - cpu_setperf = k7_powernow_setperf; - setperf_prio = 1; - return; + + /* if the base CPUID signature fails to match try, the extended one */ + if (!k7pnow_states(cstate, ci->ci_signature, maxfid, startvid)) + k7pnow_states(cstate, regs[0], maxfid, startvid); + if (cstate->n_states) { + if (cstate->flags & PN7_FLAG_DESKTOP_VRM) + techname = "Cool`n'Quiet K7"; + else + techname = "Powernow! K7"; + printf("%s: %s %d Mhz: speeds:", + ci->ci_dev.dv_xname, techname, pentium_mhz); + for (i = cstate->n_states; i > 0; i--) { + state = &cstate->state_table[i-1]; + printf(" %d", state->freq); } + printf(" Mhz\n"); + + k7pnow_current_state = cstate; + cpu_setperf = k7_powernow_setperf; + setperf_prio = 1; + return; } free(cstate, M_DEVBUF); } |