# No chance for Cpu Frequency Scaling on Sempron?

## XmainframeX

Somehow I seem to have no chance to use some kind of cpu frequency scaling on my sempron. I tried powernowd, cpudyn and cpufrequtils, all stopping with some errors. Using the newest genkernel and kernel-2.6.11-gentoo-r9.

I compiled the governor available for frequency scaling into the kernel, too, and tried to change its strategy with

```
echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
```

but the whole cpufreq dir seems to be missing.

Watched the log, too:

```
dmesg | grep powernow

powernow-k8: Power state transitions not supported
```

I compiled nearly everything connected to frequency scaling into the kernel, but it doesnt seem like my cpu is recognized corerectly. Tried to set the cpu type to K7 and K8, the kernel boots with both, just without some frequency scaling support.

Found this site http://gentoo-wiki.com/HOWTO_PowerNow%21 here. It says that I had to apply a patch to the kernel for running powernow on sempron but that this was fixed with kernel-2.6.11-r2. So are gentoo r* not matching nongentoo rc* or why can't I use powernow with r9?

I'd like to try to apply this patch anyway but unfortunately I don't understand a word - so if anybody has too much time, making this forum (http://ubuntuforums.org/archive/index.php/t-3585.html) a bit more beginners friendly would really be nice!

Thx in advance so far...

----------

## LiquidRain

Is your Sempron a Socket 754 (64-bit) or Socket A (32-bit) processor?

If it's a 32-bit your only change of getting CPU frequency scaling is if you have an nForce2 board, which I can help you with, if it is a Socket 754 Sempron though I'm not so sure I can help out.

----------

## GNUtoo

it's more corect to say socket 754 and socketA 

because the sempron 754 is a 32 bit cpu

on the socket A the cpu must be unlocked and i don't know if the nforce2 does it automaticaly by connecting pins of the cpu

http://www.ocinside.de/index_e.html

now it's a lot more dificult to do it that the somple pensil trick

i don't know if you could anymore doing it with conecting some pins as the atlon xp

but i remember that there is the l5 bridges that can be moded to transform the cpu in a mobile cpu

so after changing frequency coud easely be acheaved by changing the cpu msr

the 754 cpu is unlocked ("cool and quiet") but only with lower frequency...so people overclock them with a combinasons of lower multiplicating coeficient ans upper fsb (with the help of features as pci lock that freeze the pci bridge frequency)

----------

## Minot

Which model of socket 754 Sempron are you using?  Sempron 2600 and 2800 do not support Cool 'N' Quiet (CNQ).  Only the Sempron 3000, 3100 and 3300 support CNQ.  This is built into the CPUs and explains (if you are using the 2600 or 2800) why you are getting your errors.

-MINOT-

----------

## LiquidRain

new_to_non_X86: The Socket A nForce2 motherboards (and only some models) use front side bus changing, not multiplier changes, to ramp clock speed.

Thank you for correcting me; Socket 754s only run in 32-bit.

----------

## XmainframeX

Well, I have a Sempron 2600+ running on Sockel 754.

According to http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/30430.pdf (Page 23) every Sempron supports Min P-State. Thats all i want...

So how to run with that P-State? Shouldn't the built in govenor in the kernel do that job?

----------

## GNUtoo

yes i thimk that's in the kernel

if i remember...there was some kind frequency scaling in some options(but ambe it was for another processor as the pm)

so mabe you'll have to recompile the kernel

----------

## XmainframeX

I compiled everything concerned with frequency scaling into the kernel but it still doesn't work. I tried some userspace tools, too. As far as I remember, one told me that there is no ACPI Interface for P-States transition even when the support therefore was set to be in the kernel and this tool was compiled with acpi use-flag.

Has anyone already an Idea how the thing I found over this wiki site works?

----------

## ferringb

Curious, you ever get this working?

----------

## ferringb

 *ferringb wrote:*   

> Curious, you ever get this working?

 

Got this working although never commented here- at least in my case, had to hotpatch the dsdt due to ecs being shitty about fixing their bios...

anyone curious, can post the details although it's covered via googling for terms- intel dsdt compiler fixing

----------

## palu15

I installed Gentoo Amd64 last release (kernel 2.6.18-r6 I think) on a Sempron 2800 and AsRock K8NF6G-VSTA and i've got the same problem "powernow-k8: Power state transitions not supported", no PStates detected and as far as I know ACPI interface not correctly recognized.... I tried recompiling the kernel following the Powernow Wiki without luck   :Crying or Very sad:  .

I also patched the kernel with powernow.h and powernow.c from AMD site Cool & Quite Linux Driver without any result...

Any hint or news?

Thanks in advance

----------

## ferringb

 *palu15 wrote:*   

> I installed Gentoo Amd64 last release (kernel 2.6.18-r6 I think) on a Sempron 2800 and AsRock K8NF6G-VSTA and i've got the same problem "powernow-k8: Power state transitions not supported", no PStates detected and as far as I know ACPI interface not correctly recognized.... I tried recompiling the kernel following the Powernow Wiki without luck   .
> 
> I also patched the kernel with powernow.h and powernow.c from AMD site Cool & Quite Linux Driver without any result...
> 
> Any hint or news?
> ...

 

Yeah... may not like it though.  :Smile: 

If needed, I can fire up the laptop and poke at it, but the short version is that the DSDT table shipped for the bios wasn't valid; had to use the intel tools for it (details are here roughly), decompile the DSDT, fix the invalid power state entries, recompile it, and via a kernel option, compile the fixed DSDT into the kernel and have it hotpatch the tables on the fly during initialization.

In my case, the DSDT was invalidly formatted for specifying cpu frequency states- specified a shiteload of extra (daft) null states, more states then the specified # of known states in the table header; iow, said it had 2, specified 2 valid states, then a couple dozen null states; kernel didn't like this at all (unlike windows, it's anal about the specification), thus wasn't willing to use that chunk of data.

So... removed the nulls, rebuilt it, had the kernel hotpatch the fixed blob into mem, kernel continues initialization and reads the corrected entry, thus able to (finally) get PStates out of the DSDT without issue.

Crappy sempron processor in my case, but it was enough to get it able to drop down to the only freq the proc supported- 800mhz; that said, I *did* run into a few issues with it, although that was an odd interaction between cpufreq and the crappy video card on the laptop; essentially, if the video card switched modes for firing up X, if cpufreq was switching states during it, a timeout would occur resulting in cpufreq locking the state at whatever it may have been (typically 800mhz, which was annoying).

My solution to that was pretty much just forcing a delay in the cpufreq state change till after the vid mode changes had occured- basically abuse sleep to re-enable a non-performance governor 20s after startx has been started.

Hope that's enough to get you started- if now, I can fire up the crappy laptop (been using it as a foot rest  :Wink: ) and dig through what I worked out about a year back.

----------

## palu15

 *ferringb wrote:*   

>  *palu15 wrote:*   I installed Gentoo Amd64 last release (kernel 2.6.18-r6 I think) on a Sempron 2800 and AsRock K8NF6G-VSTA and i've got the same problem "powernow-k8: Power state transitions not supported", no PStates detected and as far as I know ACPI interface not correctly recognized.... I tried recompiling the kernel following the Powernow Wiki without luck   .
> 
> I also patched the kernel with powernow.h and powernow.c from AMD site Cool & Quite Linux Driver without any result...
> 
> Any hint or news?
> ...

 

Be patient, as far as I understand I've to verify DSTD for my motherboard (which is probably not correctly formatted...   :Rolling Eyes:  ) and I've to patch the kernel (about ACPI I wonder) according to it?

----------

## ferringb

 *palu15 wrote:*   

> Be patient, as far as I understand I've to verify DSTD for my motherboard (which is probably not correctly formatted...   ) and I've to patch the kernel (about ACPI I wonder) according to it?

 

whee... found it.

basic description; toolchain you need for compiling/decompiling dsdt tables is sys-power/iasl (stupidly labeled; it's a general acpi tool, can fix far more then crappy PStates).

For verifying; it's pretty simple, pull /proc/acpi/dsdt to a local file via iasl -d (I've had no issues with it, despite the pages comments), then... just try to recompile it.

If it gives you the finger, well, theres your answer.   :Wink: 

acpixtract might do the extraction also, although again, been a long while since I poked at these bits.

If the dsdt is horked, then fix it (try to compile it, fix the error its complaining about, repeat); once you've got a compiled form, there is an option in the kernel config for DSDT patching, although having some troubles finding it atm; that option allows you to specify the path to the fixed blob, then you recompile (kernel pulls in the blob), reboot under the kernel and it hotpatches the dsdt with the fixed blob.

Goes without saying, if done incorrectly can cause some minor hell, thus would go straight to term instead of firing up X, etc, for testing.  Turning on debugging for acpi/cpufreq would likely be wise also- if something is whonky, it'll show there.

Aside from that, don't have the docs on hand, but amd has ACPI docs you can refer to for the proper formating of PState entries- realize this might sound like a lot, but it's actually pretty straightforward also; possible to cause issues (you are overwriting the bios 'definition' of sorts for the system), so usual warnings apply- as long as you're playing only with the pstate entries it should be fine though.

----------

## palu15

 *ferringb wrote:*   

>  *palu15 wrote:*   Be patient, as far as I understand I've to verify DSTD for my motherboard (which is probably not correctly formatted...   ) and I've to patch the kernel (about ACPI I wonder) according to it? 
> 
> whee... found it.
> 
> basic description; toolchain you need for compiling/decompiling dsdt tables is sys-power/iasl (stupidly labeled; it's a general acpi tool, can fix far more then crappy PStates).
> ...

 

OK you gave me the procedure (thanks again), now I've to follow it  :Cool: 

If I've any news I'll post... 

Bye Luca

----------

## bLUEbYTE84

 *XmainframeX wrote:*   

> Well, I have a Sempron 2600+ running on Sockel 754.
> 
> According to http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/30430.pdf (Page 23) every Sempron supports Min P-State. Thats all i want...
> 
> So how to run with that P-State? Shouldn't the built in govenor in the kernel do that job?

 

If you are aiming to use C 'n Q(kernel powernow), sorry but you are out of luck, it is only supported on 3000+ and up.

----------

## palu15

 *bLUEbYTE84 wrote:*   

>  *XmainframeX wrote:*   Well, I have a Sempron 2600+ running on Sockel 754.
> 
> According to http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/30430.pdf (Page 23) every Sempron supports Min P-State. Thats all i want...
> 
> So how to run with that P-State? Shouldn't the built in govenor in the kernel do that job? 
> ...

 

 :Shocked:  OOOps that's why I have no P States.....  My Sempron 2800 just hasn't got

But how can Cool & Quite work on Windows OS?????  :Crying or Very sad: 

Just for information yesterday night I dumped dstd and compiled with iasl, I got just some warnings about Acquire instruction ignored timeout (Warning 1103), it means the instruction is waiting on a Mutex with a timeout (does not wait forever code=0xFFFF) and the return value is not tested.

I report a part of my dstd.dsl

```

/*

 * Intel ACPI Component Architecture

 * AML Disassembler version 20061109

 *

 * Disassembly of dstd.dat, Tue Jan  9 23:04:57 2007

 *

 *

 * Original Table Header:

 *     Signature        "DSDT"

 *     Length           0x00004F1C (20252)

 *     Revision         0x01

 *     OEM ID           "8N6GV"

 *     OEM Table ID     "8N6GV133"

 *     OEM Revision     0x00000133 (307)

 *     Creator ID       "INTL"

 *     Creator Revision 0x20051117 (537202967)

 */

DefinitionBlock ("dstd.aml", "DSDT", 1, "8N6GV", "8N6GV133", 0x00000133)

{

..............

Scope (_SB)

    {

        Name (XCPD, Zero)

        Name (XNPT, One)

        Name (XCAP, 0x02)

        Name (XDCP, 0x04)

        Name (XDCT, 0x08)

        Name (XDST, 0x0A)

        Name (XLCP, 0x0C)

        Name (XLCT, 0x10)

        Name (XLST, 0x12)

        Name (XSCP, 0x14)

        Name (XSCT, 0x18)

        Name (XSST, 0x1A)

        Name (XRCT, 0x1C)

        Mutex (MUTE, 0x00)

        Method (RBPE, 1, NotSerialized)

        {

            Acquire (MUTE, 0x03E8)

            Add (Arg0, PCIB, Local0)

            OperationRegion (PCFG, SystemMemory, Local0, One)

            Field (PCFG, ByteAcc, NoLock, Preserve)

            {

                XCFG,   8

            }

            Release (MUTE)

            Return (XCFG)

        }

        Method (RWPE, 1, NotSerialized)

        {

            Acquire (MUTE, 0x03E8)

            And (Arg0, 0xFFFFFFFE, Arg0)

            Add (Arg0, PCIB, Local0)

            OperationRegion (PCFG, SystemMemory, Local0, 0x02)

            Field (PCFG, WordAcc, NoLock, Preserve)

            {

                XCFG,   16

            }

            Release (MUTE)

            Return (XCFG)

        }

        Method (RDPE, 1, NotSerialized)

        {

            Acquire (MUTE, 0x03E8)

            And (Arg0, 0xFFFFFFFC, Arg0)

            Add (Arg0, PCIB, Local0)

            OperationRegion (PCFG, SystemMemory, Local0, 0x04)

            Field (PCFG, DWordAcc, NoLock, Preserve)

            {

                XCFG,   32

            }

            Release (MUTE)

            Return (XCFG)

        }

        Method (WBPE, 2, NotSerialized)

        {

            Acquire (MUTE, 0x0FFF)

            Add (Arg0, PCIB, Local0)

            OperationRegion (PCFG, SystemMemory, Local0, One)

            Field (PCFG, ByteAcc, NoLock, Preserve)

            {

                XCFG,   8

            }

            Store (Arg1, XCFG)

            Release (MUTE)

        }

        Method (WWPE, 2, NotSerialized)

        {

            Acquire (MUTE, 0x03E8)

            And (Arg0, 0xFFFFFFFE, Arg0)

            Add (Arg0, PCIB, Local0)

            OperationRegion (PCFG, SystemMemory, Local0, 0x02)

            Field (PCFG, WordAcc, NoLock, Preserve)

            {

                XCFG,   16

            }

            Store (Arg1, XCFG)

            Release (MUTE)

        }

        Method (WDPE, 2, NotSerialized)

        {

            Acquire (MUTE, 0x03E8)

            And (Arg0, 0xFFFFFFFC, Arg0)

            Add (Arg0, PCIB, Local0)

            OperationRegion (PCFG, SystemMemory, Local0, 0x04)

            Field (PCFG, DWordAcc, NoLock, Preserve)

            {

                XCFG,   32

            }

            Store (Arg1, XCFG)

            Release (MUTE)

        }

        Method (RWDP, 3, NotSerialized)

        {

            Acquire (MUTE, 0x03E8)

            And (Arg0, 0xFFFFFFFC, Arg0)

            Add (Arg0, PCIB, Local0)

            OperationRegion (PCFG, SystemMemory, Local0, 0x04)

            Field (PCFG, DWordAcc, NoLock, Preserve)

            {

                XCFG,   32

            }

            And (XCFG, Arg2, Local1)

            Or (Local1, Arg1, XCFG)

            Release (MUTE)

        }

        Method (RPME, 1, NotSerialized)

        {

            Add (Arg0, 0x84, Local0)

            Store (RDPE (Local0), Local1)

            If (LEqual (Local1, Ones))

            {

                Return (Zero)

            }

            Else

            {

                If (LAnd (Local1, 0x00010000))

                {

                    WDPE (Local0, And (Local1, 0x00010000))

                    Return (One)

                }

                Return (Zero)

            }

        }

    }

    Scope (_SB.PCI0)

    {

        Name (SUPP, Zero)

        Name (CTRL, Zero)

        Method (_OSC, 4, NotSerialized)

        {

            If (LEqual (Arg0, Buffer (0x10)

                    {

                        /* 0000 */    0x5B, 0x4D, 0xDB, 0x33, 0xF7, 0x1F, 0x1C, 0x40, 

                        /* 0008 */    0x96, 0x57, 0x74, 0x41, 0xC0, 0x3D, 0xD7, 0x66

                    }))

            {

                CreateDWordField (Arg3, Zero, CDW1)

                CreateDWordField (Arg3, 0x04, CDW2)

                CreateDWordField (Arg3, 0x08, CDW3)

                Store (CDW2, SUPP)

                Store (CDW3, CTRL)

                If (LNotEqual (And (SUPP, 0x16), 0x16))

                {

                    And (CTRL, 0x1E, CTRL)

                }

                And (CTRL, 0x1D, CTRL)

                If (Not (And (CDW1, One)))

                {

                    If (And (CTRL, One)) {}

                    If (And (CTRL, 0x04)) {}

                    If (And (CTRL, 0x10)) {}

                }

                If (LNotEqual (Arg1, One))

                {

                    Or (CDW1, 0x08, CDW1)

                }

                If (LNotEqual (CDW3, CTRL))

                {

                    Or (CDW1, 0x10, CDW1)

                }

                Store (CTRL, CDW3)

                Return (Arg3)

            }

            Else

            {

                Or (CDW1, 0x04, CDW1)

                Return (Arg3)

            }

        }

    }

     ........................

}

```

and here is the output of the compiler

```

Intel ACPI Component Architecture

ASL Optimizing Compiler version 20061109 [Jan  9 2007]

Copyright (C) 2000 - 2006 Intel Corporation

Supports ACPI Specification Revision 3.0a

dstd.dsl  5268:             Acquire (MUTE, 0x03E8)

Warning  1103 -                                 ^ Possible operator timeout is ignored

dstd.dsl  5282:             Acquire (MUTE, 0x03E8)

Warning  1103 -                                 ^ Possible operator timeout is ignored

dstd.dsl  5297:             Acquire (MUTE, 0x03E8)

Warning  1103 -                                 ^ Possible operator timeout is ignored

dstd.dsl  5312:             Acquire (MUTE, 0x0FFF)

Warning  1103 -                                 ^ Possible operator timeout is ignored

dstd.dsl  5326:             Acquire (MUTE, 0x03E8)

Warning  1103 -                                 ^ Possible operator timeout is ignored

dstd.dsl  5341:             Acquire (MUTE, 0x03E8)

Warning  1103 -                                 ^ Possible operator timeout is ignored

dstd.dsl  5356:             Acquire (MUTE, 0x03E8)

Warning  1103 -                                 ^ Possible operator timeout is ignored

ASL Input:  dstd.dsl - 5898 lines, 188351 bytes, 2178 keywords

AML Output: dstd.aml - 20252 bytes 806 named objects 1372 executable opcodes

Compilation complete. 0 Errors, 7 Warnings, 0 Remarks, 81 Optimizations

```

----------

## yottabit

Maybe this is the right thread for this... been a few years since it started, but hey!

I have a new Socket AM2 with a 64-bit Sempron 3000+:

```
processor       : 0

vendor_id       : AuthenticAMD

cpu family      : 15

model           : 79

model name      : AMD Sempron(tm) Processor 3000+

stepping        : 2

cpu MHz         : 1607.482

cache size      : 256 KB

fdiv_bug        : no

hlt_bug         : no

f00f_bug        : no

coma_bug        : no

fpu             : yes

fpu_exception   : yes

cpuid level     : 1

wp              : yes

flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx mmxext fxsr_opt lm 3dnowext 3dnow pni cx16 lahf_lm cr8legacy ts ttp tm stc

bogomips        : 3218.15

clflush size    : 64
```

This server was already running a Socket 462 Athlon XP 2100+, and there is no way I'm going to start all over with my complicated configs in order to switch to AMD64, so for now I've kept the chost & compile flags the same (i686 and -march=athlon-xp). 

Running kernel 2.6.20-gentoo-r3 and changed the processor type to "Opteron/Athlon64/Hammer/K8", added all of the correct frequency/power options needed for PowerNow! to work, and recompiled the kernel.

```
Linux hal 2.6.20-gentoo-r3 #5 Tue Mar 27 22:19:59 EDT 2007 i686 AMD Sempron(tm) Processor 3000+ AuthenticAMD GNU/Linux
```

The problem is that I get the same crappy error about PowerNow! not being supported, even though the processor absolutely does support it...

```
# dmesg | grep powernow

powernow-k8: Power state transitions not supported
```

Any hints? Thanks!

J

----------

