Ported lm80 to Linux 2.6
Quoting Tiago Sousa <[email protected]>:
Quoted 3 lines
Hi Jean, I'm not sure who to talk to, but since you wrote the i2c porting guide and ported lm83, here I am. If you prefer, please redirect me to the "proper channels" :)
The LM Sensors mailing-list is the correct address to send this kind of news to.
Quoted 2 lines
I'm inexperienced in kernel coding but your guide is very helpful and it wasn't hard to port the lm80, looking at the lm83.
Glad you liked it. If you have suggestions about it, please let me know so that I can make it even more helpful.
Quoted 7 lines
The sensors-detect detects this chip on my board, although it returns kind of bugus values, even in linux 2.4. Most of them never change, like the
temp_input1which is what I really care about, so I presume it's not a problem of sensors.conf or anything, but rather a hardware malfunction of some sort. The driver/sensor that works for me is via686a. But since lm80 is detected and it was missing in 2.6, I decided to try to port it.
Funny story. Usually people would report that the via686a (which is the "native" sensor chips) driver reports bogus values, and need to use another chipset the motherboard maker added. In fact it doesn't make sense at all that the motherboard maker would have added an LM80 on the board if they did not plan to actually use it. I think I remember that the LM80 is a hard to detect chip, so I wouldn't be surprised at all if what you have is *not* an LM80 but something else. If you want us to take a look, please provide the output of "i2cdetect 1 0x2d" (where 1 is the bus number and 0x2d the address of the LM80; adapt values to your case).
Quoted 7 lines
But enough of history. The driver appears to work because it returns the same values as the driver from
lm_sensorsin Linux 2.4, but I can't be sure, since I don't really use the driver. I was hoping you could put this "in the loop" and test it, or pass it to someone who can. I believe most of the work is done, probably just needs some tweaking (I multiplied in_* andtemp_input1by 10, to match the values from linux 2.4, for example).
This is very nice to you. I don't have such a chip myself, but know of one potential tester (Lennard Klein). If other people on this list do have hardware for testing, please speak up.
The tweakings are required because base units (aka magnitudes) were changed from 2.4 to 2.6. For the temperatures, we moved from tenths or hundredths to thousandths of degrees, thus the need you had to multiply by 10 to get correct readings.
Quoted 3 lines
Attached is the complete
lm80.cported to Linux 2.6. It's based onlm80.cfromlm_sensors2.8.3. Please let me know if you want me to do any major changes.
Looks good at first sight, except a few alignment problems, but that's unimportant. I can't speak for the code details now, I would have to take a deeper look, unless someone else wants to.
I repost your file unchanged to the list so that everyone can take a look.
Quoted 1 line
Hope this helps,
Indeed it does. Porting chip drivers requires time, although it is not very complex, as you may have noticed. So any help we can get is welcome, and I know that the lm80 driver was awaited by many folks.
Thanks a lot :)
Signature · 10 lines
Jean Delvare http://www.ensicaen.ismra.fr/~delvare/ -------------- next part -------------- A non-text attachment was scrubbed... Name: lm80.c Type: application/octet-stream Size: 20666 bytes Desc: not available Url : http://lists.lm-sensors.org/pipermail/lm-sensors/attachments/20040210/298e91bf/lm80.obj
Quoting Tiago Sousa <[email protected]>:
Quoted 1 line
darksun:~# i2cdetect 0 0x2d
Oh sorry I told you wrong. I really meant i2cdump, not i2cdetect. And unloading lm80 before dumping is suggested.
Quoted 2 lines
I'm not too concerned with the LM80 chip because via686a has the info I really need.
Sure, I understand.
Quoted 5 lines
Also, as stated in the 2.6 kernel information on the
lm_sensorssite, the via686a and i2c-viapro don't work together, so I've been using only i2c-isa with via686a, and not i2c-viapro with lm80 too. Just pointed this out, in case it makes a difference to the detection process (probably not because LM80 is also detected in kernel 2.4).
Doesn't make any difference, but this reminds me that we should investigate the problem.
I have commited an update to sensors-detect to our CVS repository. I'd be interested in you trying it. It is supposed to refine the LM80 detection procedure. I hope that it won't detect whatever-your-chip-is as an LM80 anymore.
Thanks.
Signature · 2 lines
Jean Delvare http://www.ensicaen.ismra.fr/~delvare/
Oh, I forgot a question: which motherboard do you have?
Thanks.
Signature · 2 lines
Jean Delvare http://www.ensicaen.ismra.fr/~delvare/
Sorry for the delay but I've been rather busy, and I'll be out for the weekend too.
Quoted 1 line · Jean Delvare
Oh, I forgot a question: which motherboard do you have?
An MSI K7T Turbo Socket-A KT133A ATX.
Quoted 6 lines
I think I remember that
the LM80 is a hard to detect chip, so I wouldn't be surprised at all if what you have is *not* an LM80 but something else. If you want us to take a look, please provide the output of "i2cdetect 10x2d" (where 1 is the bus number and0x2dthe address of the LM80; adapt values to your case).
relevant sensors-detect output:
Driver `lm80' (should be inserted):
Detects correctly:
* Bus SMBus Via Pro adapter at 5000' (Algorithm unavailable)
Busdriver 2c-viapro', I2C address 0x2d
Chip National Semiconductor LM80' (confidence: 3)
i2cdetect:
darksun:~# i2cdetect 0 0x2d WARNING! This program can confuse your I2C bus, cause data loss and worse! I will probe file /dev/i2c-0 You have five seconds to reconsider and press CTRL-C!
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX 10: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX 20: XX XX XX XX XX XX XX XX XX XX XX XX XX UU XX XX 30: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX 40: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX 50: 50 51 XX XX XX XX XX XX XX XX XX XX XX XX XX XX 60: XX XX XX XX XX XX XX XX XX 69 XX XX XX XX XX XX 70: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX
I'm not too concerned with the LM80 chip because via686a has the info I really need.
Also, as stated in the 2.6 kernel information on the lm_sensors site, the via686a and i2c-viapro don't work together, so I've been using only i2c-isa with via686a, and not i2c-viapro with lm80 too. Just pointed this out, in case it makes a difference to the detection process (probably not because LM80 is also detected in kernel 2.4).
Have a nice weekend folks :)
Tiago Sousa
Quoting Tiago Sousa <[email protected]>:
Quoted 6 lines
darksun:~# isadump -f 0x6000 WARNING! Running this program can cause system crashes, data loss and worse! I will probe address range 0x6000 to 0x60ff. You have five seconds to reconsider and press CTRL-C!
Quoted 6 lines
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 10: 00 00 00 ce e2 ff 26 85 00 00 00 00 00 c7 b7 81 20: d0 96 91 15 cf c2 c5 7f 7f 9d 00 d2 a8 e7 bd e4 30: ba de b5 dc b4 ff ff ff ff c7 b7 e1 e1 c7 b7 a2 40: 01 13 16 00 00 00 00 50 2d 85 00 40 00 00 00 00
^^
Which happens to be the i2c address of the chip. Same result from the other reporter. It might not be a coincidence.
Quoted 2 lines
Even my untrained eyes see the similarities. Seems you've hit jackpot. :)
Of course you have to limit the comparison to addresses 0x10-0x4f, but yes, there are many similitudes, far too many to be a coincidence ;)
Signature · 2 lines
Jean Delvare http://www.ensicaen.ismra.fr/~delvare/
Quoted 6 lines
darksun:~# i2cdump 0 0x2d No size specified (using byte-data access) WARNING! This program can confuse your I2C bus, cause data loss and worse! I will probe file /dev/i2c-0, address 0x2d, mode byte You have five seconds to reconsider and press CTRL-C! (...)
Interesting. I will analyze the data and try to summarize some facts. Could you dump the chip again under high load? If it is some temperature sensor, we should see at least one register increase.
I also have dumps from another user, and I'll try to compare yours and his, so as to locate invariant registers (which are candidates for chip or manufacturer ID).
Quoted 4 lines
Indeed, it no longer detects LM80 nor any other in its place. Does this mean that I have a non-identified sensor chip, or that it doesn't exist at all? In any case, if you require further tests, I'll be glad to help.
You got it right, it is unknown so far. We never took the time to investigate because usually people have the via686a working well so they don't need more. That time I'll try to gather more data and maybe I'll learn something.
Signature · 2 lines
Jean Delvare http://www.ensicaen.ismra.fr/~delvare/
Quoted 6 lines · Jean Delvare
Quoted 3 lines
Interesting. I will analyze the data and try to summarize some facts. Could you dump the chip again under high load? If it is some temperature sensor, we should see at least one register increase.
Here they are, baked at 75 C :)
Thanks. I have more information since yesterday. It happens that this mysterious chip is simply your via686a chip, except that you access it through the SMBus instead of ISA. Until then I didn't know that this chip could possibly be accessed that way.
Now, there's a theory I would like to confirm, if you can provide one more dump. I'd like you to load i2c-isa and via686a. Then note the address of the via686a. If should be relatively high (such as 0x5800 or 0x6000). Then unload via686a and dump it using the following command:
isadump -f 0x<address>
This should give you a dump similar to what i2cdump gave you so far. Please send it to me :)
Thanks.
(BTW, your lm80 driver will be part of Linux 2.6.4, in case I didn't already told you! Congratulations.)
Signature · 2 lines
Jean Delvare http://www.ensicaen.ismra.fr/~delvare/
Hello, I've just installed lm_sensors2 from CVS. Here are the results:
Quoted 2 lines · Jean Delvare
Oh sorry I told you wrong. I really meant i2cdump, not i2cdetect. And unloading lm80 before dumping is suggested.
darksun:~# i2cdump 0 0x2d No size specified (using byte-data access) WARNING! This program can confuse your I2C bus, cause data loss and worse! I will probe file /dev/i2c-0, address 0x2d, mode byte You have five seconds to reconsider and press CTRL-C!
0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef 00: 01 13 16 00 00 00 00 50 ad 45 00 40 00 00 00 00 ???....P?E.@.... 10: 00 00 00 c5 0d ff 6d 87 00 00 00 00 00 ce c7 80 ...??.m?.....??? 20: cf 95 91 15 cf c2 c5 7f 7f 9e 00 d2 a8 e7 bd e4 ??????????.????? 30: ba de b5 dc b4 ff ff ff ff ae a4 e1 e1 c7 c0 a2 ?????....??????? 40: 01 00 00 00 00 00 00 50 ad 45 00 40 00 00 00 00 ?......P?E.@.... 50: 00 00 00 80 7e ff e4 80 00 00 00 00 00 ce c7 80 ...?~.??.....??? 60: cf 95 91 15 cf c2 c5 7f 7f 9e 00 d2 a8 e7 bd e4 ??????????.????? 70: ba de b5 dc b4 ff ff ff ff ae a4 e1 e1 c7 c0 a2 ?????....??????? 80: 01 00 00 00 00 00 00 50 ad 45 00 40 00 00 00 00 ?......P?E.@.... 90: 00 00 00 30 46 ff 59 81 00 00 00 00 00 ce c7 80 ...0F.Y?.....??? a0: cf 95 91 15 cf c2 c5 7f 7f 9e 00 d2 a8 e7 bd e4 ??????????.????? b0: ba de b5 dc b4 ff ff ff ff ae a4 e1 e1 c7 c0 a2 ?????....??????? c0: 01 00 00 00 00 00 00 50 ad 45 00 40 00 00 00 00 ?......P?E.@.... d0: 00 00 00 80 7e ff ce 80 00 00 00 00 00 ce c7 80 ...?~.??.....??? e0: cf 95 91 15 cf c2 c5 7f 7f 9e 00 d2 a8 e7 bd e4 ??????????.????? f0: ba de b5 dc b4 ff ff ff ff ae a4 e1 e1 c7 c0 a2 ?????....???????
Quoted 4 lines
I have commited an update to sensors-detect to our CVS repository. I'd be interested in you trying it. It is supposed to refine the LM80 detection procedure. I hope that it won't detect whatever-your-chip-is as an LM80 anymore.
Driver `eeprom' (should be inserted):
Detects correctly:
* Bus SMBus Via Pro adapter at 5000' (Algorithm unavailable) Busdriver i2c-viapro', I2C address 0x50
Chip `SPD EEPROM' (confidence: 8)
* Bus SMBus Via Pro adapter at 5000' (Algorithm unavailable) Busdriver i2c-viapro', I2C address 0x51
Chip `SPD EEPROM' (confidence: 8)
Driver `via686a' (should be inserted):
Detects correctly:
* ISA bus, undetermined address (Busdriver `i2c-isa')
Chip `VIA Technologies VT82C686 Integrated Sensors' (confidence: 9)
Indeed, it no longer detects LM80 nor any other in its place. Does this mean that I have a non-identified sensor chip, or that it doesn't exist at all? In any case, if you require further tests, I'll be glad to help.
--
Tiago Sousa
Quoted 3 lines · Jean Delvare
Interesting. I will analyze the data and try to summarize some facts. Could you dump the chip again under high load? If it is some temperature sensor, we should see at least one register increase.
Here they are, baked at 75 C :)
0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef 00: 01 13 16 00 00 00 00 50 ad 35 00 00 00 00 00 00 ???....P?5...... 10: 00 00 00 7f 60 ff 3c 8b 00 00 00 00 00 ce c7 81 ...?`.<?.....??? 20: d8 96 91 14 ce c2 c6 7f 7f 9e 00 d2 a8 e7 bd e4 ??????????.????? 30: ba de b5 dc b4 ff ff ff ff ae a4 e1 e1 c7 c0 a2 ?????....??????? 40: 01 13 16 00 00 00 00 50 ad 35 00 00 00 00 00 00 ???....P?5...... 50: 00 00 00 27 1d ff b7 81 00 00 00 00 00 ce c7 81 ...'?.??.....??? 60: d8 96 91 14 ce c2 c6 7f 7f 9e 00 d2 a8 e7 bd e4 ??????????.????? 70: ba de b5 dc b4 ff ff ff ff ae a4 e1 e1 c7 c0 a2 ?????....??????? 80: 01 00 00 00 00 00 00 50 ad 35 00 00 00 00 00 00 ?......P?5...... 90: 00 00 00 d8 31 ff 35 81 00 00 00 00 00 ce c7 81 ...?1.5?.....??? a0: d8 96 91 14 ce c2 c6 7f 7f 9e 00 d2 a8 e7 bd e4 ??????????.????? b0: ba de b5 dc b4 ff ff ff ff ae a4 e1 e1 c7 c0 a2 ?????....??????? c0: 01 00 00 00 00 00 00 50 ad 35 00 00 00 00 00 00 ?......P?5...... d0: 00 00 00 27 37 ff bc 81 00 00 00 00 00 ce c7 81 ...'7.??.....??? e0: d8 96 91 14 ce c2 c6 7f 7f 9e 00 d2 a8 e7 bd e4 ??????????.????? f0: ba de b5 dc b4 ff ff ff ff ae a4 e1 e1 c7 c0 a2 ?????....???????
--
Tiago Sousa
Quoted 5 lines · Jean Delvare
Now, there's a theory I would like to confirm, if you can provide one more dump. I'd like you to load i2c-isa and via686a. Then note the address of the via686a. If should be relatively high (such as
0x5800or0x6000). Then unload via686a and dump it using the following command:
isadump -f 0x<address>
darksun:~# isadump -f 0x6000 WARNING! Running this program can cause system crashes, data loss and worse! I will probe address range 0x6000 to 0x60ff. You have five seconds to reconsider and press CTRL-C!
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 10: 00 00 00 ce e2 ff 26 85 00 00 00 00 00 c7 b7 81 20: d0 96 91 15 cf c2 c5 7f 7f 9d 00 d2 a8 e7 bd e4 30: ba de b5 dc b4 ff ff ff ff c7 b7 e1 e1 c7 b7 a2 40: 01 13 16 00 00 00 00 50 2d 85 00 40 00 00 00 00 50: 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 60: 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 70: 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 90: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
a0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
b0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
c0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
d0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
e0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
f0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
Quoted 2 lines
This should give you a dump similar to what i2cdump gave you so far. Please send it to me :)
Even my untrained eyes see the similarities. Seems you've hit jackpot. :)
Quoted 2 lines
(BTW, your lm80 driver will be part of Linux 2.6.4, in case I didn't already told you! Congratulations.)
Great! As small a contribution as it is, it makes me happy to be able to help the project.
--
Tiago Sousa