diff options
author | Uwe Hermann <uwe@hermann-uwe.de> | 2007-09-19 00:48:42 +0000 |
---|---|---|
committer | Uwe Hermann <uwe@hermann-uwe.de> | 2007-09-19 00:48:42 +0000 |
commit | 25a6c0f18ce8f2db4483fa8e65a5f5aa5042d958 (patch) | |
tree | 8ada258f72d569774a4acbe18fd55857e6c63002 /util/superiotool/superiotool.c | |
parent | c73ea4d4fc86a0e3a3c42bec45942e0354dae171 (diff) | |
download | coreboot-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/superiotool.c')
-rw-r--r-- | util/superiotool/superiotool.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/util/superiotool/superiotool.c b/util/superiotool/superiotool.c index e95f1baac6..fd49c309ee 100644 --- a/util/superiotool/superiotool.c +++ b/util/superiotool/superiotool.c @@ -34,14 +34,12 @@ void regwrite(uint16_t port, uint8_t reg, uint8_t val) outb(val, port + 1); } -void dump_superio(const char *name, const struct superio_registers reg_table[], +void dump_superio(const char *vendor, const struct superio_registers reg_table[], uint16_t port, uint16_t id) { - int i, j, k; + int i, j, k, nodump; int *idx; - printf("%s ", name); - for (i = 0; /* Nothing */; i++) { if (reg_table[i].superio_id == EOT) break; @@ -49,12 +47,15 @@ void dump_superio(const char *name, const struct superio_registers reg_table[], if ((uint16_t)reg_table[i].superio_id != id) continue; - printf("%s\n", reg_table[i].name); + nodump = 1; for (j = 0; /* Nothing */; j++) { if (reg_table[i].ldn[j].ldn == EOT) break; + printf("%s %s\n", vendor, reg_table[i].name); + nodump = 0; + if (reg_table[i].ldn[j].ldn != NOLDN) { printf("Switching to LDN 0x%02x\n", reg_table[i].ldn[j].ldn); @@ -91,6 +92,9 @@ void dump_superio(const char *name, const struct superio_registers reg_table[], } printf("\n"); } + + if (nodump) + printf("No dump for %s %s\n", vendor, reg_table[i].name); } } |