A scratchpad for random thoughts re spudstop.
--------------------------------------------------------------

On an APM kernel, msrs 0x2a -> 0x31 change when going from
battery to mains and vice versa.
mains @ 700MHz = 0x46480020
battery @500Mhz= 0x45080020

Reading MHz on an ACPI kernel gets us wild results, anywhere
between 2MHz and 266MHz. The reason for this is that the
ACPI code does thermal throttling unrelated to Speedstep.

According to Andy Grover, Speedstep only has 2 states.
Need to dump the above MSRs on more speedstep capable laptops.
(Of differing clockrates).

-------------------------------------------------------------
Danb has a Toshiba Portege which has an APM implementation
of speedstep working as it should. (Well, mostly).

Need to find the int 15h entry point from zero page in 16bit
mode, and then disasm that section of the BIOS. Fun.
-------------------------------------------------------------

Malik Martin <martin.malik@siemens.at> has reverse engineered
large amounts of the 2nd type of speedstep (ICH).
His findings follow.

Everyting is done using a BYTE-write to port 0xB2 (which is also mentioned
in the MS document), but the behavior is REALLY STRANGE, because this
instruction uses other registers (than DX, AL) and upon completion changes
registers !! Yes, it's hard to believe, because I haven't seen such a
behavior yet.

Set EAX to 0x47534982, where AL=0x82 is a special command byte.
The rest of EAX means "GSI" in ASCII, but why ???
Register EBX seems to be the function select register.
Then perform a BYTE write to port 0xB2 (OUT DX,AL).
Now if it worked, you can see, that also other registers have changed.
I assume, that if the CPU/chipset gets I/O write to 0xB2 with 0x82 it
compares
the rest of EAX with "GSI" and if true, it acts different.
So, following is a description of functions, that I found:

EBX=0 - ???
Return:
EAX=0
EDI=??? (00000004)

--------------------------

EBX=1 - Get state
Return:
EAX=0 => success?
EBX=Current state
EDI=??? (0202FE05)
ESI=??? (00000900)

Function 1 returns in EDI: bit0 power supply: 0=battery, 1=main
--------------------------

EBX=2 - Set state
ECX=desired state
Return: EDI=0 => success
EBX=new state

--------------------------

State: 0=Maximum perf., 1=Battery optimized

Example in ASM to change the power state to Battery optimized mode:

MOV EAX,47534982h
MOV EBX,2
MOV EDX,000000B2h
MOV ECX,1
OUT DX,AL

