Hi all,
Thanks to Stepan's perseverence (thanks!), the m57sli-s4 code is now sufficiently merged into the v2 tree; the following is based on v2 checkout 2611.
I've reported before that there still seems to be something missing in the i2c initialization for the gigabyte m57sli-s4 board. The symptom I was seeing before was a very slow X start (30-50s delay) which can be fixed by adding
Option "NoDDC2"
to the "device" section of the X config file.
I tried playing with lm-sensors today, and sure enough, I can only read out a couple of sensors (the ones controlled by the k8temp module). There is another set of sensors on the SuperIO, which is detected by the lmsensors-detect script as
Found `ITE IT8716F Super IO Sensors' (but not activated)
The sensors-detect script is a perl script part of the lm-sensors package; you can also download the latest version here
http://www.lm-sensors.org/browser/lm-sensors/trunk/prog/detect/sensors-detec...
Under LinuxBIOS, the it87 module can not be loaded:
FATAL: Error inserting it87 (/lib/modules/2.6.20.1/kernel/drivers/hwmon/it87.ko): No such device
Under the proprietary bios, the sensors-detect script detects the IT8716F just fine. The it87 module can be loaded, which allows reading out of various system temperatures and fan speeds, as well as manual fan speed control.
Any clues as to what is going on here, and how to fix this?
Thanks, Ward.
On Wed, Apr 18, 2007 at 05:40:26PM -0400, Ward Vandewege wrote:
Found `ITE IT8716F Super IO Sensors' (but not activated)
--8<-- # Switch to the sensor logical device outb($addrreg, $superio{logdevreg}); outb($datareg, $chip->{logdev});
# Check the activation register outb($addrreg, $superio{actreg}); $val = inb($datareg); if (!($val & $superio{actmask})) { print "\n (but not activated)\n"; return; } -->8--
I guess LB doesn't activate the sensors part of the superio?
Under LinuxBIOS, the it87 module can not be loaded:
FATAL: Error inserting it87 (/lib/modules/2.6.20.1/kernel/drivers/hwmon/it87.ko): No such device
Is there anything informative in dmesg after this error?
//Peter
Ward,
The easy way You could compare the superio (ite8716) reg info between legacy BIOS and LinuxBIOS. Then you could update superio.c for ite8716 to set related registers, like some HWM for winbond 83627... I wonder some conf for fan etc may need some calibration.
YH
Hi YH,
On Wed, Apr 18, 2007 at 08:47:23PM -0700, yhlu wrote:
The easy way You could compare the superio (ite8716) reg info between legacy BIOS and LinuxBIOS.
Right. I've actually succeeded to activate the EC for the it8716f superio, and to enable fan control, by working from the datasheet and the it87 driver in the Linux kernel.
But I'd like to compare the registers to see the temperature/voltage sensor calibration that is done in the proprietary BIOS.
How would I read those registers from userspace? I've looked around with Google, but I can't seem to find an answer. I presume lspci is out, since the superio hangs off the isa bus.
Thanks, Ward.
Hi Ward
Thanks for your updated build description on the wiki. I think there is a list of build instructions on the list, where your description is not linked? http://www.linuxbios.org/Documentation#How-To.27s
Also the description of the filo payload still postulates that filo doesn't load sata disks. Which it does according to your build instructions.
I know i am a little biased... :-) but i think my proposed solution has some advantages over desoldering the flashrom. First desoldering with a heat gun poses the risk that you simple blow some of the tiny resistors away and second it is pretty easy to switch between the two flashroms which is quite neat in comparing register settings...
How would I read those registers from userspace? I've looked around with Google, but I can't seem to find an answer. I presume lspci is out, since the superio hangs off the isa bus.
I think thats inb for byte access and inw for word access (16 bit). You need to be root to do this though. The addresses can be taken right from the datasheet.
Best regards ST
Hi ST,
On Fri, Apr 27, 2007 at 10:32:43PM +0200, ST wrote:
Thanks for your updated build description on the wiki. I think there is a list of build instructions on the list, where your description is not linked? http://www.linuxbios.org/Documentation#How-To.27s
Right, I've added it.
Also the description of the filo payload still postulates that filo doesn't load sata disks. Which it does according to your build instructions.
It most certainly does. I've fixed the FILO page.
I know i am a little biased... :-) but i think my proposed solution has some advantages over desoldering the flashrom. First desoldering with a heat gun poses the risk that you simple blow some of the tiny resistors away and second it is pretty easy to switch between the two flashroms which is quite neat in comparing register settings...
Yes, absolutely. Your solution is better.
How would I read those registers from userspace? I've looked around with Google, but I can't seem to find an answer. I presume lspci is out, since the superio hangs off the isa bus.
I think thats inb for byte access and inw for word access (16 bit). You need to be root to do this though. The addresses can be taken right from the datasheet.
Right - I thought I could do this by dumping /dev/ports, but I can only see 4 (the superio EC controller lives at 0x290, with a control register at 0x295 and a data register at 0x296):
00000200 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff * 00000290 ff ff ff ff 32 0a 32 32 ff ff ff ff ff ff ff ff 000002a0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff *
So then I thought I needed to do what was described in the datasheet: write the index that I want to read out to the control register, and read the data from the data register:
#!/usr/bin/perl
sub io_read { my $offset = shift; open(TMP,'/dev/port'); seek(TMP,0x295,0); write(TMP,$offset,1); seek(TMP,0x296, 0); read(TMP,$tmp,1); close(TMP); printf("0x%02x\n",$tmp); return $tmp; }
io_read(0x14);
I'm obviously doing something wrong because I get 0x0 back, for any index, when running under LinuxBIOS, and 0x2 when running under the proprietary BIOS.
Thanks, Ward.
On Fri, Apr 27, 2007 at 10:32:43PM +0200, ST wrote:
I know i am a little biased... :-) but i think my proposed solution has some advantages over desoldering the flashrom. First desoldering with a heat gun poses the risk that you simple blow some of the tiny resistors away and second it is pretty easy to switch between the two flashroms which is quite neat in comparing register settings...
Btw, do you want to include your instructions page into the wiki and maintain it there? And/or create a copy of the instructions in the wiki?
Uwe.
* Ward Vandewege ward@gnu.org [070427 22:09]:
How would I read those registers from userspace? I've looked around with Google, but I can't seem to find an answer. I presume lspci is out, since the superio hangs off the isa bus.
check LinuxBIOSv2/util/probe_superio
On Thu, Apr 19, 2007 at 05:41:49AM +0200, Peter Stuge wrote:
I guess LB doesn't activate the sensors part of the superio?
That was my guess too.
Under LinuxBIOS, the it87 module can not be loaded:
FATAL: Error inserting it87 (/lib/modules/2.6.20.1/kernel/drivers/hwmon/it87.ko): No such device
Is there anything informative in dmesg after this error?
[20987.920000] i2c_adapter i2c-9191: ISA main adapter registered [20987.936000] it87: Device not activated, skipping
Looks like that might be the problem.
Thanks, Ward.
On Wed, Apr 18, 2007 at 11:48:42PM -0400, Ward Vandewege wrote:
On Thu, Apr 19, 2007 at 05:41:49AM +0200, Peter Stuge wrote:
I guess LB doesn't activate the sensors part of the superio?
That was my guess too.
I've managed to activate the 'environmental controller' (EC) on the gigabyte m57sli-s4's superio.
This now works:
====================================================================== # perl sensors-detect 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): Probing for Super-I/O at 0x2e/0x2f Trying family `National Semiconductor'... No Trying family `SMSC'... No Trying family `VIA/Winbond/Fintek'... No Trying family `ITE'... Yes Found `ITE IT8716F Super IO Sensors' Success! (address 0x290, driver `it87') ======================================================================
And I get output with the 'sensors' command:
====================================================================== # sensors k8temp-pci-00c3 Adapter: PCI adapter Core0 Temp: +39°C Core1 Temp: +40°C
it8716-isa-0290 Adapter: ISA adapter VCore: +1.30 V (min = +0.00 V, max = +4.08 V) VDDR: +1.94 V (min = +0.00 V, max = +4.08 V) +3.3V: +3.26 V (min = +0.00 V, max = +4.08 V) +5V: +4.87 V (min = +0.00 V, max = +6.85 V) +12V: +12.42 V (min = +0.00 V, max = +16.32 V) in5: +0.54 V (min = +0.00 V, max = +4.08 V) in6: +1.07 V (min = +0.00 V, max = +4.08 V) 5VSB: +4.87 V (min = +0.00 V, max = +6.85 V) VBat: +3.09 V fan1: 1618 RPM (min = 0 RPM) fan2: 1333 RPM (min = 0 RPM) fan3: 0 RPM (min = 0 RPM) temp1: +25°C (low = -1°C, high = +127°C) sensor = thermistor temp2: +128°C (low = -1°C, high = +127°C) sensor = diode temp3: +81°C (low = -1°C, high = +127°C) sensor = thermistor vid: +1.300 V ======================================================================
Most of these values seem ok or at least plausable - fan3 is not connected so that's correct; the value for temp2 and possibly temp3 is not correct.
This is what sensors tells me under the proprietary BIOS: ====================================================================== # sensors k8temp-pci-00c3 Adapter: PCI adapter Core0 Temp: +26°C Core1 Temp: +29°C
it8716-isa-0290 Adapter: ISA adapter VCore: +1.07 V (min = +0.00 V, max = +4.08 V) VDDR: +1.94 V (min = +0.00 V, max = +4.08 V) +3.3V: +3.26 V (min = +0.00 V, max = +4.08 V) +5V: +4.84 V (min = +0.00 V, max = +6.85 V) +12V: +12.42 V (min = +0.00 V, max = +16.32 V) in5: +0.90 V (min = +0.00 V, max = +4.08 V) in6: +0.66 V (min = +0.00 V, max = +4.08 V) 5VSB: +4.84 V (min = +0.00 V, max = +6.85 V) VBat: +3.10 V fan1: 1622 RPM (min = 0 RPM) fan2: 1336 RPM (min = 0 RPM) fan3: 0 RPM (min = 0 RPM) temp1: +25°C (low = +127°C, high = +127°C) sensor = thermistor temp2: -21°C (low = +127°C, high = +127°C) sensor = thermistor temp3: +31°C (low = +127°C, high = +127°C) sensor = diode vid: +1.100 V ======================================================================
Some of these are in agreement with what I get under LinuxBIOS - but the core0/core1 temperatures are more than 10 degrees off (that's in k8temp); Vcore is different; in5 and in6 are different; temp2 is *also* wrong (funny :), and temp3 is different; vid is different.
I guess I'm not quite there yet; this is what's logged when loading the it8716 module:
[ 14.860000] it87: Found IT8716F chip at 0x290, revision 0 [ 14.864000] it87: in3 is VCC (+5V) [ 14.868000] it87: in7 is VCCH (+5V Stand-By) [ 14.872000] i2c_adapter i2c-9191: Driver it87-isa registered [ 14.872000] i2c_adapter i2c-9191: client [it8716] registered with bus id 9191-0290 [ 14.872000] it87-isa 9191-0290: Detected broken BIOS defaults, disabling PWM interface
Funnily enough, if I load the it87 module with the following parameter
modprobe it87 fix_pwm_polarity=1
(which is a fix for some broken proprietary BIOS'es out there ;) it seems to be happier:
[ 797.956000] it87: Found IT8716F chip at 0x290, revision 0 [ 797.960000] it87: in3 is VCC (+5V) [ 797.964000] it87: in7 is VCCH (+5V Stand-By) [ 797.968000] i2c_adapter i2c-9191: Driver it87-isa registered [ 797.968000] i2c_adapter i2c-9191: client [it8716] registered with bus id 9191-0290 [ 797.968000] it87-isa 9191-0290: Reconfiguring PWM to active high polarity
And then I can set the fan speed :)
YH mentioned some initialization might be required for some of these readouts, so I guess I'll go back to the datasheet to see if I can figure something out.
In any case, patch attached to get at least this far.
Thanks, Ward.
Hi all,
So, here's a patch to enable fan control on the it8716f superio, as used in the gigabyte m57sli-s4 board. Patch attached.
This allows fan control by loading the it87 module (or compiling it87 support in your kernel), for instance via the /sys/ interface:
cat /sys/bus/i2c/devices/9191-0290/pwm1 128 -> fan running at half speed echo 255 > /sys/bus/i2c/devices/9191-0290/pwm1 -> fan goes to full speed
Be careful; there are no safeguards against turning the fans *off*...
This works great for me, but I'm not 100% sure about the pnp_dev_info structure values, see my other e-mail.
Thanks, Ward.
On Fri, Apr 27, 2007 at 05:08:50PM -0400, Ward Vandewege wrote:
Add fan control support.
Signed-off-by: Ward Vandewege ward@gnu.org
Just for book-keeping: this was committed in r2620.
Uwe.
Hi
This allows fan control by loading the it87 module (or compiling it87 support in your kernel), for instance via the /sys/ interface:
cat /sys/bus/i2c/devices/9191-0290/pwm1 128 -> fan running at half speed echo 255 > /sys/bus/i2c/devices/9191-0290/pwm1 -> fan goes to full speed
Be careful; there are no safeguards against turning the fans *off*...
Mh, i just tried it and doesn't work for me :-(. Probably i am to tired and did a stupid mistake. But well i still can't load the it87 module. But my tree has the changes in superio.c. Hints are welcome :-). Probably im am missing a kernel driver or so? Ward i have also the problem that i don't see any classic PCI cards on my machine (with linuxbios, works with stock bios), can you confirm this? I see all the nvidia stuff and the video card though.
I have written a small c program which reads out the values of the ec controller. It works for me under stock bios but gives "ff" on all reads under linuxbios :-(. Ward it would be nice if you could try it on your machine... and yes i was a little bit off with my statement can be take right of the datasheet. The program needs to be run as root or gives an access error.
Attached is also the output of the program on my machine under i386 and amd64. Keep in mind that some of the registers are fan and temperature input so they differ.
Concerning the question of Uwe, yes if you like i can maintain it on the wiki but i need an account?
Good night ST
On Sat, Apr 28, 2007 at 01:43:56AM +0200, ST wrote:
Concerning the question of Uwe, yes if you like i can maintain it on the wiki but i need an account?
Sure, no problem. Stefan or Ron can surely create one, see http://linuxbios.org/index.php?title=Special:Userlogin
Uwe.
Hi ST,
On Sat, Apr 28, 2007 at 01:43:56AM +0200, ST wrote:
Mh, i just tried it and doesn't work for me :-(. Probably i am to tired and did a stupid mistake. But well i still can't load the it87 module. But my tree has the changes in superio.c. Hints are welcome :-). Probably im am missing a kernel driver or so?
I suspect you don't have the other patch that was submitted under r2620 - the changes to Config.lb for the m57sli-s4 ?
Ward i have also the problem that i don't see any classic PCI cards on my machine (with linuxbios, works with stock bios), can you confirm this? I see all the nvidia stuff and the video card though.
I'll look into that next week, when I'm back at the office.
I have written a small c program which reads out the values of the ec controller. It works for me under stock bios but gives "ff" on all reads under linuxbios :-(. Ward it would be nice if you could try it on your machine... and yes i was a little bit off with my statement can be take right of the datasheet. The program needs to be run as root or gives an access error.
Sure, I had figured that much; my perl script still didn't work. I'll give your program a go and get back to you next week.
Attached is also the output of the program on my machine under i386 and amd64. Keep in mind that some of the registers are fan and temperature input so they differ.
Very helpful, thanks!
Thanks, Ward.