eeprom driver
You can read the contents of the eeproms more directly my looking in the directories /proc/sys/dev/sensors/*eeprom*. It is possible that that slot is having issues. Although your computer sounds like it is running correctly?? If the eeprom(s) were unreadable, then at least that DIMM would not be used for RAM for the system since the DIMM contains the timings and such.
Phil
Quoted 65 lines · Jean Delvare
Hello
I'm using your i2c/lm_sensors eeprom driver and it seems there is something not working in my case.
The system is a Sony Vaio laptop (PCG-GR214EP) recently bought in France. The only thing sensors(-detect) will see are the memory slots. There are two SO-DIMM slots.
sensors-detect will see them, first with confidence 8, second with confidence 1 only.
When then running sensors, the first slot is read correctly :
eeprom-i2c-0-50
Adapter: SMBus I801 adapter at 1880 Algorithm: Non-I2C SMBus adapter Memory type : SDRAM DIMM SPD SDRAM Size (MB): 256But the second slot won't show anything :
eeprom-i2c-0-57
Adapter: SMBus I801 adapter at 1880
Algorithm: Non-I2C SMBus adapterIf I swap the two memory chips I own (128Mb and 256Mb), the first slot will say 128, and the second one keep silent, so the issue is a slot-level one.
I guess that something is not-standard with the second slot, which explains why the confidence level was that low. I'm willing to help you analyse the problem and find out how to solve it.
If it helps, loaded modules are :
eeprom
i2c-proc
i2c-i801
i2c-coreand
/proc/buscontains :i2c
i2c-0cat i2c says :
i2c-0 smbus SMBus I801 adapter at 1880 Non-I2C SMBus adapter
cat i2c-0 says :
cat: i2c-0: Invalid argument
If you want me to run tests, debug something... just tell me what to do. I think I got the required skills.
Thanks.
Signature · 4 lines
/~~ Jean "Khali" Delvare -----\_ mail: [email protected] --------\ http://www.ensicaen.ismra.fr/~delvare/ ---=ISMRA/- ____________________________________________________
Signature · 3 lines
Philip Edelbrock -- IS Manager -- Edge Design, Corvallis, OR [email protected] -- http://www.netroedge.com/~phil PGP F16: 01 D2 FD 01 B5 46 F4 F0 3A 8B 9D 7E 14 7F FB 7A
You know, I thought 57 was a funny address for your DIMM. My guess is that it is something else, as you are thinking. In the past, Xeon processors had a eeprom in them which appeared in addresses high like
57. But, I'm still curious why only your first slot is detected and your second is not. Anyways, thanks for the detective work thus far!
Phil
Quoted 39 lines · Mark D. Studebaker
The
print_eeprom()code inprog/sensors/chips.cwill only print out the SDRAM information if the chip is coded as an SDRAM, that is, location0x02contains0x04.If you send the output of either i2cdump or cat
/proc/sys/dev/sensors/*eeprom*/*
we can look at it.mds
Quoted 27 lines · Jean Delvare
I have been testing many things about my eeprom driver issue.
Tried reading 256 bytes instead of 128, in case both memory slots would have been "serialized" in some way. No result.
Tried reading more than 256 bytes (320) to see if there were something intersting there. In fact, it seems that we are wrapped back to offset 0 when moving past 256. No result.
Tried two other addresses detected on my i2c bus (namely 30 and 37). No result (except turning the power off.)
Another thing to notice is that when I swap my two memory modules, the (wrong) data at address 57 doesn't change at all.
My conclusion is that address 57 is *not* the secondary slot, which may be simply not reachable. Maybe I will ask Sony people about that, but I doubt I will obtain any information.
Thanks for your attention.
--
/~~ Jean "Khali" Delvare
-----\_ mail: [email protected]
--------\ http://www.ensicaen.ismra.fr/~delvare/
---=ISMRA/- ____________________________________________________
Signature · 3 lines
Philip Edelbrock -- IS Manager -- Edge Design, Corvallis, OR [email protected] -- http://www.netroedge.com/~phil PGP F16: 01 D2 FD 01 B5 46 F4 F0 3A 8B 9D 7E 14 7F FB 7A
Yeah, at a glance, the 0x57 doesn't look like a valid SPD DIMM. The 0x50-0x57 range is almost always for eeproms connected to the I2C bus, so it doesn't have to be a DIMM. Like I said, some processors, like Xeons have an eepom on them which show up on the system's I2C/SMBus.
BTW- Have you tried running eeprom-decode.pl? It's in lm-sensors/prog/eeprom, I think. It can help decode the values of your valid SPD DIMM (timing and such). There is also a checksum value which it computes and compared with what is stored on the chip. If the checksum isn't valid, then it is almost certainly evidence that the chip isn't on a DIMM (or is corrupted).
Phil
Quoted 110 lines · Jean Delvare
Quoted 4 lines
The
print_eeprom()code inprog/sensors/chips.cwill only print out the SDRAM information if the chip is coded as an SDRAM, that is, location0x02contains0x04.Which is the case for
0x50but not for0x57(in my case) so it works as expected.Quoted 3 lines
If you send the output of either i2cdump or cat
/proc/sys/dev/sensors/*eeprom*/*
we can look at it.root@arrakis:~# cat `ls -v /proc/sys/dev/sensors/eeprom-i2c-0-50/*` 128 8 4 12 9 2 64 0 1 117 84 0 128 16 0 1 15 4 6 1 1 0 14 160 96 255 255 20 15 20 45 16 21 8 21 8 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 18 11 193 73 78 70 73 78 69 79 69 72 89 83 54 52 86 49 54 50 50 48 71 68 76 45 55 46 53 3 201 1 56 3 59 173 177 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 100 199 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255root@arrakis:~# cat `ls -v /proc/sys/dev/sensors/eeprom-i2c-0-57/*` 0 0 0 0 0 0 0 255 255 255 255 255 255 255 255 255 17 67 101 64 75 102 17 198 130 218 8 0 70 67 209 98 69 85 48 54 48 51 0 0 0 0 0 0 0 0 0 0 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 80 67 71 45 71 82 50 49 52 69 80 40 70 82 41 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 48 49 0 0 0 0 0 0 0 0 56 56 52 77 27 81 80 80 134 0 0 0 0 0 0 0 0 0 1 5 117 0 50 56 51 51 51 51 53 52 45 53 52 54 49 52 49 48 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 49 49 47 49 53 47 48 49 32 49 51 58 50 54 58 51 55 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0(Note that I modified the eeprom driver to show 256 bytes instead of 128.)
The same with i2cdump, in case you prefer.
root@arrakis:/usr/src/lm_sensors-CVS/prog/dump# ./i2cdump 0 0x50 Warning: 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 0x50, 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
00: 80 08 04 0c 09 02 40 00 01 75 54 00 80 10 00 01 10: 0f 04 06 01 01 00 0e a0 60 ff ff 14 0f 14 2d 10 20: 15 08 15 08 ff ff ff ff ff ff ff ff ff ff ff ff 30: ff ff ff ff ff ff ff ff ff ff ff ff ff ff 12 0b 40: c1 49 4e 46 49 4e 45 4f 45 48 59 53 36 34 56 31 50: 36 32 32 30 47 44 4c 2d 37 2e 35 03 c9 01 38 03 60: 3b ad b1 ff ff ff ff ff ff ff ff ff ff ff ff ff 70: ff ff ff ff ff ff ff ff ff ff ff ff ff ff 64 c7 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 ffroot@arrakis:/usr/src/lm_sensors-CVS/prog/dump# ./i2cdump 0 0x57 Warning: 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 0x57, 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
00: 00 00 00 00 00 00 00 ff ff ff ff ff ff ff ff ff 10: 11 43 65 40 4b 66 11 c6 82 da 08 00 46 43 d1 62 20: 45 55 30 36 30 33 00 00 00 00 00 00 00 00 00 00 30: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 40: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 50: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 60: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 70: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 80: 50 43 47 2d 47 52 32 31 34 45 50 28 46 52 29 00 90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
a0: 30 31 00 00 00 00 00 00 00 00 38 38 34 4d 1b 51
b0: 50 50 86 00 00 00 00 00 00 00 00 00 01 05 75 00
c0: 32 38 33 33 33 33 35 34 2d 35 34 36 31 34 31 30
d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
e0: 31 31 2f 31 35 2f 30 31 20 31 33 3a 32 36 3a 33
f0: 37 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00I remind you that
0x50is the first SO-DIMM slot, working as expected. The two questions that remain unsolved are :
1* Why is the second slot not available ?
2* What is showing at0x57?Signature · 4 lines
/~~ Jean "Khali" Delvare -----\_ mail: [email protected] --------\ http://www.ensicaen.ismra.fr/~delvare/ ---=ISMRA/- ____________________________________________________
Signature · 3 lines
Philip Edelbrock -- IS Manager -- Edge Design, Corvallis, OR [email protected] -- http://www.netroedge.com/~phil PGP F16: 01 D2 FD 01 B5 46 F4 F0 3A 8B 9D 7E 14 7F FB 7A
I think all the related eeprom decode stuff (SPD, Xeon, etc.) was from Intel's web site. Thankfully, Intel does a reasonable job documenting things and providing them to the development community.
Phil
Quoted 23 lines · Jean Delvare
Quoted 7 lines
BTW- Have you tried running eeprom-decode.pl? It's in lm-sensors/prog/eeprom, I think. It can help decode the values of your valid SPD DIMM (timing and such). There is also a checksum value which it computes and compared with what is stored on the chip. If the checksum isn't valid, then it is almost certainly evidence that the chip isn't on a DIMM (or is corrupted).
I guess you refer to decode-dimms.pl. Yes, I tried it. It gives correct results for
0x50and awful garbage for0x57.I also just tried
xeon/decode-xeon.pl. No resulult either.If byte at
0x02has a class meaning (0x04for DIMMs, you said), is there a reference about this? It would help to know what kind of item0x00is supposed to be.Signature · 4 lines
/~~ Jean "Khali" Delvare -----\_ mail: [email protected] --------\ http://www.ensicaen.ismra.fr/~delvare/ ---=ISMRA/- ____________________________________________________
Signature · 3 lines
Philip Edelbrock -- IS Manager -- Edge Design, Corvallis, OR [email protected] -- http://www.netroedge.com/~phil PGP F16: 01 D2 FD 01 B5 46 F4 F0 3A 8B 9D 7E 14 7F FB 7A
I think this was noted as a laptop. Some of the strangest hardware and I2C configurations are on laptops. Sometimes battery/power controllers and backlight controls may be on the SMBus/I2C, although I'm guessing that the 0x57 isn't much more than a eeprom. Perhaps even for the Bios?
Phil
Quoted 9 lines · Mark Studebaker
The
0x57eeprom is clearly set up for some non-volatile storage on the motherboard. I see a lot of ASCII numbers and letters;
At row E0, for example, is "11/15/01 13:26:37"
This answers your second question.Your first question (why the second slot doesn't make an appearance), I have no idea.
mds
Signature · 3 lines
Philip Edelbrock -- IS Manager -- Edge Design, Corvallis, OR [email protected] -- http://www.netroedge.com/~phil PGP F16: 01 D2 FD 01 B5 46 F4 F0 3A 8B 9D 7E 14 7F FB 7A
BTW- If it saves effort, you could access the eeprom's more directly through the /dev/i2c* interface. You wouldn't be dependant on the eeprom module that way, although you would need to be careful not to accidentially write data to the eeprom. See prog/dump/i2c-dump.c for an example, and then look at the eeprom.c driver for the i2c sequence to read a value from eeprom (it's a write [to set the address pointer in eeprom memory] followed by a read, I think).
Phil
Quoted 42 lines · Jean Delvare
Quoted 2 lines
I think all three we could use if you would like to submit patches.
I will.
Quoted 5 lines
On 1), what I kept meaning to do but never did, can you rename the /proc names from "0-15", for example, to "00" or "00-0F" or "0x00-0x0F" or something similar, so that when you "cat *" at least the results come out in the right alphabetical order?
That's bitten me more than once...I agree. It makes things much more complicated for everyone, even if "ls -v" can help for this particular point.
Anyway, I won't modify that unless anyone agrees. I'm rather new to this project and this ain't a decision I can make alone. If I am the one who decides, I would even remove the heading "data" and remove the end address, since it can be deduced from the start address. I would have something like that :
eeprom-i2c-0-50/00
eeprom-i2c-0-50/10
eeprom-i2c-0-50/20
eeprom-i2c-0-50/30
eeprom-i2c-0-50/40
eeprom-i2c-0-50/50
eeprom-i2c-0-50/60
eeprom-i2c-0-50/70Now, I don't know everything about the needs of everyone, so I'd like to know what people think about it. What's sure is that it would require to rewite some utils, such as the dimms decoder.
So, please, everyone let me know if it is a good idea or not.
(Anyway, it does *note* need to be changed right now. I can submit my patches and wait some time that we all agree if a change in the file names is a good thing or not.)
Signature · 4 lines
/~~ Jean "Khali" Delvare -----\_ mail: [email protected] --------\ http://www.ensicaen.ismra.fr/~delvare/ ---=ISMRA/- ____________________________________________________
Signature · 3 lines
Philip Edelbrock -- IS Manager -- Edge Design, Corvallis, OR [email protected] -- http://www.netroedge.com/~phil PGP F16: 01 D2 FD 01 B5 46 F4 F0 3A 8B 9D 7E 14 7F FB 7A
The print_eeprom() code in prog/sensors/chips.c will only print out the SDRAM information if the chip is coded as an SDRAM, that is, location 0x02 contains 0x04.
If you send the output of either i2cdump or cat/proc/sys/dev/sensors/*eeprom*/*
we can look at it.
mds
Quoted 27 lines · Jean Delvare
I have been testing many things about my eeprom driver issue.
Tried reading 256 bytes instead of 128, in case both memory slots would have been "serialized" in some way. No result.
Tried reading more than 256 bytes (320) to see if there were something intersting there. In fact, it seems that we are wrapped back to offset 0 when moving past 256. No result.
Tried two other addresses detected on my i2c bus (namely 30 and 37). No result (except turning the power off.)
Another thing to notice is that when I swap my two memory modules, the (wrong) data at address 57 doesn't change at all.
My conclusion is that address 57 is *not* the secondary slot, which may be simply not reachable. Maybe I will ask Sony people about that, but I doubt I will obtain any information.
Thanks for your attention.
--
/~~ Jean "Khali" Delvare
-----\_ mail: [email protected]
--------\ http://www.ensicaen.ismra.fr/~delvare/
---=ISMRA/- ____________________________________________________
The 0x57 eeprom is clearly set up for some non-volatile storage on the motherboard. I see a lot of ASCII numbers and letters;
At row E0, for example, is "11/15/01 13:26:37"
This answers your second question.
Your first question (why the second slot doesn't make an appearance), I have no idea.
mds
Quoted 110 lines · Jean Delvare
Quoted 4 lines
The
print_eeprom()code inprog/sensors/chips.cwill only print out the SDRAM information if the chip is coded as an SDRAM, that is, location0x02contains0x04.Which is the case for
0x50but not for0x57(in my case) so it works as expected.Quoted 3 lines
If you send the output of either i2cdump or cat
/proc/sys/dev/sensors/*eeprom*/*
we can look at it.root@arrakis:~# cat `ls -v /proc/sys/dev/sensors/eeprom-i2c-0-50/*` 128 8 4 12 9 2 64 0 1 117 84 0 128 16 0 1 15 4 6 1 1 0 14 160 96 255 255 20 15 20 45 16 21 8 21 8 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 18 11 193 73 78 70 73 78 69 79 69 72 89 83 54 52 86 49 54 50 50 48 71 68 76 45 55 46 53 3 201 1 56 3 59 173 177 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 100 199 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255root@arrakis:~# cat `ls -v /proc/sys/dev/sensors/eeprom-i2c-0-57/*` 0 0 0 0 0 0 0 255 255 255 255 255 255 255 255 255 17 67 101 64 75 102 17 198 130 218 8 0 70 67 209 98 69 85 48 54 48 51 0 0 0 0 0 0 0 0 0 0 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 80 67 71 45 71 82 50 49 52 69 80 40 70 82 41 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 48 49 0 0 0 0 0 0 0 0 56 56 52 77 27 81 80 80 134 0 0 0 0 0 0 0 0 0 1 5 117 0 50 56 51 51 51 51 53 52 45 53 52 54 49 52 49 48 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 49 49 47 49 53 47 48 49 32 49 51 58 50 54 58 51 55 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0(Note that I modified the eeprom driver to show 256 bytes instead of 128.)
The same with i2cdump, in case you prefer.
root@arrakis:/usr/src/lm_sensors-CVS/prog/dump# ./i2cdump 0 0x50 Warning: 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 0x50, 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
00: 80 08 04 0c 09 02 40 00 01 75 54 00 80 10 00 01 10: 0f 04 06 01 01 00 0e a0 60 ff ff 14 0f 14 2d 10 20: 15 08 15 08 ff ff ff ff ff ff ff ff ff ff ff ff 30: ff ff ff ff ff ff ff ff ff ff ff ff ff ff 12 0b 40: c1 49 4e 46 49 4e 45 4f 45 48 59 53 36 34 56 31 50: 36 32 32 30 47 44 4c 2d 37 2e 35 03 c9 01 38 03 60: 3b ad b1 ff ff ff ff ff ff ff ff ff ff ff ff ff 70: ff ff ff ff ff ff ff ff ff ff ff ff ff ff 64 c7 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 ffroot@arrakis:/usr/src/lm_sensors-CVS/prog/dump# ./i2cdump 0 0x57 Warning: 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 0x57, 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
00: 00 00 00 00 00 00 00 ff ff ff ff ff ff ff ff ff 10: 11 43 65 40 4b 66 11 c6 82 da 08 00 46 43 d1 62 20: 45 55 30 36 30 33 00 00 00 00 00 00 00 00 00 00 30: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 40: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 50: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 60: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 70: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 80: 50 43 47 2d 47 52 32 31 34 45 50 28 46 52 29 00 90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
a0: 30 31 00 00 00 00 00 00 00 00 38 38 34 4d 1b 51
b0: 50 50 86 00 00 00 00 00 00 00 00 00 01 05 75 00
c0: 32 38 33 33 33 33 35 34 2d 35 34 36 31 34 31 30
d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
e0: 31 31 2f 31 35 2f 30 31 20 31 33 3a 32 36 3a 33
f0: 37 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00I remind you that
0x50is the first SO-DIMM slot, working as expected. The two questions that remain unsolved are :
1* Why is the second slot not available ?
2* What is showing at0x57?--
/~~ Jean "Khali" Delvare
-----\_ mail: [email protected]
--------\ http://www.ensicaen.ismra.fr/~delvare/
---=ISMRA/- ____________________________________________________
I think all three we could use if you would like to submit patches.
On 1), what I kept meaning to do but never did, can you rename the /proc names from "0-15", for example, to "00" or "00-0F" or "0x00-0x0F" or something similar, so that when you "cat *" at least the results come out in the right alphabetical order?
That's bitten me more than once...
Quoted 41 lines · Jean Delvare
Quoted 5 lines
The
0x57eeprom is clearly set up for some non-volatile storage on the motherboard. I see a lot of ASCII numbers and letters; At row E0, for example, is "11/15/01 13:26:37"
This answers your second question.Well done :)
You're perfectly right.
I modified i2cdump so that is shows a "string" version of the data, and it is now clear to me that
0x57is used to "identify" the laptop. I could find the model name and serial number, among other things.I am writing a perl script right now, to show what I understood from this eeprom. It's called decode-vaio.pl and could take place with phil's decode-dimms.pl in eeprom/, I guess. I would like to get in touch with other Vaio users, to have more than just my eeprom to do the job.
So, three things I could actually add to the project :
1* The modifications I made to the eeprom driver, so that it shows 256 bytes instead of 128. It is required for the Vaio eeprom. Maybe we could move to a device-specific length (for exemple, still limit to 128 if we recognise a DIMM module.) I don't know how accurate it can be, so we may need to discuss this a bit.
2* The enhancement I made to i2cdump.
3* The script itself.
If the script gives good results on more than just my machine, maybe we could consider adding the vaio eeprom decoding to sensors itself.
Work is still in progress anyway, any comments welcome.
--
/~~ Jean "Khali" Delvare
-----\_ mail: [email protected]
--------\ http://www.ensicaen.ismra.fr/~delvare/
---=ISMRA/- ____________________________________________________
Quoted 3 lines
You can read the contents of the eeproms more directly my looking in the directories
/proc/sys/dev/sensors/*eeprom*.
Didn't know that (well, I read it in the eeprom module docs but forgot it one minute later.) I just had a look at the files. I compared the data before and after switching the two memory modules, and it is completely different. It didn't helped me a bit understanding what could be wrong. Where may I find docs to know which values are important?
I noticed an extra file: /proc/sys/dev/sensors/chips It contains:
256 eeprom-i2c-0-50
257 eeprom-i2c-0-57
Needless to say I am very suprised by the value '257'. I think this may be a clue for you, even if it won't help me for now.
I think that another interesting clue would be to understand why the confidence for this slot was 1 instead of 8. I'll have a look at it, although I guess you already have the answer (a wild guess from me would
be: "reading it doesn't give a usual memory size value, but it should consiedring the address, so we set a confidence of 1 instead of 8".)
Quoted 4 lines
It is possible that that slot is having issues. Although your computer sounds like it is running correctly?? If the eeprom(s) were unreadable, then at least that DIMM would not be used for RAM for the system since the DIMM contains the timings and such.
Indeed, the memory is perfectly detected and working.
As said before, I will try to have a look at the detection code and maybe the sensors code itself, but probably won't find anything unless you tell me where to look at and what to look for.
Thanks.
Signature · 4 lines
/~~ Jean "Khali" Delvare -----\_ mail: [email protected] --------\ http://www.ensicaen.ismra.fr/~delvare/ ---=ISMRA/- ____________________________________________________
I have been testing many things about my eeprom driver issue.
Tried reading 256 bytes instead of 128, in case both memory slots would have been "serialized" in some way. No result.
Tried reading more than 256 bytes (320) to see if there were something intersting there. In fact, it seems that we are wrapped back to offset 0 when moving past 256. No result.
Tried two other addresses detected on my i2c bus (namely 30 and 37). No result (except turning the power off.)
Another thing to notice is that when I swap my two memory modules, the (wrong) data at address 57 doesn't change at all.
My conclusion is that address 57 is *not* the secondary slot, which may be simply not reachable. Maybe I will ask Sony people about that, but I doubt I will obtain any information.
Thanks for your attention.
Signature · 4 lines
/~~ Jean "Khali" Delvare -----\_ mail: [email protected] --------\ http://www.ensicaen.ismra.fr/~delvare/ ---=ISMRA/- ____________________________________________________
Quoted 4 lines
The
print_eeprom()code inprog/sensors/chips.cwill only print out the SDRAM information if the chip is coded as an SDRAM, that is, location0x02contains0x04.
Which is the case for 0x50 but not for 0x57 (in my case) so it works as expected.
Quoted 3 lines
If you send the output of either i2cdump or cat
/proc/sys/dev/sensors/*eeprom*/*
we can look at it.
root@arrakis:~# cat `ls -v /proc/sys/dev/sensors/eeprom-i2c-0-50/*` 128 8 4 12 9 2 64 0 1 117 84 0 128 16 0 1 15 4 6 1 1 0 14 160 96 255 255 20 15 20 45 16 21 8 21 8 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 18 11 193 73 78 70 73 78 69 79 69 72 89 83 54 52 86 49 54 50 50 48 71 68 76 45 55 46 53 3 201 1 56 3 59 173 177 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 100 199 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255
root@arrakis:~# cat `ls -v /proc/sys/dev/sensors/eeprom-i2c-0-57/*` 0 0 0 0 0 0 0 255 255 255 255 255 255 255 255 255 17 67 101 64 75 102 17 198 130 218 8 0 70 67 209 98 69 85 48 54 48 51 0 0 0 0 0 0 0 0 0 0 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 80 67 71 45 71 82 50 49 52 69 80 40 70 82 41 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 48 49 0 0 0 0 0 0 0 0 56 56 52 77 27 81 80 80 134 0 0 0 0 0 0 0 0 0 1 5 117 0 50 56 51 51 51 51 53 52 45 53 52 54 49 52 49 48 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 49 49 47 49 53 47 48 49 32 49 51 58 50 54 58 51 55 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
(Note that I modified the eeprom driver to show 256 bytes instead of 128.)
The same with i2cdump, in case you prefer.
root@arrakis:/usr/src/lm_sensors-CVS/prog/dump# ./i2cdump 0 0x50 Warning: 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 0x50, 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
00: 80 08 04 0c 09 02 40 00 01 75 54 00 80 10 00 01 10: 0f 04 06 01 01 00 0e a0 60 ff ff 14 0f 14 2d 10 20: 15 08 15 08 ff ff ff ff ff ff ff ff ff ff ff ff 30: ff ff ff ff ff ff ff ff ff ff ff ff ff ff 12 0b 40: c1 49 4e 46 49 4e 45 4f 45 48 59 53 36 34 56 31 50: 36 32 32 30 47 44 4c 2d 37 2e 35 03 c9 01 38 03 60: 3b ad b1 ff ff ff ff ff ff ff ff ff ff ff ff ff 70: ff ff ff ff ff ff ff ff ff ff ff ff ff ff 64 c7 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
root@arrakis:/usr/src/lm_sensors-CVS/prog/dump# ./i2cdump 0 0x57 Warning: 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 0x57, 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
00: 00 00 00 00 00 00 00 ff ff ff ff ff ff ff ff ff 10: 11 43 65 40 4b 66 11 c6 82 da 08 00 46 43 d1 62 20: 45 55 30 36 30 33 00 00 00 00 00 00 00 00 00 00 30: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 40: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 50: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 60: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 70: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 80: 50 43 47 2d 47 52 32 31 34 45 50 28 46 52 29 00 90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
a0: 30 31 00 00 00 00 00 00 00 00 38 38 34 4d 1b 51
b0: 50 50 86 00 00 00 00 00 00 00 00 00 01 05 75 00
c0: 32 38 33 33 33 33 35 34 2d 35 34 36 31 34 31 30
d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
e0: 31 31 2f 31 35 2f 30 31 20 31 33 3a 32 36 3a 33
f0: 37 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
I remind you that 0x50 is the first SO-DIMM slot, working as expected. The two questions that remain unsolved are :
1* Why is the second slot not available ?
2* What is showing at 0x57 ?
Signature · 4 lines
/~~ Jean "Khali" Delvare -----\_ mail: [email protected] --------\ http://www.ensicaen.ismra.fr/~delvare/ ---=ISMRA/- ____________________________________________________
Quoted 5 lines
You know, I thought 57 was a funny address for your DIMM. My guess is that it is something else, as you are thinking. In the past, Xeon processors had a eeprom in them which appeared in addresses high like 57.
In case you want to know, the CPU is a Mobile Penium III 866 (with SpeedStep technology, which make it operate at 500MHz when running on battery.) I may give you more information if you want (such as the output of cat /proc/cpuinfo.)
Quoted 2 lines
But, I'm still curious why only your first slot is detected and your second is not. Anyways, thanks for the detective work thus far!
My pleasure. I'm rather curious by nature.
Signature · 4 lines
/~~ Jean "Khali" Delvare -----\_ mail: [email protected] --------\ http://www.ensicaen.ismra.fr/~delvare/ ---=ISMRA/- ____________________________________________________
Quoted 7 lines
BTW- Have you tried running eeprom-decode.pl? It's in lm-sensors/prog/eeprom, I think. It can help decode the values of your valid SPD DIMM (timing and such). There is also a checksum value which it computes and compared with what is stored on the chip. If the checksum isn't valid, then it is almost certainly evidence that the chip isn't on a DIMM (or is corrupted).
I guess you refer to decode-dimms.pl. Yes, I tried it. It gives correct results for 0x50 and awful garbage for 0x57.
I also just tried xeon/decode-xeon.pl. No resulult either.
If byte at 0x02 has a class meaning (0x04 for DIMMs, you said), is there a reference about this? It would help to know what kind of item 0x00 is supposed to be.
Signature · 4 lines
/~~ Jean "Khali" Delvare -----\_ mail: [email protected] --------\ http://www.ensicaen.ismra.fr/~delvare/ ---=ISMRA/- ____________________________________________________
Quoted 5 lines
The
0x57eeprom is clearly set up for some non-volatile storage on the motherboard. I see a lot of ASCII numbers and letters; At row E0, for example, is "11/15/01 13:26:37"
This answers your second question.
Well done :)
You're perfectly right.
I modified i2cdump so that is shows a "string" version of the data, and it is now clear to me that 0x57 is used to "identify" the laptop. I could find the model name and serial number, among other things.
I am writing a perl script right now, to show what I understood from this eeprom. It's called decode-vaio.pl and could take place with phil's decode-dimms.pl in eeprom/, I guess. I would like to get in touch with other Vaio users, to have more than just my eeprom to do the job.
So, three things I could actually add to the project :
1* The modifications I made to the eeprom driver, so that it shows 256 bytes instead of 128. It is required for the Vaio eeprom. Maybe we could move to a device-specific length (for exemple, still limit to 128 if we recognise a DIMM module.) I don't know how accurate it can be, so we may need to discuss this a bit.
2* The enhancement I made to i2cdump.
3* The script itself.
If the script gives good results on more than just my machine, maybe we could consider adding the vaio eeprom decoding to sensors itself.
Work is still in progress anyway, any comments welcome.
Signature · 4 lines
/~~ Jean "Khali" Delvare -----\_ mail: [email protected] --------\ http://www.ensicaen.ismra.fr/~delvare/ ---=ISMRA/- ____________________________________________________
Quoted 2 lines
I think all three we could use if you would like to submit patches.
I will.
Quoted 5 lines
On 1), what I kept meaning to do but never did, can you rename the /proc names from "0-15", for example, to "00" or "00-0F" or "0x00-0x0F" or something similar, so that when you "cat *" at least the results come out in the right alphabetical order?
That's bitten me more than once...
I agree. It makes things much more complicated for everyone, even if "ls -v" can help for this particular point.
Anyway, I won't modify that unless anyone agrees. I'm rather new to this project and this ain't a decision I can make alone. If I am the one who decides, I would even remove the heading "data" and remove the end address, since it can be deduced from the start address. I would have something like that :
eeprom-i2c-0-50/00
eeprom-i2c-0-50/10
eeprom-i2c-0-50/20
eeprom-i2c-0-50/30
eeprom-i2c-0-50/40
eeprom-i2c-0-50/50
eeprom-i2c-0-50/60
eeprom-i2c-0-50/70
Now, I don't know everything about the needs of everyone, so I'd like to know what people think about it. What's sure is that it would require to rewite some utils, such as the dimms decoder.
So, please, everyone let me know if it is a good idea or not.
(Anyway, it does *note* need to be changed right now. I can submit my patches and wait some time that we all agree if a change in the file names is a good thing or not.)
Signature · 4 lines
/~~ Jean "Khali" Delvare -----\_ mail: [email protected] --------\ http://www.ensicaen.ismra.fr/~delvare/ ---=ISMRA/- ____________________________________________________
Quoted 8 lines
BTW- If it saves effort, you could access the eeprom's more directly through the
/dev/i2c*interface. You wouldn't be dependant on the eeprom module that way, although you would need to be careful not to accidentially write data to the eeprom. Seeprog/dump/i2c-dump.cfor an example, and then look at theeeprom.cdriver for the i2c sequence to read a value from eeprom (it's a write [to set the address pointer in eeprom memory] followed by a read, I think).
I certainly won't. If we are to access the device directly, then it wouldn't make sense to have a driver. Anyway, my script is ready and works with the current proc filenames, and it won't be hard to switch to another naming scheme if required.
Signature · 4 lines
/~~ Jean "Khali" Delvare -----\_ mail: [email protected] --------\ http://www.ensicaen.ismra.fr/~delvare/ ---=ISMRA/- ____________________________________________________
Quoted 2 lines
I think all three we could use if you would like to submit patches.
Here they are.
Attached to this mail come 3 files.
1* lm_sensors2-eeprom256.diff
Patch to the eeprom driver, so that is reads 256 bytes instead of 128.
2* lm_sensors2-i2cdump.diff
Patch to i2cdump, so that it shows ASCII content of the eeproms, in addition to the regular hex dump.
3* decode-vaio.pl
A perl script that will read the contents of a Sony Vaio EEPROM. It is *untested* so far, but should evolve when/if we can access other models and/or are able to get specifications.
Please note that this script *cannot* be used before patch 1* has been applied.
I think that this script could take place in prog/eeprom/. BTW, I'd suggest that prog/xeon/decode-xeon.pl be also moved to prog/eeprom/. If we are to create a new subdirectory for each new eeprom we hear about, it could be too many someday.
As usual, all commments, suggestions and so on are welcome.
Signature · 309 lines
/~~ Jean "Khali" Delvare -----\_ mail: [email protected] --------\ http://www.ensicaen.ismra.fr/~delvare/ ---=ISMRA/- ____________________________________________________ -------------- next part -------------- diff -ruN CVS/kernel/chips/eeprom.c khali/kernel/chips/eeprom.c --- CVS/kernel/chips/eeprom.c Thu Jan 31 23:14:46 2002 +++ khali/kernel/chips/eeprom.c Wed Feb 6 17:57:10 2002 @@ -69,7 +69,7 @@ /* Conversions */ /* Size of EEPROM in bytes */ -#define EEPROM_SIZE 128 +#define EEPROM_SIZE 256 /* Each client has this additional data */ struct eeprom_data { @@ -80,7 +80,9 @@ unsigned long last_updated; /* In jiffies */ u8 data[EEPROM_SIZE]; /* Register values */ +#if 0 int memtype; +#endif }; #ifdef MODULE @@ -150,6 +152,22 @@ &i2c_sysctl_real, NULL, &eeprom_contents}, {EEPROM_SYSCTL8, "data112-127", NULL, 0, 0444, NULL, &i2c_proc_real, &i2c_sysctl_real, NULL, &eeprom_contents}, + {EEPROM_SYSCTL9, "data128-143", NULL, 0, 0444, NULL, &i2c_proc_real, + &i2c_sysctl_real, NULL, &eeprom_contents}, + {EEPROM_SYSCTL10, "data144-159", NULL, 0, 0444, NULL, &i2c_proc_real, + &i2c_sysctl_real, NULL, &eeprom_contents}, + {EEPROM_SYSCTL11, "data160-175", NULL, 0, 0444, NULL, &i2c_proc_real, + &i2c_sysctl_real, NULL, &eeprom_contents}, + {EEPROM_SYSCTL12, "data176-191", NULL, 0, 0444, NULL, &i2c_proc_real, + &i2c_sysctl_real, NULL, &eeprom_contents}, + {EEPROM_SYSCTL13, "data192-207", NULL, 0, 0444, NULL, &i2c_proc_real, + &i2c_sysctl_real, NULL, &eeprom_contents}, + {EEPROM_SYSCTL14, "data208-223", NULL, 0, 0444, NULL, &i2c_proc_real, + &i2c_sysctl_real, NULL, &eeprom_contents}, + {EEPROM_SYSCTL15, "data224-239", NULL, 0, 0444, NULL, &i2c_proc_real, + &i2c_sysctl_real, NULL, &eeprom_contents}, + {EEPROM_SYSCTL16, "data240-255", NULL, 0, 0444, NULL, &i2c_proc_real, + &i2c_sysctl_real, NULL, &eeprom_contents}, {0} }; @@ -349,26 +367,52 @@ int base = 0; struct eeprom_data *data = client->data; - if (ctl_name = EEPROM_SYSCTL2) { - base = 16; - } - if (ctl_name = EEPROM_SYSCTL3) { - base = 32; - } - if (ctl_name = EEPROM_SYSCTL4) { - base = 48; - } - if (ctl_name = EEPROM_SYSCTL5) { - base = 64; - } - if (ctl_name = EEPROM_SYSCTL6) { - base = 80; - } - if (ctl_name = EEPROM_SYSCTL7) { - base = 96; - } - if (ctl_name = EEPROM_SYSCTL8) { - base = 112; + switch (ctl_name) { + case EEPROM_SYSCTL2: + base = 16; + break; + case EEPROM_SYSCTL3: + base = 32; + break; + case EEPROM_SYSCTL4: + base = 48; + break; + case EEPROM_SYSCTL5: + base = 64; + break; + case EEPROM_SYSCTL6: + base = 80; + break; + case EEPROM_SYSCTL7: + base = 96; + break; + case EEPROM_SYSCTL8: + base = 112; + break; + case EEPROM_SYSCTL9: + base = 128; + break; + case EEPROM_SYSCTL10: + base = 144; + break; + case EEPROM_SYSCTL11: + base = 160; + break; + case EEPROM_SYSCTL12: + base = 176; + break; + case EEPROM_SYSCTL13: + base = 192; + break; + case EEPROM_SYSCTL14: + base = 208; + break; + case EEPROM_SYSCTL15: + base = 224; + break; + case EEPROM_SYSCTL16: + base = 240; + break; } if (operation = SENSORS_PROC_REAL_INFO) diff -ruN CVS/kernel/include/sensors.h khali/kernel/include/sensors.h --- CVS/kernel/include/sensors.h Thu Jan 31 23:16:15 2002 +++ khali/kernel/include/sensors.h Wed Feb 6 17:20:40 2002 @@ -170,6 +170,14 @@ #define EEPROM_SYSCTL6 1005 #define EEPROM_SYSCTL7 1006 #define EEPROM_SYSCTL8 1007 +#define EEPROM_SYSCTL9 1008 +#define EEPROM_SYSCTL10 1009 +#define EEPROM_SYSCTL11 1010 +#define EEPROM_SYSCTL12 1011 +#define EEPROM_SYSCTL13 1012 +#define EEPROM_SYSCTL14 1013 +#define EEPROM_SYSCTL15 1014 +#define EEPROM_SYSCTL16 1015 #define LM80_SYSCTL_IN0 1000 /* Volts * 100 */ #define LM80_SYSCTL_IN1 1001 -------------- next part -------------- diff -ruN CVS/prog/dump/i2cdump.c khali/prog/dump/i2cdump.c --- CVS/prog/dump/i2cdump.c Thu Jan 31 23:16:52 2002 +++ khali/prog/dump/i2cdump.c Tue Feb 5 13:33:25 2002 @@ -293,7 +293,7 @@ block[i] = -1; } - printf(" 0 1 2 3 4 5 6 7 8 9 a b c d e f\n"); + printf(" 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef\n"); for (i = 0; i < 256; i+) { printf("%02x: ",i); for(j = 0; j < 16; j++) { @@ -305,6 +305,21 @@ printf("XX "); else printf("%02x ",res & 0xff); + } + printf(" "); + for(j = 0; j < 16; j++) { + if(size = I2C_SMBUS_BYTE_DATA) + res = i2c_smbus_read_byte_data(file,i+j); + else + res = block[i+j]; + if (res < 0) + printf("X"); + else if (((res & 0xff) = 0x00) || ((res & 0xff) = 0xff)) + printf("."); + else if (((res & 0xff) < 32) || ((res & 0xff) > 127)) + printf("?"); + else + printf("%c",res & 0xff); } printf("\n"); } -------------- next part -------------- #!/usr/bin/perl -w # # Copyright 2002 Jean Delvare <[email protected]> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # # Version 0.1 2002-02-06 Jean Delvare <[email protected]> # # EEPROM data decoding for Sony Vaio laptops. # # Two assumptions: lm_sensors-2.x installed, # and Perl is at /usr/bin/perl # # Please note that this is a guess-only work. I don't expect much help from # Sony, so if someone can provide information, please contact me. I used my # PCG-GR214EP as a base, but I can't promise that this script will work with # other models. Any feedback appreciated anyway. # use strict; sub print_item { my ($label,$value) = @_; printf("\%20s : \%s\n",$label,$value); } sub decode_char { my ($bus,$addr,$base,$offset,$length) = @_; my $filename="/proc/sys/dev/sensors/eeprom-i2c-$bus-$addr/data$base-".($base+15); open(FH,$filename) || die "Can't open $filename"; my $line=<FH>; close(FH); my @bytes=split(/[ \n]/,$line); @bytes=@bytes[$offset..$offset+$length-1]; my $string=''; my $item; while(defined($item=shift(@bytes))) { $string.=chr($item); } return($string); } sub decode_string { my ($bus,$addr,$base,$offset,$length) = @_; my $filename="/proc/sys/dev/sensors/eeprom-i2c-$bus-$addr/data$base-".($base+15); open(FH,$filename) || die "Can't open $filename"; my $line=<FH>; close(FH); my @bytes=split(/[ \n]/,$line); @bytes=@bytes[$offset..$offset+$length-1]; my $string=''; my $item; while(defined($item=shift(@bytes)) && ($item!=0)) { $string.=chr($item); } return($string); } sub decode_string32 { my ($bus,$addr,$base) = @_; my $filename="/proc/sys/dev/sensors/eeprom-i2c-$bus-$addr/data$base-".($base+15); open(FH,$filename) || die "Can't open $filename"; my $line=<FH>; close(FH); $filename="/proc/sys/dev/sensors/eeprom-i2c-$bus-$addr/data".($base+16).'-'.($base+31); open(FH,$filename) || die "Can't open $filename"; $line.=<FH>; close(FH); my @bytes=split(/[ \n]/,$line); my $string=''; my $item; while(defined($item=shift(@bytes)) && ($item!=0)) { $string.=chr($item); } return($string); } sub vaio_decode { my ($bus,$addr) = @_; print_item('Model name',decode_string32($bus,$addr,128).' ['.decode_char($bus,$addr,160,10,4).']'); print_item('Revision',decode_string($bus,$addr,160,0,10)); print_item('Serial number',decode_string32($bus,$addr,192)); print_item('Timestamp',decode_string32($bus,$addr,224)); } print("Sony Vaio EEPROM Decoder\n"); print("Written by Jean Delvare. Copyright 2002.\n"); print("Version 0.1\n\n"); if ( -r '/proc/sys/dev/sensors/eeprom-i2c-0-57') { vaio_decode('0','57'); } else { print("Vaio eeprom not found. Please make sure that the eeprom module is loaded.\n"); print("If you believe this is an error, please contact me <khali\@linux-fr.org>\n"); print("so that we may see how to fix the problem.\n"); } print("\n");
I made the naming change you suggested in eeprom.c and fixed decode-dimms and decode-xeon, unfortunately I don't have a Perl book at home so I need your help to fix decode-vaio, if you would please send me a patch that would be great. thanks
mds
Quoted 42 lines · Jean Delvare
Quoted 2 lines
I think all three we could use if you would like to submit patches.
I will.
Quoted 5 lines
On 1), what I kept meaning to do but never did, can you rename the /proc names from "0-15", for example, to "00" or "00-0F" or "0x00-0x0F" or something similar, so that when you "cat *" at least the results come out in the right alphabetical order?
That's bitten me more than once...I agree. It makes things much more complicated for everyone, even if "ls -v" can help for this particular point.
Anyway, I won't modify that unless anyone agrees. I'm rather new to this project and this ain't a decision I can make alone. If I am the one who decides, I would even remove the heading "data" and remove the end address, since it can be deduced from the start address. I would have something like that :
eeprom-i2c-0-50/00
eeprom-i2c-0-50/10
eeprom-i2c-0-50/20
eeprom-i2c-0-50/30
eeprom-i2c-0-50/40
eeprom-i2c-0-50/50
eeprom-i2c-0-50/60
eeprom-i2c-0-50/70Now, I don't know everything about the needs of everyone, so I'd like to know what people think about it. What's sure is that it would require to rewite some utils, such as the dimms decoder.
So, please, everyone let me know if it is a good idea or not.
(Anyway, it does *note* need to be changed right now. I can submit my patches and wait some time that we all agree if a change in the file names is a good thing or not.)
--
/~~ Jean "Khali" Delvare
-----\_ mail: [email protected]
--------\ http://www.ensicaen.ismra.fr/~delvare/
---=ISMRA/- ____________________________________________________
Quoted 6 lines
I made the naming change you suggested in
eeprom.cand fixed decode-dimms and decode-xeon, unfortunately I don't have a Perl book at home so I need your help to fix decode-vaio, if you would please send me a patch that would be great.
Here you are.
I supposed that the new names will be from 00 to f0 (not F0). If I'm wrong, just change %02x with %02X in sprintf calls.
Tell me if there's anything wrong.
Signature · 87 lines
/~~ Jean "Khali" Delvare -----\_ mail: [email protected] --------\ http://www.ensicaen.ismra.fr/~delvare/ ---=ISMRA/- ____________________________________________________ -------------- next part -------------- diff -ruN 0.1/prog/eeprom/decode-vaio.pl 0.2/prog/eeprom/decode-vaio.pl --- 0.1/prog/eeprom/decode-vaio.pl Sat Feb 16 21:49:45 2002 +++ 0.2/prog/eeprom/decode-vaio.pl Sat Feb 16 22:05:17 2002 @@ -16,18 +16,26 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # -# Version 0.1 2002-02-06 Jean Delvare <[email protected]> +# Version 0.2 2002-02-06 Jean Delvare <[email protected]> # # EEPROM data decoding for Sony Vaio laptops. # # Two assumptions: lm_sensors-2.x installed, # and Perl is at /usr/bin/perl # -# Please note that this is a guess-only work. I don't expect much help from -# Sony, so if someone can provide information, please contact me. I used my +# Please note that this is a guess-only work. Sony support refused to help +# me, so if someone can provide information, please contact me. I used my # PCG-GR214EP as a base, but I can't promise that this script will work with # other models. Any feedback appreciated anyway. # +# History: +# +# 2002-02-06 0.1 Initial release. +# +# 2002-02-16 0.2 Fixed to work with the new, simplified /proc interface +# names of the eeprom driver (lm_sensors 2.6.3 and later.) +# Shifted data display by 4 columns left. +# use strict; @@ -35,14 +43,14 @@ { my ($label,$value) = @_; - printf("\%20s : \%s\n",$label,$value); + printf("\%16s : \%s\n",$label,$value); } sub decode_char { my ($bus,$addr,$base,$offset,$length) = @_; - my $filename="/proc/sys/dev/sensors/eeprom-i2c-$bus-$addr/data$base-".($base+15); + my $filename="/proc/sys/dev/sensors/eeprom-i2c-$bus-$addr/".sprintf('%02x',$base); open(FH,$filename) || die "Can't open $filename"; my $line=<FH>; close(FH); @@ -63,7 +71,7 @@ { my ($bus,$addr,$base,$offset,$length) = @_; - my $filename="/proc/sys/dev/sensors/eeprom-i2c-$bus-$addr/data$base-".($base+15); + my $filename="/proc/sys/dev/sensors/eeprom-i2c-$bus-$addr/".sprintf('%02x',$base); open(FH,$filename) || die "Can't open $filename"; my $line=<FH>; close(FH); @@ -84,11 +92,11 @@ { my ($bus,$addr,$base) = @_; - my $filename="/proc/sys/dev/sensors/eeprom-i2c-$bus-$addr/data$base-".($base+15); + my $filename="/proc/sys/dev/sensors/eeprom-i2c-$bus-$addr/".sprintf('%02x',$base); open(FH,$filename) || die "Can't open $filename"; my $line=<FH>; close(FH); - $filename="/proc/sys/dev/sensors/eeprom-i2c-$bus-$addr/data".($base+16).'-'.($base+31); + $filename="/proc/sys/dev/sensors/eeprom-i2c-$bus-$addr/".sprintf('%02x',$base+16); open(FH,$filename) || die "Can't open $filename"; $line.=<FH>; close(FH); @@ -116,7 +124,7 @@ print("Sony Vaio EEPROM Decoder\n"); print("Written by Jean Delvare. Copyright 2002.\n"); -print("Version 0.1\n\n"); +print("Version 0.2\n\n"); if ( -r '/proc/sys/dev/sensors/eeprom-i2c-0-57') {
I enhanced my decode-vaio.pl script today. Here is the new version (0.3). I give you the whole script instead of a diff because there are so many changes that the diff is hardly readable and is bigger that the script itself.
See the changes list inside the script for details.
Signature · 153 lines
/~~ Jean "Khali" Delvare -----\_ mail: [email protected] --------\ http://www.ensicaen.ismra.fr/~delvare/ ---=ISMRA/- ____________________________________________________ -------------- next part -------------- #!/usr/bin/perl -w # # Copyright 2002 Jean Delvare <[email protected]> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # # Version 0.1 2002-02-06 Jean Delvare <[email protected]> # Version 0.2 2002-02-16 Jean Delvare <[email protected]> # Fixed to work with the new, simplified /proc interface names of the eeprom driver # (lm_sensors 2.6.3 and greater.) # Shifted data display by 4 columns left. # Version 0.3 2002-02-17 Jean Delvare <[email protected]> # Added UUID field at 0x10 (added decode_uuid.) # Merged decode_string and decode_string32. # Added unknown field at 0x20. # Moved header and footer to BEGIN and END, respectivly. # Reformated history to match those of the other decode scripts. # Deleted decode_char (made useless by decode_string.) # Reordered field display, changed some labels. # Added old /proc interface check. # # EEPROM data decoding for Sony Vaio laptops. # # Two assumptions: lm_sensors-2.6.3 or greater installed, # and Perl is at /usr/bin/perl # # Please note that this is a guess-only work. Sony support refused to help # me, so if someone can provide information, please contact me. I used my # PCG-GR214EP as a base, but I can't promise that this script will work with # other models. Any feedback appreciated anyway. # use strict; sub print_item { my ($label,$value) = @_; printf("\%16s : \%s\n",$label,$value); } sub decode_string { my ($bus,$addr,$base,$offset,$length) = @_; my $line=''; my $remains=$length+$offset; while($remains>0) { my $filename="/proc/sys/dev/sensors/eeprom-i2c-$bus-$addr/".sprintf('%02x',$base); open(FH,$filename) || die "Can't open $filename"; $line.=<FH>; close(FH); $remains-; $base+; } my @bytes=split(/[ \n]/,$line); @bytes=@bytes[$offset..$offset+$length-1]; my $string=''; my $item; while(defined($item=shift(@bytes)) && ($item!=0)) { $string.=chr($item); } return($string); } sub decode_uuid { my ($bus,$addr,$base) = @_; my $filename="/proc/sys/dev/sensors/eeprom-i2c-$bus-$addr/".sprintf('%02x',$base); open(FH,$filename) || die "Can't open $filename"; my $line=<FH>; close(FH); my @bytes=split(/[ \n]/,$line); my $string=''; my $item; for(my $i=0;$i<16;$i++) { $string.=sprintf('%02x',shift(@bytes)); if(($i=3)||($i=5)||($i=7)||($i=9)) { $string.='-'; } } return($string); } sub vaio_decode { my ($bus,$addr) = @_; print_item('Machine Name',decode_string($bus,$addr,128,0,32)); print_item('Serial Number',decode_string($bus,$addr,192,0,32)); print_item('UUID',decode_uuid($bus,$addr,16)); print_item('Revision',decode_string($bus,$addr,160,0,10)); print_item('Model Number','PCG-'.decode_string($bus,$addr,160,10,4)); print_item('?',decode_string($bus,$addr,32,0,16)); print_item('?',decode_string($bus,$addr,224,0,32)); } BEGIN { print("Sony Vaio EEPROM Decoder\n"); print("Written by Jean Delvare. Copyright 2002.\n"); print("Version 0.3\n\n"); } END { print("\n"); } if ( -r '/proc/sys/dev/sensors/eeprom-i2c-0-57') { if ( -r '/proc/sys/dev/sensors/eeprom-i2c-0-57/data0-15') { print("Deprecated old interface found. Please upgrade to lm_sensors 2.6.3 or greater."); } else { vaio_decode('0','57'); } } else { print("Vaio EEPROM not found. Please make sure that the eeprom module is loaded.\n"); print("If you believe this is an error, please contact me <khali\@linux-fr.org>\n"); print("so that we may see how to fix the problem.\n"); }
Quoted 3 lines
I made the naming change you suggested in
eeprom.cand fixed decode-dimms and decode-xeon, (...)
Any reason why decode-xeon.pl was not moved to eeprom/ as I suggested? (not that it is really important, I'm just wondering)
I saw that you reversionned decode-dimms and decode-xeon to 2.6.3. I guess we should agree on wether scripts versions are supposed to match lm_sensors' ones. I have a general preference for independant versioning, since it lets us change the scripts without regards to how frequent lm_sensors itself is released. Anyway I'd like to know what is expected to follow the guidelines. However, I'd insist that the claimed (printed at runtime) version matches the changes history one(s), and that, in the case we chose to keep an independant versioning, the required lm_sensors version be explicitely mentioned.
Regards.
Signature · 4 lines
/~~ Jean "Khali" Delvare -----\_ mail: [email protected] --------\ http://www.ensicaen.ismra.fr/~delvare/ ---=ISMRA/- ____________________________________________________