Drop support for the --human-readable option. It's not any more useful than
the --dump option, it just means lots of additional work for no gain, IMO. Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de> Acked-by: Stefan Reinauer <stepan@coresystems.de> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@2872 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
This commit is contained in:
parent
d937b5243c
commit
7dabe5ea0d
|
@ -33,7 +33,6 @@ Usage
|
||||||
$ superiotool [-d] [-D] [-V] [-v] [-h]
|
$ superiotool [-d] [-D] [-V] [-v] [-h]
|
||||||
|
|
||||||
-d | --dump Dump Super I/O registers
|
-d | --dump Dump Super I/O registers
|
||||||
-D | --dump-readable Dump Super I/O registers in human-readable format
|
|
||||||
-V | --verbose Verbose mode
|
-V | --verbose Verbose mode
|
||||||
-v | --version Show the superiotool version
|
-v | --version Show the superiotool version
|
||||||
-h | --help Show a short help text
|
-h | --help Show a short help text
|
||||||
|
@ -51,10 +50,6 @@ Typical usage of superiotool:
|
||||||
|
|
||||||
$ superiotool -d
|
$ superiotool -d
|
||||||
|
|
||||||
- Detailed register dump in human-readable format:
|
|
||||||
|
|
||||||
$ superiotool -D
|
|
||||||
|
|
||||||
|
|
||||||
Supported Super I/O Chips
|
Supported Super I/O Chips
|
||||||
-------------------------
|
-------------------------
|
||||||
|
|
|
@ -92,7 +92,6 @@ void probe_idregs_ali(uint16_t port)
|
||||||
chip_found = 1;
|
chip_found = 1;
|
||||||
|
|
||||||
dump_superio("ALi", reg_table, port, id);
|
dump_superio("ALi", reg_table, port, id);
|
||||||
dump_superio_readable(port); /* TODO */
|
|
||||||
|
|
||||||
exit_conf_mode_ali(port);
|
exit_conf_mode_ali(port);
|
||||||
}
|
}
|
||||||
|
|
|
@ -70,68 +70,6 @@ const static struct superio_registers reg_table[] = {
|
||||||
{EOT}
|
{EOT}
|
||||||
};
|
};
|
||||||
|
|
||||||
static void dump_readable_fintek(uint16_t port, uint16_t did)
|
|
||||||
{
|
|
||||||
if (!dump_readable)
|
|
||||||
return;
|
|
||||||
|
|
||||||
printf("Human-readable register dump:\n");
|
|
||||||
|
|
||||||
printf("Flash write is %s.\n",
|
|
||||||
regval(port, 0x28) & 0x80 ? "enabled" : "disabled");
|
|
||||||
printf("Flash control is 0x%04x.\n", regval(port, 0x28));
|
|
||||||
printf("27=%02x\n", regval(port, 0x27));
|
|
||||||
printf("29=%02x\n", regval(port, 0x29));
|
|
||||||
printf("2a=%02x\n", regval(port, 0x2a));
|
|
||||||
printf("2b=%02x\n", regval(port, 0x2b));
|
|
||||||
|
|
||||||
/* Select UART 1. */
|
|
||||||
regwrite(port, 0x07, 0x01);
|
|
||||||
printf("UART1 is %s\n",
|
|
||||||
regval(port, 0x30) & 1 ? "enabled" : "disabled");
|
|
||||||
printf("UART1 base=%02x%02x, irq=%02x, mode=%s\n", regval(port, 0x60),
|
|
||||||
regval(port, 0x61), regval(port, 0x70) & 0x0f,
|
|
||||||
regval(port, 0xf0) & 0x10 ? "RS485" : "RS232");
|
|
||||||
|
|
||||||
/* Select UART 2. */
|
|
||||||
regwrite(port, 0x07, 0x02);
|
|
||||||
printf("UART2 is %s\n",
|
|
||||||
regval(port, 0x30) & 1 ? "enabled" : "disabled");
|
|
||||||
printf("UART2 base=%02x%02x, irq=%02x, mode=%s\n", regval(port, 0x60),
|
|
||||||
regval(port, 0x61), regval(port, 0x70) & 0x0f,
|
|
||||||
regval(port, 0xf0) & 0x10 ? "RS485" : "RS232");
|
|
||||||
|
|
||||||
/* Select parallel port. */
|
|
||||||
regwrite(port, 0x07, 0x03);
|
|
||||||
printf("PARPORT is %s\n",
|
|
||||||
regval(port, 0x30) & 1 ? "enabled" : "disabled");
|
|
||||||
printf("PARPORT base=%02x%02x, irq=%02x\n", regval(port, 0x60),
|
|
||||||
regval(port, 0x61), regval(port, 0x70) & 0x0f);
|
|
||||||
|
|
||||||
/* Select HW monitor. */
|
|
||||||
regwrite(port, 0x07, 0x04);
|
|
||||||
printf("HW monitor is %s\n",
|
|
||||||
regval(port, 0x30) & 1 ? "enabled" : "disabled");
|
|
||||||
printf("HW monitor base=%02x%02x, irq=%02x\n", regval(port, 0x60),
|
|
||||||
regval(port, 0x61), regval(port, 0x70) & 0x0f);
|
|
||||||
|
|
||||||
/* Select GPIO. */
|
|
||||||
regwrite(port, 0x07, 0x05);
|
|
||||||
printf("GPIO is %s\n", regval(port, 0x30) & 1 ? "enabled" : "disabled");
|
|
||||||
printf
|
|
||||||
("GPIO 70=%02x, e0=%02x, e1=%02x, e2=%02x, e3=%02x, e4=%02x, e5=%02x\n",
|
|
||||||
regval(port, 0x70), regval(port, 0xe0), regval(port, 0xe1),
|
|
||||||
regval(port, 0xe2), regval(port, 0xe3), regval(port, 0xe4),
|
|
||||||
regval(port, 0xe5));
|
|
||||||
printf
|
|
||||||
("GPIO e6=%02x, e7=%02x, e8=%02x, e9=%02x, f0=%02x, f1=%02x, f3=%02x, f4=%02x\n",
|
|
||||||
regval(port, 0xe6), regval(port, 0xe7), regval(port, 0xe8),
|
|
||||||
regval(port, 0xe9), regval(port, 0xf0), regval(port, 0xf1),
|
|
||||||
regval(port, 0xf3), regval(port, 0xf4));
|
|
||||||
printf("GPIO f5=%02x, f6=%02x, f7=%02x, f8=%02x\n", regval(port, 0xf5),
|
|
||||||
regval(port, 0xf6), regval(port, 0xf7), regval(port, 0xf8));
|
|
||||||
}
|
|
||||||
|
|
||||||
void probe_idregs_fintek(uint16_t port)
|
void probe_idregs_fintek(uint16_t port)
|
||||||
{
|
{
|
||||||
uint16_t vid, did;
|
uint16_t vid, did;
|
||||||
|
@ -158,7 +96,6 @@ void probe_idregs_fintek(uint16_t port)
|
||||||
chip_found = 1;
|
chip_found = 1;
|
||||||
|
|
||||||
dump_superio("Fintek", reg_table, port, did);
|
dump_superio("Fintek", reg_table, port, did);
|
||||||
dump_readable_fintek(port, did);
|
|
||||||
|
|
||||||
exit_conf_mode_winbond_fintek_ite_8787(port);
|
exit_conf_mode_winbond_fintek_ite_8787(port);
|
||||||
}
|
}
|
||||||
|
|
|
@ -369,7 +369,6 @@ static void probe_idregs_ite_helper(const char *init, uint16_t port)
|
||||||
chip_found = 1;
|
chip_found = 1;
|
||||||
|
|
||||||
dump_superio("ITE", reg_table, port, id);
|
dump_superio("ITE", reg_table, port, id);
|
||||||
dump_superio_readable(port); /* TODO */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void probe_idregs_ite(uint16_t port)
|
void probe_idregs_ite(uint16_t port)
|
||||||
|
|
|
@ -135,42 +135,6 @@ const static struct superio_registers reg_table[] = {
|
||||||
{EOT}
|
{EOT}
|
||||||
};
|
};
|
||||||
|
|
||||||
static void dump_readable_pc8374l(uint16_t port)
|
|
||||||
{
|
|
||||||
if (!dump_readable)
|
|
||||||
return;
|
|
||||||
|
|
||||||
printf("Human-readable register dump:\n");
|
|
||||||
|
|
||||||
printf("Enables: 21=%02x, 22=%02x, 23=%02x, 24=%02x, 26=%02x\n",
|
|
||||||
regval(port, 0x21), regval(port, 0x22), regval(port, 0x23),
|
|
||||||
regval(port, 0x24), regval(port, 0x26));
|
|
||||||
printf("SMBUS at %02x\n", regval(port, 0x2a));
|
|
||||||
|
|
||||||
/* Check COM1. This is all we care about at present. */
|
|
||||||
printf("COM 1 is globally %s\n",
|
|
||||||
regval(port, 0x26) & 8 ? "disabled" : "enabled");
|
|
||||||
|
|
||||||
/* Select COM1. */
|
|
||||||
regwrite(port, 0x07, 0x03);
|
|
||||||
printf("COM 1 is locally %s\n",
|
|
||||||
regval(port, 0x30) & 1 ? "enabled" : "disabled");
|
|
||||||
printf
|
|
||||||
("COM1 60=%02x, 61=%02x, 70=%02x, 71=%02x, 74=%02x, 75=%02x, f0=%02x\n",
|
|
||||||
regval(port, 0x60), regval(port, 0x61), regval(port, 0x70),
|
|
||||||
regval(port, 0x71), regval(port, 0x74), regval(port, 0x75),
|
|
||||||
regval(port, 0xf0));
|
|
||||||
|
|
||||||
/* Select GPIO. */
|
|
||||||
regwrite(port, 0x07, 0x07);
|
|
||||||
printf("GPIO is %s\n", regval(port, 0x30) & 1 ? "enabled" : "disabled");
|
|
||||||
printf
|
|
||||||
("GPIO 60=%02x, 61=%02x, 70=%02x, 71=%02x, 74=%02x, 75=%02x, f0=%02x\n",
|
|
||||||
regval(port, 0x60), regval(port, 0x61), regval(port, 0x70),
|
|
||||||
regval(port, 0x71), regval(port, 0x74), regval(port, 0x75),
|
|
||||||
regval(port, 0xf0));
|
|
||||||
}
|
|
||||||
|
|
||||||
void probe_idregs_nsc(uint16_t port)
|
void probe_idregs_nsc(uint16_t port)
|
||||||
{
|
{
|
||||||
uint8_t id, rev;
|
uint8_t id, rev;
|
||||||
|
@ -205,7 +169,5 @@ void probe_idregs_nsc(uint16_t port)
|
||||||
chip_found = 1;
|
chip_found = 1;
|
||||||
|
|
||||||
dump_superio("NSC", reg_table, port, id);
|
dump_superio("NSC", reg_table, port, id);
|
||||||
if (id == 0xf1)
|
|
||||||
dump_readable_pc8374l(port);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -381,7 +381,6 @@ static void probe_idregs_smsc_helper(uint16_t port, uint8_t idreg,
|
||||||
chip_found = 1;
|
chip_found = 1;
|
||||||
|
|
||||||
dump_superio((id == 0x77 ? "ASUS" : "SMSC"), reg_table, port, id);
|
dump_superio((id == 0x77 ? "ASUS" : "SMSC"), reg_table, port, id);
|
||||||
dump_superio_readable(port); /* TODO */
|
|
||||||
|
|
||||||
exit_conf_mode_smsc(port);
|
exit_conf_mode_smsc(port);
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
.SH NAME
|
.SH NAME
|
||||||
superiotool \- Super I/O detection tool
|
superiotool \- Super I/O detection tool
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
.B superiotool \fR[\fB\-dDVvh\fR]
|
.B superiotool \fR[\fB\-dVvh\fR]
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
.B superiotool
|
.B superiotool
|
||||||
is a GPL'd user-space utility which can
|
is a GPL'd user-space utility which can
|
||||||
|
@ -72,17 +72,6 @@ which can mean several things. It's recommended to consult the datasheet for
|
||||||
detailed information about the
|
detailed information about the
|
||||||
.BR MM " fields."
|
.BR MM " fields."
|
||||||
.TP
|
.TP
|
||||||
.B "\-D, \-\-dump-readable"
|
|
||||||
Dump Super I/O registers in human-readable format (if the Super I/O chip
|
|
||||||
is detected and
|
|
||||||
.B superiotool
|
|
||||||
supports the
|
|
||||||
.B "\-\-dump-readable"
|
|
||||||
option for this chip).
|
|
||||||
.sp
|
|
||||||
The output format of this option is different for every Super I/O, and only
|
|
||||||
very few Super I/Os currently support this option.
|
|
||||||
.TP
|
|
||||||
.B "\-V, \-\-verbose"
|
.B "\-V, \-\-verbose"
|
||||||
Enable verbose mode. This option can be used together with the
|
Enable verbose mode. This option can be used together with the
|
||||||
.BR "\-d" " or " "\-D" " option (or both)."
|
.BR "\-d" " or " "\-D" " option (or both)."
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
#include "superiotool.h"
|
#include "superiotool.h"
|
||||||
|
|
||||||
/* Command line options. */
|
/* Command line options. */
|
||||||
int dump = 0, dump_readable = 0, verbose = 0;
|
int dump = 0, verbose = 0;
|
||||||
|
|
||||||
/* Global flag which indicates whether a chip was detected at all. */
|
/* Global flag which indicates whether a chip was detected at all. */
|
||||||
int chip_found = 0;
|
int chip_found = 0;
|
||||||
|
@ -151,13 +151,6 @@ 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 probing_for(const char *vendor, const char *info, uint16_t port)
|
void probing_for(const char *vendor, const char *info, uint16_t port)
|
||||||
{
|
{
|
||||||
if (!verbose)
|
if (!verbose)
|
||||||
|
@ -179,22 +172,18 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
const static struct option long_options[] = {
|
const static struct option long_options[] = {
|
||||||
{"dump", no_argument, NULL, 'd'},
|
{"dump", no_argument, NULL, 'd'},
|
||||||
{"dump-readable", no_argument, NULL, 'D'},
|
|
||||||
{"verbose", no_argument, NULL, 'V'},
|
{"verbose", no_argument, NULL, 'V'},
|
||||||
{"version", no_argument, NULL, 'v'},
|
{"version", no_argument, NULL, 'v'},
|
||||||
{"help", no_argument, NULL, 'h'},
|
{"help", no_argument, NULL, 'h'},
|
||||||
{0, 0, 0, 0}
|
{0, 0, 0, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
while ((opt = getopt_long(argc, argv, "dDVvh",
|
while ((opt = getopt_long(argc, argv, "dVvh",
|
||||||
long_options, &option_index)) != EOF) {
|
long_options, &option_index)) != EOF) {
|
||||||
switch (opt) {
|
switch (opt) {
|
||||||
case 'd':
|
case 'd':
|
||||||
dump = 1;
|
dump = 1;
|
||||||
break;
|
break;
|
||||||
case 'D':
|
|
||||||
dump_readable = 1;
|
|
||||||
break;
|
|
||||||
case 'V':
|
case 'V':
|
||||||
verbose = 1;
|
verbose = 1;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -29,9 +29,8 @@
|
||||||
#include <getopt.h>
|
#include <getopt.h>
|
||||||
#include <sys/io.h>
|
#include <sys/io.h>
|
||||||
|
|
||||||
#define USAGE "Usage: superiotool [-d] [-D] [-V] [-v] [-h]\n\n\
|
#define USAGE "Usage: superiotool [-d] [-V] [-v] [-h]\n\n\
|
||||||
-d | --dump Dump Super I/O registers\n\
|
-d | --dump Dump Super I/O registers\n\
|
||||||
-D | --dump-readable Dump Super I/O registers in human-readable format\n\
|
|
||||||
-V | --verbose Verbose mode\n\
|
-V | --verbose Verbose mode\n\
|
||||||
-v | --version Show the superiotool version\n\
|
-v | --version Show the superiotool version\n\
|
||||||
-h | --help Show a short help text\n\n\
|
-h | --help Show a short help text\n\n\
|
||||||
|
@ -55,7 +54,7 @@ and print its vendor, name, ID, revision, and config port.\n"
|
||||||
#define MAXNUMPORTS (6 + 1) /* Maximum number of Super I/O ports */
|
#define MAXNUMPORTS (6 + 1) /* Maximum number of Super I/O ports */
|
||||||
|
|
||||||
/* Command line parameters. */
|
/* Command line parameters. */
|
||||||
extern int dump, dump_readable, verbose;
|
extern int dump, verbose;
|
||||||
|
|
||||||
extern int chip_found;
|
extern int chip_found;
|
||||||
|
|
||||||
|
@ -80,7 +79,6 @@ const char *get_superio_name(const struct superio_registers reg_table[],
|
||||||
uint16_t id);
|
uint16_t id);
|
||||||
void dump_superio(const char *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);
|
uint16_t port, uint16_t id);
|
||||||
void dump_superio_readable(uint16_t port);
|
|
||||||
void probing_for(const char *vendor, const char *info, uint16_t port);
|
void probing_for(const char *vendor, const char *info, uint16_t port);
|
||||||
|
|
||||||
/* ali.c */
|
/* ali.c */
|
||||||
|
|
|
@ -428,7 +428,6 @@ void probe_idregs_winbond_helper(const char *init, uint16_t port)
|
||||||
|
|
||||||
/* TODO: Special notes in dump output for the MISC entries. */
|
/* TODO: Special notes in dump output for the MISC entries. */
|
||||||
dump_superio("Winbond", reg_table, port, id);
|
dump_superio("Winbond", reg_table, port, id);
|
||||||
dump_superio_readable(port); /* TODO */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void probe_idregs_winbond(uint16_t port)
|
void probe_idregs_winbond(uint16_t port)
|
||||||
|
|
Loading…
Reference in New Issue