summaryrefslogtreecommitdiff
path: root/util/superiotool/ite.c
diff options
context:
space:
mode:
authorUwe Hermann <uwe@hermann-uwe.de>2007-09-19 00:48:42 +0000
committerUwe Hermann <uwe@hermann-uwe.de>2007-09-19 00:48:42 +0000
commit25a6c0f18ce8f2db4483fa8e65a5f5aa5042d958 (patch)
tree8ada258f72d569774a4acbe18fd55857e6c63002 /util/superiotool/ite.c
parentc73ea4d4fc86a0e3a3c42bec45942e0354dae171 (diff)
Split out enter_conf_mode_*()/exit_conf_mode_() functions, we'll soon need
them. Reduce code duplication a bit by improved 'no dump available' handling. Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de> Acked-by: Uwe Hermann <uwe@hermann-uwe.de> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@2785 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'util/superiotool/ite.c')
-rw-r--r--util/superiotool/ite.c34
1 files changed, 16 insertions, 18 deletions
diff --git a/util/superiotool/ite.c b/util/superiotool/ite.c
index 938613efd4..8b0fc53b4b 100644
--- a/util/superiotool/ite.c
+++ b/util/superiotool/ite.c
@@ -211,10 +211,8 @@ void dump_ite(uint16_t port, uint16_t id)
}
}
-void probe_idregs_ite(uint16_t port)
+void enter_conf_mode_ite(uint16_t port)
{
- uint16_t id, chipver;
-
/* Enable configuration sequence (ITE uses this for newer IT87[012]x)
* IT871[01] uses 0x87, 0x87 -> fintek detection should handle it
* IT8708 uses 0x87, 0x87 -> fintek detection should handle it
@@ -230,6 +228,18 @@ void probe_idregs_ite(uint16_t port)
outb(0x55, port);
else
outb(0xAA, port);
+}
+
+void exit_conf_mode_ite(uint16_t port)
+{
+ regwrite(port, 0x02, 0x02);
+}
+
+void probe_idregs_ite(uint16_t port)
+{
+ uint16_t id, chipver;
+
+ enter_conf_mode_ite(port);
/* Read Chip ID Byte 1. */
id = regval(port, 0x20);
@@ -252,20 +262,8 @@ void probe_idregs_ite(uint16_t port)
printf("Super I/O found at 0x%02x: id=0x%04x, chipver=0x%01x\n",
port, id, chipver);
- switch (id) {
- case 0x8702:
- case 0x8705:
- case 0x8708:
- case 0x8712:
- case 0x8716:
- case 0x8718:
- case 0x8726:
- dump_ite(port, id);
- break;
- default:
- printf("No dump for ID 0x%04x\n", id);
- break;
- }
- regwrite(port, 0x02, 0x02); /* Exit MB PnP mode. */
+ dump_ite(port, id);
+
+ exit_conf_mode_ite(port);
}