From 5f45fc234fd37d88d387a192ba748e116f5b9d16 Mon Sep 17 00:00:00 2001 From: Uwe Hermann Date: Fri, 28 Sep 2007 15:02:17 +0000 Subject: 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 --- util/superiotool/smsc.c | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'util/superiotool') diff --git a/util/superiotool/smsc.c b/util/superiotool/smsc.c index c2fed31193..64995c2a6c 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); +} + -- cgit v1.2.3