Frequency changing is done via FSB control. This works good because the PCI/AGP-clock is controlled independently. RAM/FSB are synchronized. Mostly the RAM is the limiting factor.

Some maybe think why not change the FID (multiplier) like the Athlon Mobile (there are L-bridge mods to change a XP to a Mobile [1]). With some chipsets this is possible and there
are patches for powernow-k7 to work on desktop boards. Unfortunately I've not heard yet that this works with the nForce2 chipset.

So now lets begin:

1. Get the cpufreq/atxp1 module working :
Kernel 2.6.10 includes cpufreq-nforce2, but you can also
get it from http://www.hasw.net/linux

3. Find the minimum FSB (optional)
Because of some internal chipset timings, the FSB is limited downwards. If no module
option is given, the minimum FSB defaults to FSB at boot time - 50 MHz which should
work in the most cases.
If you want to set a lower FSB limit, use the min_fsb module option:

Code:

root@hasw cpufreq # modprobe cpufreq-nforce2 min_fsb=140

On the most boards, the limit is between 130 and 140 MHz. To be on the save side, use 140 instead of 133.
For the Shuttle AN35N you can try to lower it < 100 MHz, they've the greatest working FSB range (some 60-240 MHz).

Get prime95 from http://www.mersenne.org/freesoft.htm for stress testing. It works good for me because the torture test stops when the CPU produces calculation errors. It detects
errors even if it seems that all is working.

Stop X and all uneeded services, so that there's no/small impact if the computer crashes (you have backups, of course

Now run the prime95 torture test and lower the CPU speed every 30s approx. 100 MHz:

There's often a small positive offset, so that's normal if it shows a little bit more.

5. Find lowest core voltage for different frequencys
You can use the same mechism used to find the minimum FSB. The smallest possible steps are 25mV. Decrease the voltage until it reports errors, add 50mV and you should be on the safe (stable) side.

6. Save changes
You now have the control over your CPU speed and core voltage. Happy power-saving

Add the modules to your /etc/modules.autoload.d/kernel-2.6 file to load the at startup, mine shows:

Code:

...
cpufreq-nforce2
i2c-nforce2
i2c-isa
atxp1
w83781d

This does not work because the permissions are reset after some time.---------------------------------------------------------------------
Because the /sys files are only writeable by root, you may want to write them as user. If your user is the the group wheel you can add to your /etc/conf.d/local.start:

There are many other possibilities, including dynamic changing depending on the CPU load, etc.

This would be nice for alot of people.
Even though I have foldingathome or a compile running 24x7 I'm gonna try this to see if I Can get it working._________________Gentoo systems.
X2 4200+@2.6 - Athy
X2 3600+ - Myth
UltraSparc5 440 - sparcy

How would I apply the cpufreq-nforce2 patch? I tried using make on it , but, it ended up returning an error, I'd c opy paste it if I had a middle mouse button but it seems to complain about a cpufreq not being declared.

You have already running a 2.6 kernel version (>2.6.8, otherwise it won't work), so you should think switching to 2.6.10. If you don't want that, configure the kernel the same way mentioned above except without

Code:

<M> nVidia nForce2 FSB changing

.

Install your new kernel and reboot.
Than get the module (it isn't the kernel-patch, my mistake) and just do:

(later) Yes! atxp1 works nicely. Trying to find out how much I can undervolt at 1375MHz. Nice work, Hasw!

(even later) So I had a shock for a moment: While finding my lower bound I saw in dmesg that I cannot go below 1075V. Well I tried 1075, but ZAP my screen got black. HW reset didn't help as well. I had to "pull the plug" wait and then my machine got revived. What went wrong? 1100 works and I am finding out whether it is stable. 1,1V is the lowest setting in BIOS AFAIK, btw.

BTW, is is possible to couple fsb and vcore in kernel space? I find it a bit dangerous currently (though nice that it works at all ). It is easy to lock up the machine currently, as I found out while I was fighting with my permissions... Furthermore it is a bit risky if a user with wheel rights gets hacked...

There are two problems coupling FSB and VCore in kernel-space:
1. The FSB:VCore pairs are different between various CPUs.
2. The devices (kernel environment) is completely different.

"Problem" 1. can be solved by adding some /sys interface where the user can input these FSB, VCore combinations. But the second is a little bit more complicated I found.
The cpufreq-device is for the x86 arch and the ATXP1 is an I2C device which is platform independent. Also the kernel environments are different, writing a third module that controls both is possible, but not very nice.

Maybe adding two module options would help for the rights problem:
- Lower limit
- High limit, default: the one which was set at module loading

Reg problem 1: Of course, this is something each user has to find out on his/her own.

Reg. problem 2: Couldn't you make some sort of "slave mode" to atxp1, that it only accepts changes in vcore from kernel space and a "master mode" for the the cpufrequ driver, that it controlls a slave which connects to it? Some sort of interface is needed, which apparently doesn't exist right now...

Ok, I am having a problem with my permissions. It seems they get reseted after some time. I guess this is udev coming in between. Perhaps the best would be to let udev handle the permissions? Does anyone have a nice ruleset for it? I could be on the wrong track, as well, as I don't know whether I can manipulate /sys with udev... Otherwise I'll help myself with sudo.

Yes, I've already updated the howto. Haven't recognized it because when I experimenting with new modules I was logged in as root.

I don't think udev has something to do with it (I'm using devfsd), the sysfs is controlled by kernel and udev normally only controls /dev permissions.
I haven't found out yet why the permissions are reset (I mean, why allow setting new permissions when they are reversed after some time?)

As you have mentioned a workaround could be running a script via sudo.

Too bad, on the second thought I also had supicions about udev... Well, I could bug lkml and hope to get an answer on what would be the correct way for this...I guess the kernel has no specifiv Docs about /sys?

But perhaps they would say to use an userspace prog, like speedfreq which has an daemon runninr with root rights and a client for the user...

[edit]
Thinking further I guess it is the best to modify eg speedfreq or whatever to set vcore as well. So you could couple fsb and vcore, but in userspace. Of course the coupling should only be modifyable by root, so this would be pretty safe then.

Last edited by PrakashP on Wed Jan 05, 2005 10:07 am; edited 1 time in total

I already tried cpufreq-nforce2 (without voltage changing) some time ago. Even with the default min_fsb it locked up my box eventually. The board is an ASUS A7N8X-X. I got an Athlon 1700+ and 2x256MB DDR.
Is it even worth it? I mean the usual nforce2 board enables STPGNT per default (mine does, too). Can you measure the amound of electricity you save with additional cpufreq-nforce2?

If you also compile cpufreq governors in your kernel along with this patch, you can easily emerge cpudyn and configure it for your desktop (powersaving according to load). I'm using it now along with (emerge) gnome-cpufreq-applet-0.1.1 and it works great!_________________Tyan Thunder K8W; dual 244's, 2Gigs ECC, SBLive, G4Ti4600,
Flatron lcd 885LE

Yes, a daemon would be great to have. I mean with cpufreq-nforce2 you can easily use any daemon you want, like speedfreq etc. But what really would be ubercool is a daemon that not only can handle the FSB frequenzy changes but also the changes to cpu core voltage. But I think that's a hard task as no one can predict stable pairs of frequenzy and voltage. There are such tables for mobile CPUs like Pentium-M but not for all kinds of mainboards.
But of course we could set up the tables ourselves using programs like prime95, can't we. That way we get stable frequenzy (=multis?)/voltage pairs for our own hardware. Maybe these don't even on the cpu but on the mainboard only?
To sum it up, I'd hate doing all the switching manually. I'd rather have it done dynamically by a daemon. Can anyone suggest what to do?

Is it even worth it? I mean the usual nforce2 board enables STPGNT per default (mine does, too). Can you measure the amound of electricity you save with additional cpufreq-nforce2?

In addition with CPU core voltage changing: yes. STPGNT only comes in when the CPU is idle, while a low clocked CPU also saves power when not idle.

I've a 300W PSU and I hear it (fan) when I change the frequency/vcore in big steps. For 2000 @ 1.65V to 1000 @ 1.1V I think you save (under max. load) approx. 30-50W.

I think the best way is patching an existing cpufreq daemon to handle the FREQ<->VCore pairs or more general running commands before/after frequency changing. If there's someone who wants to do that, good. If not I'll do this when the ATXP1 module is finished (also the cpufreq-nforce2 gets a little bit tweaked).

I was able to reduce the FSB-clock on a Elitegroupe N2U400.
Although I didn't do much tests, I think you can add it to your list of supportet Mainboards._________________Just unused Microsoft-Software is good Microsoft-Software