summaryrefslogtreecommitdiff
path: root/util/superiotool/fintek.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/fintek.c
parentc73ea4d4fc86a0e3a3c42bec45942e0354dae171 (diff)
downloadcoreboot-25a6c0f18ce8f2db4483fa8e65a5f5aa5042d958.tar.xz
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/fintek.c')
-rw-r--r--util/superiotool/fintek.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/util/superiotool/fintek.c b/util/superiotool/fintek.c
index c12954c7f9..3e7bf9fd36 100644
--- a/util/superiotool/fintek.c
+++ b/util/superiotool/fintek.c
@@ -89,15 +89,26 @@ void dump_fintek(uint16_t port, uint16_t did)
regval(port, 0xf6), regval(port, 0xf7), regval(port, 0xf8));
}
-void probe_idregs_fintek(uint16_t port)
+void enter_conf_mode_fintek(uint16_t port)
{
- uint16_t vid, did, success = 0;
-
/* Enable configuration sequence (Fintek uses this for example)
* Older ITE chips have the same enable sequence.
*/
outb(0x87, port);
outb(0x87, port);
+}
+
+void exit_conf_mode_fintek(uint16_t port)
+{
+ /* Exit MB PnP mode (for Fintek, doesn't hurt ITE). */
+ outb(0xaa, port);
+}
+
+void probe_idregs_fintek(uint16_t port)
+{
+ uint16_t vid, did, success = 0;
+
+ enter_conf_mode_fintek(port);
outb(0x20, port);
if (inb(port) != 0x20) {
@@ -143,7 +154,6 @@ void probe_idregs_fintek(uint16_t port)
if (!success)
printf("No dump for vid 0x%04x, did 0x%04x\n", vid, did);
- /* Exit MB PnP mode (for Fintek, doesn't hurt ITE). */
- outb(0xaa, port);
+ exit_conf_mode_fintek(port);
}