Skip to contentSkip to conversation

Super-IO

DISCUSSION Jean Delvare 2 participants 4 messages May 19, 2005

lore
Share & tools
lore
#0 lore raw
Quoted 3 lines

khali,
this worked fine for me on my vt1211 board.
mds

Great.

Looks to me like the "code doesn't handle multiple devid regs yet" comment is out-of-date and should be removed.

Also, why is the IT8705 entry disabled? A few fixes and it could work. According to the docs I have, enter sequence is "0x87, 0x01, 0x55, 0x55" (same as IT8712), and the exit sequence would be the same too, contrary to what the comment suggests (the datasheet says "Set bit 1 (...) to 1" which means writing 0x02, not 0x01, if I'm not mistaking.

BTW, why are we prepending "0x2e, 0xaa" to the IT87xx exit sequence? Looks like some compatibility measure with Winbond chips, but since we overwrite the value right after, I don't much see the point. Shouldn't we instead *append* it to the exit sequence?

Actually I wonder if we shouldn't have two different exit sequences. One if the chip has been detected, and one if the chip hasn't. The way things are done for now, we'll always write a value to register 0x02 during the IT87xx detection, even if the detection failed so we know we probably do *not* have an IT chip. It would sound safer to me to issue the "usual" exit sequence in that case (which doesn't write to any register). OK, things go a bit more complex if we want to handle both the IT8712 and the IT8705 because a "failure between both (ie trying to detect the 8712 and it actually is a 8705, or the contrary) would not issue the correct exit sequence. However it seems less intrusive to not reset a chip than to arbitrarily try to write to a register.

Comments welcome (I'm not quite used to Super-IO, although still much more than two days ago ;))

Signature · 2 lines
Jean Delvare
http://www.ensicaen.ismra.fr/~delvare/
#1 lore raw

Hi all,

More on SuperIO chips in sensors-detect...

According to the various datasheets I read today, and the PNP ISA spec, it looks like the following parameters are common to all Super IO chips:

	addrreg => 0x2e,
	datareg => 0x2f,
	devidreg => 0x20,
	logdevreg => 0x07,
	actreg => 0x30,
	actmask => 0x01,
	basereg => 0x60,
which would shrink the chip definitions to the following values:
	name => "ITE 8702F Super IO Sensors",
	driver => "to-be-written",
	enter => [0x87, 0x01, 0x55, 0x55],
	devid => 0x8702,
	logdev => 0x04,
	exitseq => [0x2e, 0x02, 0x2f, 0x02, 0x2e, 0xaa],

The rest being hard-coded.

About the enter sequence: Looks like Nat'l chips don't have one. Can anyone confirm? Looks strange to me.

About the exit sequence: I now tend to think that we have to differenciate between the "0x2e, 0xaa" sequence, which is actually the exit counterpart of the entering sequence for some chips (not all), and the "0x2e, 0x02, 0x2f, 0x02" sequence, which is the a kind of state reset, and should be applied to all chips according to the PNP ISA spec. So I think that the first one should be part of the chip definition and applied only in case of success, while the second should hard-coded and always applied *after* any chip-specific exit sequence (contrary to was is done now, shame on me).

About the logical devices: Some chips (Nat'l) do have more than one logical device of interest for us. I don't know how we want to handle them. Ideas welcome.

About the base address: Some chips do have a secondary address. The current code doesn't handle it. I guess that we can check it (if the primary address wasn't 0) and print it if and if only it isn't 0.

About the device id: Some chips have more than the one standard ID register (0x20). Additional info was seen at 0x21 and 0x27, but this isn't standard. I think that we should express the identifier as a list of address, value couples (so the devidreg value would in fact be part of the chip definition). Or even as address, mask, value triplets, to cover all cases. I need to think a bit more about it though.

About the activity register: SMSC chips had it set to 0x20 in sensors-detect so far, but I couldn't see anything of that nature in the datasheets. I think it was a typo and the correct value is 0x30, as seen everywhere else and written in the PNP ISA spec.

I think it's all...

Signature · 2 lines
Jean Delvare
http://www.ensicaen.ismra.fr/~delvare/
#2 lore raw
In reply to Jean Delvare

Hi all,

I've changed our exit sequence policy for super io chips (and added some new ones).

The "OxAA" sequence seems to be the exit counterpart of the "password" sequence used to enter chips. Looks like chips implement it so that we don't need to return *all* devices to the wait-for-key state as said in the PNP ISA spec (what writing 0x02 to register 0x02 does). So in case we detected a chip we know, use its exit sequence if it has one. If not, use the standard (more intrusive) PNP ISA way.

It's not perfect yet since the exit sequence doesn't really depend on chips but on chip families, so we should group chips by family to limit the number of probes and risks of messing something up. Also, the Nat'l chips do not have an enter sequence so they are likely to answer *all* enter sequence, so we are likely to use the bad exit sequence here (although it doesn't matter much; since there is no enter sequence, there is no real need for an exit sequence).

Anyway I tested the new code on an IT8712F and it seems to work. More tests welcome.

MDS, I could see that you consider device IDs of 0xFF as "not detected". Couldn't find anything of that kind in any spec. Where did you get that from? Shouldn't we also consider 0x00 the same? I got that on my laptop.

Thanks.

Signature · 2 lines
Jean Delvare
http://www.ensicaen.ismra.fr/~delvare/
#3 lore raw
In reply to Jean Delvare

I got it from common sense and experience in testing.
If there is no chip there that responded to the enable sequence, then when you attempt to read the device ID, nothing responds.
I suppose that either all zeros or all ones is possible, depending on motherboard implementation (i.e. are there pullups on the bus).

Quoted 29 lines · Jean Delvare

Hi all,

I've changed our exit sequence policy for super io chips (and added some new ones).

The "OxAA" sequence seems to be the exit counterpart of the "password" sequence used to enter chips. Looks like chips implement it so that we don't need to return *all* devices to the wait-for-key state as said in the PNP ISA spec (what writing 0x02 to register 0x02 does). So in case we detected a chip we know, use its exit sequence if it has one. If not, use the standard (more intrusive) PNP ISA way.

It's not perfect yet since the exit sequence doesn't really depend on chips but on chip families, so we should group chips by family to limit the number of probes and risks of messing something up. Also, the Nat'l chips do not have an enter sequence so they are likely to answer *all* enter sequence, so we are likely to use the bad exit sequence here (although it doesn't matter much; since there is no enter sequence, there is no real need for an exit sequence).

Anyway I tested the new code on an IT8712F and it seems to work. More tests welcome.

MDS, I could see that you consider device IDs of 0xFF as "not detected". Couldn't find anything of that kind in any spec. Where did you get that from? Shouldn't we also consider 0x00 the same? I got that on my laptop.

Thanks.