path: root/internal.c
diff options
authorCarl-Daniel Hailfinger <>2011-04-27 14:34:08 +0000
committerCarl-Daniel Hailfinger <>2011-04-27 14:34:08 +0000
commitbfecef6986b25b630605054680264daf09046f65 (patch)
treea54fe83e5bd047ca0ae0af1469973a76acddceb8 /internal.c
parent880e867ae823dbbd140731f2eaa2ea656b4b9153 (diff)
Add support for more than one Super I/O or EC per machine
Flashrom currently only supports exactly one Super I/O or Embedded Controller, and this means quite a few notebooks and a small subset of desktop/server boards cannot be handled reliably and easily. Allow detection and initialization of up to 3 Super I/O and/or EC chips. WARNING! If a Super I/O or EC responds on multiple ports (0x2e and 0x4e), the code will do the wrong thing (namely, initialize the hardware twice). I have no idea if we should handle such situations, and whether we should ignore the second chip with identical ID or not. Initializing the hardware twice for the IT87* family is _not_ a problem, but I don't know how well IT85* can handle it (and whether IT85* would listen at more than one port anyway). Corresponding to flashrom svn r1289. Signed-off-by: Carl-Daniel Hailfinger <> Thanks to Thomas Schneider for testing on a board with ITE IT87* SPI. Test report (success) is here: Thanks to David Hendricks for testing on a Google Cr-48 laptop with ITE IT85* EC SPI. Test report (success) is here: Acked-by: David Hendricks <>
Diffstat (limited to 'internal.c')
1 files changed, 15 insertions, 3 deletions
diff --git a/internal.c b/internal.c
index c96db99..d3866ba 100644
--- a/internal.c
+++ b/internal.c
@@ -99,17 +99,29 @@ int force_boardenable = 0;
int force_boardmismatch = 0;
#if defined(__i386__) || defined(__x86_64__)
-struct superio superio = {};
void probe_superio(void)
- superio = probe_superio_ite();
+ probe_superio_ite();
#if 0
/* Winbond Super I/O code is not yet available. */
if (superio.vendor == SUPERIO_VENDOR_NONE)
superio = probe_superio_winbond();
+int superio_count = 0;
+struct superio superios[SUPERIO_MAX_COUNT];
+int register_superio(struct superio s)
+ if (superio_count == SUPERIO_MAX_COUNT)
+ return 1;
+ superios[superio_count++] = s;
+ return 0;
int is_laptop = 0;
OpenPOWER on IntegriCloud