Subject: NetBSD support for AMD PowerNow
To: None <port-i386@netbsd.org>
From: Rumi Szabolcs <rumi@rtfm.hu>
List: port-i386
Date: 01/16/2005 20:45:58
Hello!

I have reviewed the patch proposed by Martin Vegiard to support
the AMD PowerNow! CPU frequency scaling technology and I have
added support for CPUID-based detection of CPU support, fixed some
minor problems, and altered the kernel messages output by the code.

Here are the results:

CVS diff of my changes against netbsd-current (as of 01.16.2005):
http://quasar.dynaweb.hu/~rumi/powernow/powernow_050116.diff

The original patch by Martin Vegiard against 2.0G:
http://quasar.dynaweb.hu/~rumi/powernow/powernow_k7-vegiard.patch

A quick'n'dirty patch against estd-r3 to support PowerNow:
http://quasar.dynaweb.hu/~rumi/powernow/estd_powernow.patch

The estd tarball can be found at (not in pkgsrc, dunno why):
http://www.elektro-eel.org/estd-netbsd.html

Related PR numbers: 26239, 26423

There are two strange issues:

1.) Some braindead BIOSes (for Acer/ALi chipsets as it seems)
report CPU signatures that start at 0x700, and this will never
match the actual signatures because as far as I could tell, the
'7' would stand there for the CPU Family which is actually 6 for
the Athlon (K7) series. This means that for my Athlon XP-M,
the signature 0x781 is expected by the BIOS list, but the CPU
correctly returns 0x681. These do not match and with the Vegiard
patch this produces an error so I have added a hack for it in
my code.

2.) These BIOSes also seem to supply a bogus/incomplete frequency
list. In my case the machine has an Athlon XP-M 2000+ CPU which
operates at a maximum of 1666MHz but the frequency list only
contains values up to 1396Mhz. All supplied values work, but
the CPU cannot be set to it's maximum frequency by PowerNow,
only up to 1396Mhz. Maybe the manufacturers try to solve thermal
design issues this way?

Any comments?

Regards,

Szabolcs