# How to change Athlon XP clock without rebooting

## jorgepeixoto

Hi. I have an Athlon XP 2600+. /proc/cpuinfo reports family 6, model 8, stepping 1. 

The motherboard is an MSI KT4 Ultra.  It uses the chips VIA KT400 and VIA VT8235.

The motherboard accompanies a software named "Fuzzy Logic" that allows the CPU frequency to be changed within Windows.

There is a lot of time I don't use Windows, but I remember using such software and it seemed to work for changing the frequency. The software also claims to be able of changing the voltage, but I was afraid to test that. 

Can I do that on Gentoo?

Also, how can I vary CPU fan speed from Gentoo? The motherboard manual says it is possible. In the kernel configuration I have ACPI Support enabled, and under ACPI I have Fan enabled. However, /proc/acpi/fan is an empty directory.

EDITEDLast edited by jorgepeixoto on Tue Aug 07, 2007 10:39 pm; edited 1 time in total

----------

## adsmith

for CPU frequency support on the Athlon, modprobe powernow_k6 (or 7 or 8 depending on the model). 

If the fans don't show up in /proc, then they might be directly controlled by the bios.  However, you should also make sure the "thermal" and "processor" modules are loaded so you can use the thermal trip_points  in /proc/acpi/thermal/*/trip_points.

----------

## jorgepeixoto

Nothing in the BIOS Setup seems to control fan speed. (I have checked it many times). The motherboard manual claims it is possible to change fan speed from Windows

I have enabled as compiled-in features the "Processor" and "Thermal Zones" under "ACPI Support"

Regarding powernow, those seem to support only the *Mobile* Athlon XP. But if you think I should give it a try, I'll do it. I hope my computer does not explode... I'll try it in single user mode.

----------

## adsmith

Nothing will explode, I assure you.  If it's not supported, then the module will fail to load.

Since you have the ACPI stuff loaded, what do /proc/acpi/processor/*/* and /proc/acpi/thermal/*/* say?

You should set polling_frequency and trip_points to something reasonable.  maybe 15 seconds for polling, and temperature trip points spaced from 40 to 75 degrees C

Also, you might want to look into the "athcool" program which sets a missing idle bit in buggy BIOSes for athlon processors.

----------

## jorgepeixoto

 *adsmith wrote:*   

> 
> 
> Since you have the ACPI stuff loaded, what do /proc/acpi/processor/*/* and /proc/acpi/thermal/*/* say?
> 
> 

 

```

ls /proc/acpi

alarm   dsdt                 event  fan             processor     wakeup

button  embedded_controller  fadt   power_resource  thermal_zone

```

/proc/acpi/thermal does not exist

/proc/acpi/thermal_zone/ is an empty directory

```

find /proc/acpi/processor/

/proc/acpi/processor/

/proc/acpi/processor/CPU1

/proc/acpi/processor/CPU1/power

/proc/acpi/processor/CPU1/limit

/proc/acpi/processor/CPU1/throttling

/proc/acpi/processor/CPU1/info

cat /proc/acpi/processor/CPU1/info 

processor id:            0

acpi id:                 1

bus mastering control:   no

power management:        no

throttling control:      no

limit interface:         no

cat /proc/acpi/processor/CPU1/limit 

<not supported>

cat /proc/acpi/processor/CPU1/power

active state:            C1

max_cstate:              C8

bus master activity:     00000000

maximum allowed latency: 8000 usec

states:

   *C1:                  type[C1] promotion[--] demotion[--] latency[000] usage[00000000] duration[00000000000000000000]

 cat /proc/acpi/processor/CPU1/throttling 

<not supported>

```

 *Quote:*   

> 
> 
> You should set polling_frequency and trip_points to something reasonable.  maybe 15 seconds for polling, and temperature trip points spaced from 40 to 75 degrees C
> 
> 

 

If I could control it manually, it would be fine. Is it easier to control manually?

Regarding athcool:

```

athcool stat

athcool version 0.3.11 - control power-saving mode on AMD Athlon/Duron CPUs

!!!WARNING!!!

Depending on your motherboard and/or hardware components, 

enabling Athlon powersaving mode may cause:

 * noisy or distorted sound playback

 * a slowdown in harddisk performance

 * system locks or instability

 * massive filesystem corruption (rare, but observed at least once)

Before use athcool, you must recognize these potential DANGERS.

Please use athcool AT YOUR OWN RISK.

athcool is supplied "as is". The author disclaims all warranties,

expressed or implied. The author and any other persons assume

no liability for damages, direct or consequential, which may 

result from the use of athcool.

VIA KT400[A]/KT600 (1106 3189) found

'Disconnect when STPGNT Detected' bit is enabled.

'HALT Command Detection' bit is enabled.

```

So it seems that athcool is not needed for my particular system. The relevant bits are already enabled (The HALT Command Detection, in particular, I  enabled manually in the BIOS some days ago, and it seems to significantly cool the processor).

EDITEDLast edited by jorgepeixoto on Tue Aug 07, 2007 10:04 pm; edited 2 times in total

----------

## jorgepeixoto

Recompiled the kernel with powernow-k7 support

```

sudo modprobe powernow-k7

FATAL: Error inserting powernow_k7 (/lib/modules/2.6.22-gentoo-r2acpi2/kernel/arch/i386/kernel/cpu/cpufreq/powernow-k7.ko): No such device

```

EDITEDLast edited by jorgepeixoto on Tue Aug 07, 2007 10:05 pm; edited 1 time in total

----------

## adsmith

That is strange... the kernel doesn't recognize anything there... no P states, no T states, no thermal stuff either.     :Sad: 

ACPI doesn't look promising.

I suppose  you might try the hwmon/i2c/lm_sensors system, to see if you can get thermal and fan info that way.

----------

## jorgepeixoto

I already have temperature and fan info via Device Drivers -> Hardware Monitoring Support -> Winbond W83627HF, W83627THF, W83637HF, W83687THF, W83697HF

That setting corresponds to the CONFIG_SENSORS_W83627HF symbol and, as I compiled it as a module, generates the w83627hf module. I have gkrellm2 displaying CPU temperature, System temperature, CPU fan speed, case fan speed. and 8 voltages. It also displays hard disk temperature read from hddtemp and a lot of other things.

So I already have info, but now I want to control it.

EDITED

----------

## adsmith

The fact that nothing shows up at all in the /proc interface stumps me.  Maybe try the ACPI mailing list, over at acpi.sf.net?

----------

## ffwd

non-mobile athlon xp freq can be only changed via motherboard fsb.

i used nforce2 fsb cpufreq module on my main pc with athlon xp, but for kt400 there is no existing module as far as i know.

so unless somebody writes a kt400 cpufreq module, you're out of luck.

on the other hand, controlling fsb speed usermode utils possibly exist, but you'll have to search hard.

controlling fan speed is a different story since board manufacturer is probably using some non-standardized controllers (still possible thought through reverse engineering  :Wink: ).

----------

## jorgepeixoto

 *ffwd wrote:*   

> non-mobile athlon xp freq can be only changed via motherboard fsb.
> 
> 

 

I suspected that.

 *Quote:*   

> 
> 
> i used nforce2 fsb cpufreq module on my main pc with athlon xp, but for kt400 there is no existing module as far as i know.
> 
> 

 

Where is this nforce2 cpufreq module? I can hope to go to this place and find a kt400 cpufreq module... in kernel configuration, under Power mnagement options (ACPI, APM) -> CPU Frequency scaling I don't see anything mentioning nforce2

 *Quote:*   

> 
> 
> so unless somebody writes a kt400 cpufreq module, you're out of luck.
> 
> 

 

what a pity

 *Quote:*   

> 
> 
> on the other hand, controlling fsb speed usermode utils possibly exist, but you'll have to search hard.
> 
> 

 

I'll search for it. In first I was trying to google for something like "change cpu clock linux" (paraphrasing from memory) and all I got was results related to acpi... But now that you remembered me that the frequency change occurs throught the FSB, I'm googling for "change fsb linux", and the results seem more relevant. Thanks for the help. Do you have any other searching hint?

 *Quote:*   

> 
> 
> controlling fan speed is a different story since board manufacturer is probably using some non-standardized controllers (still possible thought through reverse engineering ).

 

What a pity. Do you think it is possible that a program already exists for controlling fan speed? A Google search for "change cpu fan speed linux" does not seem to find relevant results. Do you have any idea of how I could search for it?

----------

## ffwd

 *jorgepeixoto wrote:*   

> 
> 
> Where is this nforce2 cpufreq module? I can hope to go to this place and find a kt400 cpufreq module... in kernel configuration, under Power mnagement options (ACPI, APM) -> CPU Frequency scaling I don't see anything mentioning nforce2
> 
> 

 

http://img253.imageshack.us/img253/6820/cpufreqwa9.png

 *Quote:*   

> 
> 
> What a pity. Do you think it is possible that a program already exists for controlling fan speed? A Google search for "change cpu fan speed linux" does not seem to find relevant results. Do you have any idea of how I could search for it?

 

i think lm_sensors has some fan control abilities. search for "pwm" (pulse-width modulation of the fan speed)

----------

## eccerr0r

ACPI is supposed to be the "unified" way to safely control the fan, clock speeds, etc.

Sometimes the way to control these resources is written improperly in the ACPI descriptor tables in firmware and without these written properly, there's no way to control them in the OS.  Look for DSDT hacking to see if you have an incorrect descriptor table and try "fixing" it (since decompiled DSDTs don't have comments, they still can be somewhat tricky to fix.)

Besides using ACPI, there's always the hardware-dependent methods, which means the software is custom for your specific board.  Though it is feasible to control things over I2C, it's clearly nonstandard and it's not the only way. Unless someone figured it out or wrestled the specs out of the mb manufacturer/i2c control chip, you're out of luck there.  A lot of custom circuitry has been designed for this stuff, there's no real standardized way of doing it.  If the MB manufacturer isn't willing to supply the data, someone will need to get your specific board out of the whole sea of available boards and reverse engineer the Windows utility...

Some later chips, however, have well-defined software interfaces for these things... but I don't think that includes the XP2600+.  Best you can do is probably set the limits in BIOS and hope for the best.

----------

## jorgepeixoto

 *ffwd wrote:*   

>  *jorgepeixoto wrote:*   
> 
> Where is this nforce2 cpufreq module? I can hope to go to this place and find a kt400 cpufreq module... in kernel configuration, under Power mnagement options (ACPI, APM) -> CPU Frequency scaling I don't see anything mentioning nforce2
> 
>  
> ...

 

It seems you have to enable "Prompt for development and/or incomplete code/drivers" to see that. Since I didn't have that enabled, I couldn't see that. 

 *Quote:*   

> 
> 
>  *Quote:*   
> 
> What a pity. Do you think it is possible that a program already exists for controlling fan speed? A Google search for "change cpu fan speed linux" does not seem to find relevant results. Do you have any idea of how I could search for it? 
> ...

 

I have tried, with no success. Look:

```

jorge ~ # sensors-detect 

# sensors-detect revision 4171 (2006-09-24 03:37:01 -0700)

This program will help you determine which kernel modules you need

to load to use lm_sensors most effectively. It is generally safe

and recommended to accept the default answers to all questions,

unless you know what you're doing.

We can start with probing for (PCI) I2C or SMBus adapters.

Do you want to probe now? (YES/no): YES

Probing for PCI bus adapters...

Use driver `i2c-viapro' for device 0000:00:11.0: VIA Technologies VT8233A/8235 S

We will now try to load each adapter module in turn.

Load `i2c-viapro' (say NO if built into your kernel)? (YES/no): YES

Module loaded successfully.

If you have undetectable or unsupported adapters, you can have them

scanned by manually loading the modules before running this script.

To continue, we need module `i2c-dev' to be loaded.

Do you want to load `i2c-dev' now? (YES/no): YES

Module loaded successfully.

We are now going to do the I2C/SMBus adapter probings. Some chips may

be double detected; we choose the one with the highest confidence

value in that case.

If you found that the adapter hung after probing a certain address,

you can specify that address to remain unprobed.

Next adapter: SMBus Via Pro adapter at 0400

Do you want to scan it? (YES/no/selectively): YES

Client found at address 0x1b

Probing for `Maxim MAX6650/MAX6651'...                      No

Probing for `Philips Semiconductors PCA9556'...             No

Client found at address 0x2f

Probing for `National Semiconductor LM78'...                No

Probing for `National Semiconductor LM78-J'...              No

Probing for `National Semiconductor LM79'...                No

Probing for `National Semiconductor LM80'...                No

Probing for `Analog Devices ADT7470'...                     No

Probing for `Winbond W83781D'...                            No

Probing for `Winbond W83782D'...                            No

Probing for `Winbond W83792D'...                            No

Probing for `Winbond W83793R/G'...                          No

Probing for `Winbond W83791SD'...                           No

Probing for `Winbond W83627HF'...                           No

Probing for `Winbond W83627EHF'...                          No

Probing for `Winbond W83627DHG'...                          No

Probing for `Asus AS99127F (rev.1)'...                      No

Probing for `Asus AS99127F (rev.2)'...                      No

Probing for `Asus ASB100 Bach'...                           No

Probing for `Analog Devices ADM9240'...                     No

Probing for `Dallas Semiconductor DS1780'...                No

Probing for `National Semiconductor LM81'...                No

Probing for `Analog Devices ADM1029'...                     No

Probing for `ITE IT8712F'...                                No

Probing for `Fintek custom power control IC'...             No

Probing for `Winbond W83791D'...                            No

Client found at address 0x50

Probing for `Analog Devices ADM1033'...                     No

Probing for `Analog Devices ADM1034'...                     No

Probing for `SPD EEPROM'...                                 Success!

    (confidence 1, driver `eeprom')

Probing for `EDID EEPROM'...                                No

Probing for `Maxim MAX6900'...                              No

Client found at address 0x69

Client found at address 0x6a

Next adapter: bt878 #0 [sw]

Do you want to scan it? (YES/no/selectively): no

Some chips are also accessible through the ISA I/O ports. We have to

write to arbitrary I/O ports to probe them. This is usually safe though.

Yes, you do have ISA I/O ports even if you do not have any ISA slots!

Do you want to scan the ISA I/O ports? (YES/no): YES

Probing for `National Semiconductor LM78' at 0x290...       No

Probing for `National Semiconductor LM78-J' at 0x290...     No

Probing for `National Semiconductor LM79' at 0x290...       No

Probing for `Winbond W83781D' at 0x290...                   No

Probing for `Winbond W83782D' at 0x290...                   No

Probing for `Winbond W83627HF' at 0x290...                  No

Probing for `Silicon Integrated Systems SIS5595'...         No

Probing for `VIA VT82C686 Integrated Sensors'...            No

Probing for `VIA VT8231 Integrated Sensors'...              No

Probing for `AMD K8 thermal sensors'...                     No

Probing for `IPMI BMC KCS' at 0xca0...                      No

Probing for `IPMI BMC SMIC' at 0xca8...                     No

Some Super I/O chips may also contain sensors. We have to write to

standard I/O ports to probe them. This is usually safe.

Do you want to scan for Super I/O sensors? (YES/no): YES

Probing for Super-I/O at 0x2e/0x2f

Trying family `ITE'...                                      No

Trying family `National Semiconductor'...                   No

Trying family `SMSC'...                                     No

Trying family `VIA/Winbond/Fintek'...                       Yes

Found `Winbond W83697HF Super IO Sensors'                   Success!

    (address 0x290, driver `w83627hf')

Probing for Super-I/O at 0x4e/0x4f

Trying family `ITE'...                                      No

Trying family `National Semiconductor'...                   No

Trying family `SMSC'...                                     No

Trying family `VIA/Winbond/Fintek'...                       No

Now follows a summary of the probes I have just done.

Just press ENTER to continue: 

Driver `eeprom' (should be inserted):

  Detects correctly:

  * Bus `SMBus Via Pro adapter at 0400'

    Busdriver `i2c-viapro', I2C address 0x50

    Chip `SPD EEPROM' (confidence: 1)

  EEPROMs are *NOT* sensors! They are data storage chips commonly

  found on memory modules (SPD), in monitors (EDID), or in some

  laptops, for example.

Driver `w83627hf' (should be inserted):

  Detects correctly:

  * ISA bus address 0x0290 (Busdriver `i2c-isa')

    Chip `Winbond W83697HF Super IO Sensors' (confidence: 9)

I will now generate the commands needed to load the required modules.

Just press ENTER to continue: 

If you want to load the modules at startup, generate a config file

below and make sure lm_sensors gets started at boot time; e.g

$ rc-update add lm_sensors default

To make the sensors modules behave correctly, add these lines to

/etc/modules.d/lm_sensors and run modules-update:

#----cut here----

# I2C module options

alias char-major-89 i2c-dev

#----cut here----

If you have some drivers built into your kernel, the list above will

contain too many modules. Skip the appropriate ones! You really

should try these commands right now to make sure everything is

working properly. Monitoring programs won't work until the needed

modules are loaded.

To load everything that is needed, execute the commands below...

#----cut here----

# I2C adapter drivers

modprobe i2c-viapro

# Chip drivers

# Warning: the required module eeprom is not currently installed

# on your system. For status of 2.6 kernel ports check

# http://www.lm-sensors.org/wiki/Devices. If driver is built

# into the kernel, or unavailable, comment out the following line.

modprobe eeprom

modprobe w83627hf

# sleep 2 # optional

/usr/bin/sensors -s # recommended

#----end cut here----

Do you want to generate /etc/conf.d/lm_sensors? Enter s to specify other file na

  (YES/no/s): YES

Done.

```

```

jorge ~ # lsmod

Module                  Size  Used by

i2c_dev                 5764  0 

i2c_viapro              7380  0 

tuner                  60840  0 

bttv                  164340  0 

video_buf              19908  1 bttv

firmware_class          7296  1 bttv

snd_bt87x              11364  0 

ir_common              29700  1 bttv

btcx_risc               3976  1 bttv

tveeprom               14224  1 bttv

loop                   13636  0

```

```

jorge@jorge ~ $ cat /etc/conf.d/lm_sensors 

#    /etc/conf.d/sensors - Defines modules loaded by /etc/init.d/lm_sensors

#    Copyright (c) 1998 - 2001  Frodo Looijaard <frodol@dds.nl>

#

#    This program is free software; you can redistribute it and/or modify

#    it under the terms of the GNU General Public License as published by

#    the Free Software Foundation; either version 2 of the License, or

#    (at your option) any later version.

#

#    This program is distributed in the hope that it will be useful,

#    but WITHOUT ANY WARRANTY; without even the implied warranty of

#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the

#    GNU General Public License for more details.

#

#    You should have received a copy of the GNU General Public License

#    along with this program; if not, write to the Free Software

#    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

#

#

# See also the lm_sensors homepage at:

#     http://www.lm-sensors.org/

#

# This file is used by /etc/init.d/lm_sensors and defines the modules to

# be loaded/unloaded. This file is sourced into /etc/init.d/lm_sensors.

#

# The format of this file is a shell script that simply defines the modules

# in order as normal variables with the special names:

#    MODULE_0, MODULE_1, MODULE_2, etc.

#

# Please note that the numbers in MODULE_X must start at 0 and increase in

# steps of 1. Any number that is missing will make the init script skip the

# rest of the modules. Use MODULE_X_ARGS for arguments.

#

# List the modules that are to be loaded for your system

#

# Generated by sensors-detect on Fri Aug 17 12:30:08 2007

# Load modules at startup

LOADMODULES=yes

# Initialize sensors at startup

INITSENSORS=yes

MODULE_0=i2c-viapro

MODULE_1=eeprom

MODULE_2=w83627hf

```

```

jorge ~ # pwmconfig 

This program will search your sensors for pulse width modulation (pwm)

controls, and test each one to see if it controls a fan on

your motherboard. Note that many motherboards do not have pwm

circuitry installed, even if your sensor chip supports pwm.

We will attempt to briefly stop each fan using the pwm controls.

The program will attempt to restore each fan to full speed

after testing. However, it is ** very important ** that you

physically verify that the fans have been to full speed

after the program has completed.

/usr/sbin/pwmconfig: There are no pwm-capable sensor modules installed

```

----------

