<div class="gmail_quote">On Tue, Dec 28, 2010 at 4:13 AM, Frantisek Rysanek <span dir="ltr"><<a href="mailto:Frantisek.Rysanek@post.cz" target="_blank">Frantisek.Rysanek@post.cz</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">



Dear maintainers of the superiotool,<br>
<br>
I have the following "feature request" (maybe not a bug report):<br>
I have this idea that superiotool should be able to detect more than<br>
one SuperIO chip in the system. Such detection of multiple chips may<br>
work in some cases, but may fail in others.<br>
<br>
The primary cause seems to be that<br>
  winbond.c :: probe_idregs_winbond()<br>
and<br>
   ite.c :: probe_idregs_ite()<br>
call<br>
   if (chip_found) return;   // this is a global variable!<br>
after every "init sequence" tried.<br>
<br>
Therefore, after the first chip detected (of any kind),<br>
only the first init sequence is ever tried, in any subsequent calls<br>
to the aforementioned probe_* functions.<br>
<br>
My immediate hack was to comment out all occurrences of<br>
   if (chip_found) return;<br>
in those probe functions.<br>
Makes me wonder if this has some adverse effects, such as repeatedly<br>
scanning some EFER bases / init sequences by probes belonging to<br>
different chip families.<br>
And my conclusion for the moment is that this repeated probing should<br>
be harmless, and that the current behavior (stop after the first init<br>
sequence tried) is flawed anyway :-)<br></blockquote><div><br></div><div>Heh, I hacked that "if (chip_found) return;" stuff into SuperI/O tool a few months ago (<a href="http://www.coreboot.org/pipermail/coreboot/2010-August/059607.html" target="_blank">http://www.coreboot.org/pipermail/coreboot/2010-August/059607.html</a>).</div>



<div><br></div><div>The reason was to avoid duplicate listings. In my specific case, I was working with an ITE chip that does not need an entry/exit sequence. So when probe_regs_ite() was called, it would find my chip 5 times and dump its registers 5 times. Sorry if it's causing you headaches now :-/</div>

<meta http-equiv="content-type" content="text/html; charset=utf-8">

<div><br></div><div>I think long-term we should make superiotool more intelligent with regard to duplicate entries. For example, if a chip has been found at 0x2e, then superiotool should stop probing devices on port 0x2e and continue probing devices on ports 0x4e, 0x3f0, etc (as listed in superioto_ports_table[]). I think we could accomplish this easily:</div>



<div>- Add a return code to each chip's probe_idregs_* function.</div><div>- Update the loop in main() which iterates thru superio_ports_table[]. If a probe_idregs_* function returns a specific code to indicate a chip has been found, then record the corresponding superio port entry and avoid further calls to superio_ports_table[i].probe_idregs() on that port.</div>



<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
My motivation is simple: right now I'm working with an embedded PC<br>
that has two SuperIO chips on the inside: W83627 + W83977.<br>
But I've seen other models in the past as well.<br>
<br>
Your SuperIOtool is quite useful for a quick overview of the SuperIO<br>
chips in the system, including a thorough dump of their registers.<br>
In the past I myself have written and reused some simple snippet of<br>
code / a tiny library (in DOS) to help me debug/tweak SuperIO stuff,<br>
but I never got as far as making it truly universal and extensible.<br>
As for SuperIOtool, I could fancy a writing capability, and maybe an<br>
external configuration file, potentially allowing for extensions<br>
without coding in C, maybe human-readable interpretations /<br>
annotations of the register dump etc - but I admit that's too much<br>
work to be worth the bother, certainly for me at the moment :-)<br>
<br>
Keep up the excellent work that you're doing...<br>
<br>
Frank Rysanek<br>
<font color="#888888"><br>
<br>
--<br>
coreboot mailing list: <a href="mailto:coreboot@coreboot.org" target="_blank">coreboot@coreboot.org</a><br>
<a href="http://www.coreboot.org/mailman/listinfo/coreboot" target="_blank">http://www.coreboot.org/mailman/listinfo/coreboot</a><br>
</font></blockquote></div><br><br clear="all"><br>-- <br>David Hendricks (dhendrix)<br>Systems Software Engineer, Google Inc.<br>