Jump to content


Solved: 900Mhz under Linux (yes, the REAL deal!)


171 replies to this topic

#1 kiwidrew

    Member

  • Members
  • 26 posts

Posted 29 November 2007 - 11:11 PM

For the past week, I've been slowly uncovering the mysteries of the eee's hardware, and I am pleased to announce that I have successfully overclocked the CPU to 900Mhz under Linux. I can confirm that it actually DOES result in a measurable performance gain! I'm running the 0401 BIOS, and haven't yet experienced any stability issues.

I have written a new kernel module, eee.ko, which uses some internal ACPI methods still present in the BIOS to change the PLL chip's N multiplier and M divider values. It exposes this through a file, /proc/eee/fsb, allowing the FSB to be easily changed at will.

Right now, I need some brave testers to try out this module. After all, just because it works for me doesn't mean it will work on all machines! At this stage the module is very highly experimental, and I wouldn't recommend it for general use yet.

I've created a project page at Google Code:
http://code.google.com/p/eeepc-linux/

The source to my module is available for download, as well as the datasheet for the ICS9LPRS426 PLL chip the eee uses. I *will not* be providing a pre-compiled module at this time -- if you're unable to compile your own kernel modules, I'd suggest that you wait until the code is a little bit more mature.

Once the core over/underclocking code has stabilized, I want to hook it up to the Linux kernel's cpufreq mechanism. This will allow the kernel to dynamically switch between 630Mhz and 900Mhz based on the CPU usage, and it will also let us use GNOME's cpufreq applet to show (and change) the frequency.

I'm also very interested in figuring out how the fan is controlled. I have reason to believe that we can override the BIOS's built-in temperature setpoints, and we might also be able to control the fan speed. There's also the issue of power consumption, which I think we can improve as well: for instance, the PLL chip in the eee supports 6 PCI clock outputs, which are all currently enabled. If it turns out that some of those outputs are not used, disabling them will reduce the PLL chip's power consumption...

Good luck! I'm looking forward to hearing feedback from everyone. :)
-Andrew

#2 Threlly

    Advanced Member

  • Members
  • PipPipPip
  • 56 posts

Posted 29 November 2007 - 11:25 PM

Well Done.
Can't wait to hear more.

#3 mkrishnan

    ExtrEmE User

  • Moderators
  • 3,444 posts
  • LocationGrand Rapids, MI, USA

Posted 29 November 2007 - 11:40 PM

Nice work. Very excited too to see if you can figure out how to work the fan from software. :)
Mohan

#4 hetz

    Member

  • Members
  • 11 posts

Posted 29 November 2007 - 11:49 PM

First - great work!

I would like to say few remarks, if you don't mind:

1. Without a compiled module, tons of people would not be able to test your module since most of them don't have the chain-tool (make, gcc, etc..) on their eee installed, nor do they know how to cross compile it on their machine and move it to the EEE.
2. I suggest that you add a parameter in the module (like risk=1) if the person tries to overclock more then 900Mhz, since this could do some damage (I haven't seen in the EEE XP part of this forum that someone damaged his machine after overclocking it to 900Mhz).

Thanks,
Hetz

#5 kiwidrew

    Member

  • Members
  • 26 posts

Posted 30 November 2007 - 12:12 AM

Quote

Ok, the module is loaded but how do I scale the cpu up? I have "70 24" in /proc/eee/fsb. Should that be 100 24?
As root, simply run echo 100 24 0 > /proc/eee/fsb. The first number is the N multiplier, and the second number is the M divisor. The third number is what to tell the embedded controller (0=70Mhz, 1=100Mhz). I included this because, well, that's what the 8804 BIOS did... but I noticed that telling the EC it was 100Mhz caused my external monitor to go fuzzy, and everything still worked when I lied and told the EC it was at 70Mhz. :)

There's some more info and usage instructions in the eee.c file. Importantly, you probably want to go 70 -> 85 -> 100, instead of jumping directly.

#6 smgoller

    Advanced Member

  • Members
  • PipPipPip
  • 85 posts

Posted 30 November 2007 - 12:16 AM

Can you post more about what you found out from a low level ACPI standpoint? I'm interested in using Notebook Hardware Control for Windows to create an ACPI module for the EEE so it can overclock safely instead of using SetFSB, and also control the fan eventually. :)

#7 smgoller

    Advanced Member

  • Members
  • PipPipPip
  • 85 posts

Posted 30 November 2007 - 12:21 AM

I just looked through eee.c...I KNEW IT! I was looking at CFVS last night in the DSDT and i figured that was where you could do it, but I got stumped from there. Excellent! This weekend I'll work on a module for NHC to do this.

#8 kiwidrew

    Member

  • Members
  • 26 posts

Posted 30 November 2007 - 12:45 AM

Quote

I just looked through eee.c...I KNEW IT! I was looking at CFVS last night in the DSDT and i figured that was where you could do it, but I got stumped from there. Excellent! This weekend I'll work on a module for NHC to do this.
Yes, that's part of it... CFVS() calls FSBA(), which does the actual setting. However, the actual ASL for FSBA() looks wrong (like someone at ASUS put an "if(0) { ... }" around the code) and I'm not sure it would actually work. FSBA only executes the FSB-changing code if Arg0 (0=100Mhz, 1=70Mhz) is greater than the value stored in \FS70. When it finishes, it stores Arg0 into \FS70. So by the time the system has booted, FSBA(1) has already been called (to set the FSB to 70Mhz) and further calls to FSBA() have no effect, since neither 0 nor 1 is greater than the value stored in \FS70...

So I basically just used the code in FSBA() as an example of how to do it, and ended up calling ECXW(), RCLK(), WCKB(), and WCLK() directly.

#9 kiwidrew

    Member

  • Members
  • 26 posts

Posted 30 November 2007 - 12:49 AM

Quote

Well I did the echo. The machine hard locked and the filesystem is corrupted. Ooops.
Yikes. Did you go straight from 70Mhz to 100Mhz, or did you briefly set it to 85Mhz on the way to 100Mhz? I've never tried going to 100Mhz directly, because the BIOS code includes a brief stop at 85Mhz and I figured it would be best to follow their example. :)

Thanks for the feedback, and I hope that you can get it working. If it still locks your machine, could you post the output of the command hexdump -C /proc/eee/pll?

#10 citivolus

    Advanced Member

  • Members
  • PipPipPip
  • 35 posts

Posted 30 November 2007 - 01:36 AM

Quote

Excellent! This weekend I'll work on a module for NHC to do this.
Do you mean allowing NHC to control the FSB, the Fan, or both? Can't wait to try it out!

#11 tristand

    Advanced Member

  • Members
  • PipPipPip
  • 53 posts
  • LocationOxford UK

Posted 30 November 2007 - 01:38 AM

Well Done!

Have you tried any underclocking with this method? I don't need extra speed right now but I'd love a low power mode for reading etc.. I think I'll hook my eee up to a PSU and ammeter tomorrow and see if reducing the speed significantly reduces current drain.

Any idea why the embedded controller needs to know the frequency? And any ideas of sensible values to try out for reduced speed?

#12 kiwidrew

    Member

  • Members
  • 26 posts

Posted 30 November 2007 - 02:47 AM

Quote

Well Done!

Have you tried any underclocking with this method? I don't need extra speed right now but I'd love a low power mode for reading etc.. I think I'll hook my eee up to a PSU and ammeter tomorrow and see if reducing the speed significantly reduces current drain.

Any idea why the embedded controller needs to know the frequency? And any ideas of sensible values to try out for reduced speed?
I briefly tried underclocking, but anything below a 70Mhz FSB and my external display went all funny. I haven't yet tried to track down what's going on with that... But in theory I don't see any problems with underclocking, and I'd be very interested to find out how low it can reliably go!

If you end up hooking your eee up to an ammeter, could you please also measure the power consumption in suspend-to-RAM mode?

The embedded controller is the really low-level brains of the eee, and it's running even when the main CPU is suspended or off. It handles the power button, the lid switch, the keyboard, the special Fn keys, the battery charging, and probably a bunch of other behind-the-scenes stuff. Importantly, it's in charge of the fan -- which might be the reason it'd want to know?

#13 fastmem

    New member

  • Members
  • 3 posts

Posted 30 November 2007 - 03:37 AM

Great work!
bogomips info:

ftp://sunsite.unc.ed...bogo-1.2.tar.gz
(0401 bios)
/proc/eee> cat pll | hexdump
0000000 c365 ffff 00f7 0100 070f 18e0 1b46 0024
(running firefox + Xorg)
eeepc-server:/> echo 85 24 0 > /proc/eee/fsb
eeepc-server:/> /bogomips
Calibrating delay loop.. ok - 1480.00 BogoMips
eeepc-server:/> echo 100 24 0 > /proc/eee/fsb
eeepc-server:/> /bogomips
Calibrating delay loop.. ok - 1760.00 BogoMips

(kill Xorg, only ttylinux)
eeepc-server:/> /bogomips
Calibrating delay loop.. ok - 1804.00 BogoMips
(1804.0/2 = 902.0)
cat /proc/eee/pll | hexdump
eeepc-server:/> cat /proc/eee/pll | hexdump
0000000 c365 ffff 00f7 0100 070f 18e0 1b64 0024

Edited by fastmem, 30 November 2007 - 04:04 AM.


#14 benob

    Advanced Member

  • Members
  • PipPipPip
  • 45 posts

Posted 30 November 2007 - 04:58 AM

Great job.however, my eee fsb only goes to 93mhz. above that: freeze+restart. I am running gutsy/2.6.21.4-eee with asus's binary modules loaded. I didn't check the windows overclocking section, so this may be a known issue (bios 0401).

#!/bin/sh
for i in `seq 70 100`
do
echo "going to fsb $i"
hexdump -C /proc/eee/pll > /fsb.$i
sync
echo $i 24 0 > /proc/eee/fsb
sleep 1
done

***** crash / reboot ****

cat /fsb.*
00000000 65 c3 ff ff f7 00 00 01 0f 07 e0 18 46 1b 24 00 |e...........F.$.|
00000000 65 c3 ff ff f7 00 00 01 0f 07 e0 18 46 1b 24 00 |e...........F.$.|
00000000 65 c3 ff ff f7 00 00 01 0f 07 e0 18 47 1b 24 00 |e...........G.$.|
00000000 65 c3 ff ff f7 00 00 01 0f 07 e0 18 48 1b 24 00 |e...........H.$.|
00000000 65 c3 ff ff f7 00 00 01 0f 07 e0 18 49 1b 24 00 |e...........I.$.|
00000000 65 c3 ff ff f7 00 00 01 0f 07 e0 18 4a 1b 24 00 |e...........J.$.|
00000000 65 c3 ff ff f7 00 00 01 0f 07 e0 18 4b 1b 24 00 |e...........K.$.|
00000000 65 c3 ff ff f7 00 00 01 0f 07 e0 18 4c 1b 24 00 |e...........L.$.|
00000000 65 c3 ff ff f7 00 00 01 0f 07 e0 18 4d 1b 24 00 |e...........M.$.|
00000000 65 c3 ff ff f7 00 00 01 0f 07 e0 18 4e 1b 24 00 |e...........N.$.|
00000000 65 c3 ff ff f7 00 00 01 0f 07 e0 18 4f 1b 24 00 |e...........O.$.|
00000000 65 c3 ff ff f7 00 00 01 0f 07 e0 18 50 1b 24 00 |e...........P.$.|
00000000 65 c3 ff ff f7 00 00 01 0f 07 e0 18 51 1b 24 00 |e...........Q.$.|
00000000 65 c3 ff ff f7 00 00 01 0f 07 e0 18 52 1b 24 00 |e...........R.$.|
00000000 65 c3 ff ff f7 00 00 01 0f 07 e0 18 53 1b 24 00 |e...........S.$.|
00000000 65 c3 ff ff f7 00 00 01 0f 07 e0 18 54 1b 24 00 |e...........T.$.|
00000000 65 c3 ff ff f7 00 00 01 0f 07 e0 18 55 1b 24 00 |e...........U.$.|
00000000 65 c3 ff ff f7 00 00 01 0f 07 e0 18 56 1b 24 00 |e...........V.$.|
00000000 65 c3 ff ff f7 00 00 01 0f 07 e0 18 57 1b 24 00 |e...........W.$.|
00000000 65 c3 ff ff f7 00 00 01 0f 07 e0 18 58 1b 24 00 |e...........X.$.|
00000000 65 c3 ff ff f7 00 00 01 0f 07 e0 18 59 1b 24 00 |e...........Y.$.|
00000000 65 c3 ff ff f7 00 00 01 0f 07 e0 18 5a 1b 24 00 |e...........Z.$.|
00000000 65 c3 ff ff f7 00 00 01 0f 07 e0 18 5b 1b 24 00 |e...........[.$.|
00000000 65 c3 ff ff f7 00 00 01 0f 07 e0 18 5c 1b 24 00 |e...........\.$.|

#15 benob

    Advanced Member

  • Members
  • PipPipPip
  • 45 posts

Posted 30 November 2007 - 05:09 AM

Quote

Great job.however, my eee fsb only goes to 93mhz. above that: freeze+restart. I am running gutsy/2.6.21.4-eee with asus's binary modules loaded. I didn't check the windows overclocking section, so this may be a known issue (bios 0401).

#!/bin/sh
for i in `seq 70 100`
do
echo "going to fsb $i"
hexdump -C /proc/eee/pll > /fsb.$i
sync
echo $i 24 0 > /proc/eee/fsb
sleep 1
done

***** crash / reboot ****

cat /fsb.*
00000000 65 c3 ff ff f7 00 00 01 0f 07 e0 18 46 1b 24 00 |e...........F.$.|
00000000 65 c3 ff ff f7 00 00 01 0f 07 e0 18 46 1b 24 00 |e...........F.$.|
00000000 65 c3 ff ff f7 00 00 01 0f 07 e0 18 47 1b 24 00 |e...........G.$.|
00000000 65 c3 ff ff f7 00 00 01 0f 07 e0 18 48 1b 24 00 |e...........H.$.|
00000000 65 c3 ff ff f7 00 00 01 0f 07 e0 18 49 1b 24 00 |e...........I.$.|
00000000 65 c3 ff ff f7 00 00 01 0f 07 e0 18 4a 1b 24 00 |e...........J.$.|
00000000 65 c3 ff ff f7 00 00 01 0f 07 e0 18 4b 1b 24 00 |e...........K.$.|
00000000 65 c3 ff ff f7 00 00 01 0f 07 e0 18 4c 1b 24 00 |e...........L.$.|
00000000 65 c3 ff ff f7 00 00 01 0f 07 e0 18 4d 1b 24 00 |e...........M.$.|
00000000 65 c3 ff ff f7 00 00 01 0f 07 e0 18 4e 1b 24 00 |e...........N.$.|
00000000 65 c3 ff ff f7 00 00 01 0f 07 e0 18 4f 1b 24 00 |e...........O.$.|
00000000 65 c3 ff ff f7 00 00 01 0f 07 e0 18 50 1b 24 00 |e...........P.$.|
00000000 65 c3 ff ff f7 00 00 01 0f 07 e0 18 51 1b 24 00 |e...........Q.$.|
00000000 65 c3 ff ff f7 00 00 01 0f 07 e0 18 52 1b 24 00 |e...........R.$.|
00000000 65 c3 ff ff f7 00 00 01 0f 07 e0 18 53 1b 24 00 |e...........S.$.|
00000000 65 c3 ff ff f7 00 00 01 0f 07 e0 18 54 1b 24 00 |e...........T.$.|
00000000 65 c3 ff ff f7 00 00 01 0f 07 e0 18 55 1b 24 00 |e...........U.$.|
00000000 65 c3 ff ff f7 00 00 01 0f 07 e0 18 56 1b 24 00 |e...........V.$.|
00000000 65 c3 ff ff f7 00 00 01 0f 07 e0 18 57 1b 24 00 |e...........W.$.|
00000000 65 c3 ff ff f7 00 00 01 0f 07 e0 18 58 1b 24 00 |e...........X.$.|
00000000 65 c3 ff ff f7 00 00 01 0f 07 e0 18 59 1b 24 00 |e...........Y.$.|
00000000 65 c3 ff ff f7 00 00 01 0f 07 e0 18 5a 1b 24 00 |e...........Z.$.|
00000000 65 c3 ff ff f7 00 00 01 0f 07 e0 18 5b 1b 24 00 |e...........[.$.|
00000000 65 c3 ff ff f7 00 00 01 0f 07 e0 18 5c 1b 24 00 |e...........\.$.|
"echo 100 24 1 > /proc/eee/fsb" works but I don't have an external display to test with.

#16 smgoller

    Advanced Member

  • Members
  • PipPipPip
  • 85 posts

Posted 30 November 2007 - 05:11 AM

Quote

Quote

Excellent! This weekend I'll work on a module for NHC to do this.
Do you mean allowing NHC to control the FSB, the Fan, or both? Can't wait to try it out!
Ideally both. But we don't have enough info for the Fan yet, so I'll implement the classes for FSB.

#17 eFfeM

    Senior Member

  • Members
  • 861 posts

Posted 30 November 2007 - 01:31 PM

@kiwidrew:
Cool, big gratz! I'll definitely try this right away tonight!

Btw: how did you discover the acpi info? Is this from analyzing the acpi source that has been disclosed?

(btw: does any of you happen to know a way to hack/configure the bios so it starts in 800x480. Currently it seems to start at 640x480 (at least I did not find a way to have the system start at 800x480; then use directfb).

edit: did a quick test. Works like a charm for me. I used the inbetween 85 step.
Going to 110 resulted in a black screen.
BTW where did you get this bogomips program. It is not in sysutils any more.
found some other version but that gives different numbers (only in the classic way); still enough to verify that things work though).

edit2: going immediately to 100 works for me too (only tested once; now keeping the system on for a while to test stability)

Edited by eFfeM, 30 November 2007 - 02:18 PM.

All opinions, information etc in this forum post is copyrighted by me (eFfeM) unless indicated otherwise.
You are free to reuse whatever you want to, provided that:
1) you give credit to me and eeeuser.com whenever you reuse anything for all things you reused.
2) you do not pretend or create the illusion that your modifications are mine. I'll be responsible for my junk, you for yours :)

#18 jeff3point0

    Advanced Member

  • Members
  • PipPipPip
  • 71 posts
  • LocationPort Orchard, WA

Posted 30 November 2007 - 08:49 PM

Andy, you is mah hero...:)

I've been waiting for this since i first heard the FSB was underclocked. I knew one of you kernel-hackin' types would get a solution out to us poor clueless masses sometime!

And gods know I needed the extra cycles for all that hardcore DOS gaming! :)
Hometown Hacker - IT for the Masses!

Black 4G, 2G RAM, Internal USB ports for a BackTrack dual boot, Eeebuntu 3.0.
Burnt Orange 901, 32GB SaberTooth-SS SSD, 2GB RAM, Ubuntu 10.04/BT4, SparkLAN WPEA-124N for wifi injection (now w/external RP-SMA connector!)

#19 benob

    Advanced Member

  • Members
  • PipPipPip
  • 45 posts

Posted 30 November 2007 - 09:28 PM

my eee won't come back from suspend-to-ram at 100. I wrote some acpi scripts to restore the factory frequency before going to sleep and reclock to 100Mhz at resume and everything is fine. However, at 100, the fan tends to quickly get rotating and kind of never stops. So, I modprobe p4-clockmod, cpufreq-ondemand and set the minimum frequency around 600mhz. This mainly keeps the cpu cool and the fan from rotating while providing 900mhz when needed.

Do you think this is a good approach to frequency scaling and head reduction (or battery saving)?
Is your module sleep-aware (does it need to be?)?

btw, I can post the scripts (ubuntu/gutsy) if needed by anybody.

#20 albal

    New member

  • Members
  • 3 posts

Posted 02 December 2007 - 07:15 PM

You should try running memtest86 at your new FSB bus speed and see if your memory can cope with it.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users