summaryrefslogtreecommitdiffstats
path: root/util/superiotool/superiotool.c
diff options
context:
space:
mode:
authorUwe Hermann <uwe@hermann-uwe.de>2007-09-20 23:57:44 +0000
committerUwe Hermann <uwe@hermann-uwe.de>2007-09-20 23:57:44 +0000
commiteddc473ce0753bfd8aa55cc19bcec991866694fd (patch)
treec710be3d289d2d649572bf59cc429e2edc44cddb /util/superiotool/superiotool.c
parentb4db2209f9e01e1a013cc33356bceec57c3a3c80 (diff)
downloadcoreboot-eddc473ce0753bfd8aa55cc19bcec991866694fd.tar.gz
coreboot-eddc473ce0753bfd8aa55cc19bcec991866694fd.tar.bz2
coreboot-eddc473ce0753bfd8aa55cc19bcec991866694fd.zip
Add -D / --dump-readable option which prints the Super I/O register
contents in human-readable form (e.g. "COM1 enabled" etc.) instead of the hex-table format from -d / --dump. 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@2795 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'util/superiotool/superiotool.c')
-rw-r--r--util/superiotool/superiotool.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/util/superiotool/superiotool.c b/util/superiotool/superiotool.c
index 0a253ad62391..13e55556d5f9 100644
--- a/util/superiotool/superiotool.c
+++ b/util/superiotool/superiotool.c
@@ -23,7 +23,7 @@
#include "superiotool.h"
/* Command line options. */
-int dump = 0, verbose = 0;
+int dump = 0, dump_readable = 0, verbose = 0;
uint8_t regval(uint16_t port, uint8_t reg)
{
@@ -147,6 +147,13 @@ void dump_superio(const char *vendor,
}
}
+void dump_superio_readable(uint16_t port)
+{
+ /* TODO */
+ if (dump_readable)
+ printf("No human-readable dump available for this Super I/O\n");
+}
+
void no_superio_found(uint16_t port)
{
if (!verbose)
@@ -164,19 +171,23 @@ int main(int argc, char *argv[])
int i, j, opt, option_index;
const static struct option long_options[] = {
- {"dump", no_argument, NULL, 'd'},
- {"verbose", no_argument, NULL, 'V'},
- {"version", no_argument, NULL, 'v'},
- {"help", no_argument, NULL, 'h'},
+ {"dump", no_argument, NULL, 'd'},
+ {"dump-readable", no_argument, NULL, 'D'},
+ {"verbose", no_argument, NULL, 'V'},
+ {"version", no_argument, NULL, 'v'},
+ {"help", no_argument, NULL, 'h'},
{0, 0, 0, 0}
};
- while ((opt = getopt_long(argc, argv, "dVvh",
+ while ((opt = getopt_long(argc, argv, "dDVvh",
long_options, &option_index)) != EOF) {
switch (opt) {
case 'd':
dump = 1;
break;
+ case 'D':
+ dump_readable = 1;
+ break;
case 'V':
verbose = 1;
break;