From: Uwe Hermann Date: Fri, 28 Sep 2007 15:02:17 +0000 (+0000) Subject: Fix up the SMSC detection code to probe _both_ old- and new-style X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=commitdiff_plain;h=5f45fc234fd37d88d387a192ba748e116f5b9d16;p=coreboot.git Fix up the SMSC detection code to probe _both_ old- and new-style Super I/Os from SMSC. Otherwise not all of them are detected (and there could theoretically be _two_ of them in a system, so we should probe for both types anyway). Signed-off-by: Uwe Hermann Acked-by: Uwe Hermann git-svn-id: svn://svn.coreboot.org/coreboot/trunk@2812 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1 --- diff --git a/util/superiotool/smsc.c b/util/superiotool/smsc.c index c2fed3119..64995c2a6 100644 --- a/util/superiotool/smsc.c +++ b/util/superiotool/smsc.c @@ -129,22 +129,15 @@ static void exit_conf_mode_smsc(uint16_t port) outb(0xaa, port); } -void probe_idregs_smsc(uint16_t port) +static void probe_idregs_smsc_helper(uint16_t port, uint8_t idreg, + uint8_t revreg) { uint8_t id, rev; enter_conf_mode_smsc(port); - /* Check for older SMSC Super I/Os. */ - id = regval(port, DEVICE_ID_REG_OLD); - rev = regval(port, DEVICE_REV_REG_OLD); - - if (superio_unknown(reg_table, id)) - no_superio_found(port); - - /* Check for newer SMSC Super I/Os. */ - id = regval(port, DEVICE_ID_REG); - rev = regval(port, DEVICE_REV_REG); + id = regval(port, idreg); + rev = regval(port, revreg); if (superio_unknown(reg_table, id)) { no_superio_found(port); @@ -162,3 +155,9 @@ void probe_idregs_smsc(uint16_t port) exit_conf_mode_smsc(port); } +void probe_idregs_smsc(uint16_t port) +{ + probe_idregs_smsc_helper(port, DEVICE_ID_REG, DEVICE_REV_REG); + probe_idregs_smsc_helper(port, DEVICE_ID_REG_OLD, DEVICE_REV_REG_OLD); +} +