summaryrefslogtreecommitdiff
path: root/util/superiotool
diff options
context:
space:
mode:
authorUwe Hermann <uwe@hermann-uwe.de>2007-09-28 15:45:43 +0000
committerUwe Hermann <uwe@hermann-uwe.de>2007-09-28 15:45:43 +0000
commitafe83092020d37d1b8629b3b92f9179e925e72fe (patch)
tree417b1e7a9720742ef6ad231f2970e377f491c158 /util/superiotool
parent945045b1ea380f8224bee426cb91b897562df1c8 (diff)
downloadcoreboot-afe83092020d37d1b8629b3b92f9179e925e72fe.tar.xz
Random minor fixes. Use svn revision as superiotool version number.
Make the -V output more informative. 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@2814 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'util/superiotool')
-rw-r--r--util/superiotool/Makefile2
-rw-r--r--util/superiotool/ali.c4
-rw-r--r--util/superiotool/fintek.c4
-rw-r--r--util/superiotool/ite.c10
-rw-r--r--util/superiotool/nsc.c4
-rw-r--r--util/superiotool/smsc.c4
-rw-r--r--util/superiotool/superiotool.c10
-rw-r--r--util/superiotool/superiotool.h8
-rw-r--r--util/superiotool/winbond.c20
9 files changed, 34 insertions, 32 deletions
diff --git a/util/superiotool/Makefile b/util/superiotool/Makefile
index 45d218eebd..1491075e7f 100644
--- a/util/superiotool/Makefile
+++ b/util/superiotool/Makefile
@@ -1,5 +1,5 @@
##
-## This file is part of the LinuxBIOS project.
+## This file is part of the superiotool project.
##
## Copyright (C) 2007 Uwe Hermann <uwe@hermann-uwe.de>
##
diff --git a/util/superiotool/ali.c b/util/superiotool/ali.c
index a250088504..99dd00f694 100644
--- a/util/superiotool/ali.c
+++ b/util/superiotool/ali.c
@@ -1,5 +1,5 @@
/*
- * This file is part of the LinuxBIOS project.
+ * This file is part of the superiotool project.
*
* Copyright (C) 2007 Uwe Hermann <uwe@hermann-uwe.de>
*
@@ -79,7 +79,7 @@ void probe_idregs_ali(uint16_t port)
rev = regval(port, DEVICE_REV_REG);
if (superio_unknown(reg_table, id)) {
- no_superio_found(port);
+ no_superio_found("ALi", "", port);
exit_conf_mode_ali(port);
return;
}
diff --git a/util/superiotool/fintek.c b/util/superiotool/fintek.c
index 7794481fad..757d01c020 100644
--- a/util/superiotool/fintek.c
+++ b/util/superiotool/fintek.c
@@ -1,5 +1,5 @@
/*
- * This file is part of the LinuxBIOS project.
+ * This file is part of the superiotool project.
*
* Copyright (C) 2006 coresystems GmbH <info@coresystems.de>
* Copyright (C) 2007 Uwe Hermann <uwe@hermann-uwe.de>
@@ -145,7 +145,7 @@ void probe_idregs_fintek(uint16_t port)
vid |= (regval(port, VENDOR_ID_BYTE2_REG) << 8);
if (vid != FINTEK_VENDOR_ID || superio_unknown(reg_table, did)) {
- no_superio_found(port);
+ no_superio_found("Fintek", "", port);
exit_conf_mode_winbond_fintek_ite_8787(port);
return;
}
diff --git a/util/superiotool/ite.c b/util/superiotool/ite.c
index 3fe7190207..e44460c065 100644
--- a/util/superiotool/ite.c
+++ b/util/superiotool/ite.c
@@ -1,5 +1,5 @@
/*
- * This file is part of the LinuxBIOS project.
+ * This file is part of the superiotool project.
*
* Copyright (C) 2007 Carl-Daniel Hailfinger
* Copyright (C) 2007 Uwe Hermann <uwe@hermann-uwe.de>
@@ -261,7 +261,7 @@ static void exit_conf_mode_ite(uint16_t port)
regwrite(port, 0x02, 0x02);
}
-static void probe_idregs_ite_helper(uint16_t port)
+static void probe_idregs_ite_helper(const char *init, uint16_t port)
{
uint16_t id, chipver;
@@ -270,7 +270,7 @@ static void probe_idregs_ite_helper(uint16_t port)
chipver = regval(port, CHIP_VERSION_REG) & 0x0f; /* Only bits 3..0 */
if (superio_unknown(reg_table, id)) {
- no_superio_found(port);
+ no_superio_found("ITE", init, port);
exit_conf_mode_ite(port);
return;
}
@@ -285,11 +285,11 @@ static void probe_idregs_ite_helper(uint16_t port)
void probe_idregs_ite(uint16_t port)
{
enter_conf_mode_ite(port);
- probe_idregs_ite_helper(port);
+ probe_idregs_ite_helper("(init=0x87,0x01,0x55,0x55/0xaa) ", port);
exit_conf_mode_ite(port);
enter_conf_mode_winbond_fintek_ite_8787(port);
- probe_idregs_ite_helper(port);
+ probe_idregs_ite_helper("(init=0x87,0x87) ", port);
exit_conf_mode_winbond_fintek_ite_8787(port);
}
diff --git a/util/superiotool/nsc.c b/util/superiotool/nsc.c
index 797f3d4c4d..0b58642a40 100644
--- a/util/superiotool/nsc.c
+++ b/util/superiotool/nsc.c
@@ -1,5 +1,5 @@
/*
- * This file is part of the LinuxBIOS project.
+ * This file is part of the superiotool project.
*
* Copyright (C) 2006 Ronald Minnich <rminnich@gmail.com>
*
@@ -65,7 +65,7 @@ void probe_idregs_simple(uint16_t port)
outb(0x20, port);
if (inb(port) != 0x20) {
- no_superio_found(port);
+ no_superio_found("NSC", "", port);
/* TODO: Exit config mode? */
return;
}
diff --git a/util/superiotool/smsc.c b/util/superiotool/smsc.c
index 64995c2a6c..a6f2749710 100644
--- a/util/superiotool/smsc.c
+++ b/util/superiotool/smsc.c
@@ -1,5 +1,5 @@
/*
- * This file is part of the LinuxBIOS project.
+ * This file is part of the superiotool project.
*
* Copyright (C) 2007 Uwe Hermann <uwe@hermann-uwe.de>
*
@@ -140,7 +140,7 @@ static void probe_idregs_smsc_helper(uint16_t port, uint8_t idreg,
rev = regval(port, revreg);
if (superio_unknown(reg_table, id)) {
- no_superio_found(port);
+ no_superio_found("SMSC", "", port);
exit_conf_mode_smsc(port);
return;
}
diff --git a/util/superiotool/superiotool.c b/util/superiotool/superiotool.c
index 99d97275d5..9bde779a81 100644
--- a/util/superiotool/superiotool.c
+++ b/util/superiotool/superiotool.c
@@ -1,5 +1,5 @@
/*
- * This file is part of the LinuxBIOS project.
+ * This file is part of the superiotool project.
*
* Copyright (C) 2006 Ronald Minnich <rminnich@gmail.com>
* Copyright (C) 2007 Uwe Hermann <uwe@hermann-uwe.de>
@@ -155,15 +155,17 @@ void dump_superio_readable(uint16_t port)
printf("No human-readable dump available for this Super I/O\n");
}
-void no_superio_found(uint16_t port)
+void no_superio_found(const char *vendor, const char *info, uint16_t port)
{
if (!verbose)
return;
if (inb(port) == 0xff)
- printf("No Super I/O chip found at 0x%04x\n", port);
+ /* Yes, there's no space between '%s' and 'at'! */
+ printf("Probing for %s Super I/O %sat 0x%x... failed\n",
+ vendor, info, port);
else
- printf("Probing 0x%04x, failed (0x%02x), data returns 0x%02x\n",
+ printf("Probing 0x%x, failed (0x%02x), data returns 0x%02x\n",
port, inb(port), inb(port + 1));
}
diff --git a/util/superiotool/superiotool.h b/util/superiotool/superiotool.h
index 5f2de5dc38..3045124af9 100644
--- a/util/superiotool/superiotool.h
+++ b/util/superiotool/superiotool.h
@@ -1,5 +1,5 @@
/*
- * This file is part of the LinuxBIOS project.
+ * This file is part of the superiotool project.
*
* Copyright (C) 2007 Carl-Daniel Hailfinger
* Copyright (C) 2007 Uwe Hermann <uwe@hermann-uwe.de>
@@ -29,7 +29,7 @@
#include <getopt.h>
#include <sys/io.h>
-#define SUPERIOTOOL_VERSION "0.1"
+#define SUPERIOTOOL_VERSION "r$Rev$"
#define USAGE "Usage: superiotool [-d] [-D] [-V] [-v] [-h]\n\n\
-d | --dump Dump Super I/O registers\n\
@@ -38,7 +38,7 @@
-v | --version Show the superiotool version\n\
-h | --help Show a short help text\n\n\
Per default (no options) superiotool will just probe for a Super I/O\n\
-and print its vendor, name, ID, version, and config port.\n"
+and print its vendor, name, ID, revision, and config port.\n"
#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
@@ -79,7 +79,7 @@ const char *get_superio_name(const struct superio_registers reg_table[],
void dump_superio(const char *name, const struct superio_registers reg_table[],
uint16_t port, uint16_t id);
void dump_superio_readable(uint16_t port);
-void no_superio_found(uint16_t port);
+void no_superio_found(const char *vendor, const char *info, uint16_t port);
/* ali.c */
void probe_idregs_ali(uint16_t port);
diff --git a/util/superiotool/winbond.c b/util/superiotool/winbond.c
index 78b002d2ec..f45acb7873 100644
--- a/util/superiotool/winbond.c
+++ b/util/superiotool/winbond.c
@@ -1,5 +1,5 @@
/*
- * This file is part of the LinuxBIOS project.
+ * This file is part of the superiotool project.
*
* Copyright (C) 2007 Uwe Hermann <uwe@hermann-uwe.de>
*
@@ -179,7 +179,7 @@ static void enter_conf_mode_winbond_86(uint16_t port)
outb(0x86, port);
}
-void probe_idregs_winbond_helper(uint16_t port)
+void probe_idregs_winbond_helper(const char *init, uint16_t port)
{
uint16_t id;
uint8_t devid, rev, olddevid;
@@ -199,7 +199,7 @@ void probe_idregs_winbond_helper(uint16_t port)
id = olddevid & 0x0f; /* ID[3..0] */
if (superio_unknown(reg_table, id)) {
- no_superio_found(port);
+ no_superio_found("Winbond", init, port);
exit_conf_mode_winbond_fintek_ite_8787(port);
return;
}
@@ -220,20 +220,20 @@ void probe_idregs_winbond(uint16_t port)
{
/* TODO: Not all init sequences are valid for all ports. */
- enter_conf_mode_winbond_fintek_ite_8787(port);
- probe_idregs_winbond_helper(port);
- exit_conf_mode_winbond_fintek_ite_8787(port);
-
enter_conf_mode_winbond_88(port);
- probe_idregs_winbond_helper(port);
+ probe_idregs_winbond_helper("(init=0x88) ", port);
exit_conf_mode_winbond_fintek_ite_8787(port);
enter_conf_mode_winbond_89(port);
- probe_idregs_winbond_helper(port);
+ probe_idregs_winbond_helper("(init=0x89) ", port);
exit_conf_mode_winbond_fintek_ite_8787(port);
enter_conf_mode_winbond_86(port);
- probe_idregs_winbond_helper(port);
+ probe_idregs_winbond_helper("(init=0x86,0x86) ", port);
+ exit_conf_mode_winbond_fintek_ite_8787(port);
+
+ enter_conf_mode_winbond_fintek_ite_8787(port);
+ probe_idregs_winbond_helper("(init=0x87,0x87) ", port);
exit_conf_mode_winbond_fintek_ite_8787(port);
}