This patch adds support to dump other registers than the primary

pnp-style configuration registers, using the new option -e/--extra-dump.
This patch only adds dumping of the Environmental Controller
configuration registers for the IT8716f chip.

Signed-off-by: Ronald Hoogenboom <hoogenboom30@zonnet.nl>

I (Carl-Daniel) checked the data sheets of the whole IT87[012] series 
and although the environment controller is sometimes called fan 
controller, the location of the register is the same for all models.

Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>


git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3117 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
This commit is contained in:
Ronald Hoogenboom 2008-02-25 22:32:41 +00:00 committed by Carl-Daniel Hailfinger
parent 56cf01f29d
commit 0be73bbf30
5 changed files with 62 additions and 5 deletions

View File

@ -33,6 +33,7 @@ Usage
$ superiotool [-d] [-l] [-V] [-v] [-h] $ superiotool [-d] [-l] [-V] [-v] [-h]
-d | --dump Dump Super I/O register contents -d | --dump Dump Super I/O register contents
-e | --extra-dump Dump Secondary registers too (like EC registers etc.)
-l | --list-supported Show the list of supported Super I/O chips -l | --list-supported Show the list of supported Super I/O chips
-V | --verbose Verbose mode -V | --verbose Verbose mode
-v | --version Show the superiotool version -v | --version Show the superiotool version
@ -95,9 +96,9 @@ Frieder Ferlemann <Frieder.Ferlemann@web.de>
Idwer Vollering <idwer_v@hotmail.com> Idwer Vollering <idwer_v@hotmail.com>
Rasmus Wiman <rasmus@wiman.org> Rasmus Wiman <rasmus@wiman.org>
Robinson P. Tryon <bishop.robinson@gmail.com> Robinson P. Tryon <bishop.robinson@gmail.com>
Ronald Hoogenboom <hoogenboom30@zonnet.nl>
Ronald Minnich <rminnich@gmail.com> Ronald Minnich <rminnich@gmail.com>
Stefan Reinauer <stepan@coresystems.de> Stefan Reinauer <stepan@coresystems.de>
Ulf Jordan <jordan@chalmers.se> Ulf Jordan <jordan@chalmers.se>
Uwe Hermann <uwe@hermann-uwe.de> Uwe Hermann <uwe@hermann-uwe.de>
Ward Vandewege <ward@gnu.org> Ward Vandewege <ward@gnu.org>

View File

@ -324,6 +324,36 @@ static const struct superio_registers reg_table[] = {
{EOT} {EOT}
}; };
static const struct superio_registers ec_table[] = {
{0x8716, "IT8716F", {
{NOLDN, NULL,
{0x00,0x04,0x05,0x06,0x07,0x08,0x09,0x0b,0x0c,0x10,
0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x1b,0x1c,0x1d,
0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,
0x3a,0x3b,0x3c,0x3d,0x3e,0x3f,0x40,0x41,0x42,0x43,
0x44,0x45,0x48,0x50,0x51,0x52,0x53,0x54,0x56,0x57,
0x59,0x5c,EOT},
{0x18,0x00,0x00,0x00,0x00,0x00,0x80,0x09,0x00,NANA,
NANA,NANA,0x07,0x50,NANA,NANA,NANA,NANA,NANA,NANA,
NANA,NANA,NANA,NANA,NANA,NANA,NANA,NANA,NANA,NANA,
NANA,NANA,NANA,NANA,NANA,NANA,NANA,NANA,NANA,NANA,
NANA,NANA,RSVD,0x00,0x00,0x7f,0x7f,0x7f,0x00,0x00,
0x00,0x00,EOT}},
{NOLDN, NULL,
{0x5d,0x5e,0x5f,0x60,0x61,0x62,0x63,0x64,0x65,0x68,
0x69,0x6a,0x6b,0x6c,0x6d,0x70,0x71,0x72,0x73,0x74,
0x75,0x84,0x85,0x86,0x87,0x88,0x89,0x8c,0x8d,0x8e,
0x8f,0x90,0x91,0x92,0x93,0x94,0x95,0x98,0x99,0x9a,
0x9b,0x9c,0x9d,EOT},
{0x00,0x00,0x00,0x7f,0x7f,0x7f,0x00,0x00,0x7f,0x7f,
0x7f,0x7f,0x00,0x00,0x7f,0x7f,0x7f,0x7f,0x00,0x00,
0x7f,NANA,NANA,NANA,NANA,0x00,0x00,0x02,0x00,0x99,
0x99,0x7f,0x7f,0x7f,0x00,0x00,0x7f,0x7f,0x7f,0x7f,
0x00,0x00,0x7f,EOT}},
{EOT}}},
{EOT}
};
/** /**
* IT871[01]F and IT8708F use 0x87, 0x87 * IT871[01]F and IT8708F use 0x87, 0x87
* IT8761F uses 0x87, 0x61, 0x55, 0x55/0xaa * IT8761F uses 0x87, 0x61, 0x55, 0x55/0xaa
@ -368,6 +398,17 @@ 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);
if (extra_dump) {
uint16_t ecport;
regwrite(port, 0x07, 0x04); /*EC LDN*/
ecport = regval(port, 0x60) << 8;
ecport |= regval(port, 0x61);
ecport += 5;
printf("Environment Controller (0x%04x)\n",ecport);
dump_superio("ITE-EC", ec_table, ecport, id);
}
} }
void probe_idregs_ite(uint16_t port) void probe_idregs_ite(uint16_t port)

View File

@ -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\-dlVvh\fR] .B superiotool \fR[\fB\-delVvh\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
@ -73,6 +73,16 @@ 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 "\-e, \-\-extra-dump"
Dump extra secondary register contents too, if available. Only in combination
with the
.B --dump
option. This option will, for instance, dump the Environmental Controller
configuration registers for the ITE IT8716f chip. The format is similar to
the output of the
.B --dump
option.
.TP
.B "\-l, \-\-list-supported" .B "\-l, \-\-list-supported"
List all Super I/O chips recognized by List all Super I/O chips recognized by
.BR superiotool ". The phrase" .BR superiotool ". The phrase"

View File

@ -24,7 +24,7 @@
#include "superiotool.h" #include "superiotool.h"
/* Command line options. */ /* Command line options. */
int dump = 0, verbose = 0; int dump = 0, verbose = 0, extra_dump = 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;
@ -208,6 +208,7 @@ int main(int argc, char *argv[])
static const struct option long_options[] = { static const struct option long_options[] = {
{"dump", no_argument, NULL, 'd'}, {"dump", no_argument, NULL, 'd'},
{"extra-dump", no_argument, NULL, 'e'},
{"list-supported", no_argument, NULL, 'l'}, {"list-supported", no_argument, NULL, 'l'},
{"verbose", no_argument, NULL, 'V'}, {"verbose", no_argument, NULL, 'V'},
{"version", no_argument, NULL, 'v'}, {"version", no_argument, NULL, 'v'},
@ -215,12 +216,15 @@ int main(int argc, char *argv[])
{0, 0, 0, 0} {0, 0, 0, 0}
}; };
while ((opt = getopt_long(argc, argv, "dlVvh", while ((opt = getopt_long(argc, argv, "delVvh",
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 'e':
extra_dump = 1;
break;
case 'l': case 'l':
print_list_of_supported_chips(); print_list_of_supported_chips();
exit(0); exit(0);

View File

@ -32,6 +32,7 @@
#define USAGE "Usage: superiotool [-d] [-l] [-V] [-v] [-h]\n\n\ #define USAGE "Usage: superiotool [-d] [-l] [-V] [-v] [-h]\n\n\
-d | --dump Dump Super I/O register contents\n\ -d | --dump Dump Super I/O register contents\n\
-e | --extra-dump Dump Secondary registers too (like EC registers etc.)\n\
-l | --list-supported Show the list of supported Super I/O chips\n\ -l | --list-supported Show the list of supported Super I/O chips\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\
@ -56,7 +57,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, verbose; extern int dump, verbose, extra_dump;
extern int chip_found; extern int chip_found;