Subject: port-i386/26239: NetBSD/i386 has no support for AMD's POWERNOW function on K7 CPUs.
To: None <gnats-bugs@gnats.NetBSD.org>
From: None <deadbug@gmail.com>
List: netbsd-bugs
Date: 07/11/2004 05:06:24
>Number:         26239
>Category:       port-i386
>Synopsis:       NetBSD/i386 has no support for AMD's POWERNOW  function on K7 CPUs.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    port-i386-maintainer
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Sun Jul 11 07:31:00 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator:     Martin Végiard
>Release:        NetBSD 2.0G
>Organization:
-
>Environment:
NetBSD deadbug 2.0G NetBSD 2.0G (POWERNOW) #96: Sat Jul 10 20:01:00 EDT 2004 root@deadbug:/usr/src/sys/arch/i386/compile/POWERNOW i386
>Description:
Notebooks with AMD Athlon CPU's running NetBSD do not benefit of any advantages of AMD's POWERNOW technology that enables CPU frequency scaling. 
Advantages :
=> Longer battery life
=> Allows the processor to dissipate less heat under normal operating conditions, providing a cooler and quieter-running notebook

(http://www.amd.com/us-en/Processors/ProductInformation/0,,30_118_10220_10221%5E964,00.html)

>How-To-Repeat:
-
>Fix:
My post to port-i386@netbsd.org:

http://news.gw.com/netbsd.ports.i386/32510

http://news.gw.com/netbsd.ports.i386/32510/1/powernow_k7.patch

=====================================================================
Hi,

I have written a driver for AMD's POWERNOW function on K7 CPUs. It
enables CPU frequency scaling which allows laptops with AMD K7 CPUs to
have longer battery life and stay cool.

http://www.amd.com/us-en/Processors/ProductInformation/0,,30_118_10220_10221%5E964,00.html

I have made it compatible to i386/est.c (Intel SpeedStep) sysctl's interface.

example :

# sysctl machdep.powernow.
machdep.powernow.frequency.target = 1795
machdep.powernow.frequency.current = 1795
machdep.powernow.frequency.available = 532 665 798 931 1330 1795

# sysctl -w machdep.powernow.frequency.target=532
machdep.powernow.frequency.target: 1795 -> 532

I have included patches to make this driver work with NetBSD 2.0G,
make sure you add "options POWERNOW_K7" in your kernel configuration
file.

Todo:
- Multiprocessor support?
- line 181 of pnow_k7.c (cpuid == 0x?60 .. ignored for now)
....

Enjoy 

Martin Végiard
>Release-Note:
>Audit-Trail:
>Unformatted: