superiotool: Dump data registers for Nuvoton chips

Add support to dump all data registers for Nuvoton chips (NCT6775F, NCT6776F,
and NCT6779D). Register contents will be dumped if the -e option is provided on
the command line.

Change-Id: I2b425b48c1f28a10ff3c1ca1d7f21c501eff74ad
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-on: http://review.coreboot.org/1150
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
This commit is contained in:
Guenter Roeck 2012-06-29 12:24:57 -07:00 committed by Patrick Georgi
parent a89da0969e
commit 21856eec59
1 changed files with 26 additions and 1 deletions

View File

@ -476,12 +476,16 @@ void probe_idregs_nuvoton(uint16_t port)
uint8_t sid, srid;
uint16_t chip_id = 0;
uint8_t chip_rev = 0;
uint16_t iobase = 0;
int i;
/* Probe for the 16bit IDs first to avoid collisions */
probing_for("Nuvoton", "", port);
enter_conf_mode_winbond_fintek_ite_8787(port);
chip_id = (regval(port, DEVICE_ID_REG) << 8) |
regval(port, DEVICE_ID_REG + 1);
regwrite(port, LDN_SEL, 0x0b);
iobase = (regval(port, 0x60) << 8) | (regval(port, 0x61) & ~7);
exit_conf_mode_winbond_fintek_ite_8787(port);
@ -492,7 +496,7 @@ void probe_idregs_nuvoton(uint16_t port)
enter_conf_mode_winbond_fintek_ite_8787(port);
dump_superio("Nuvoton", reg_table, port, chip_id, LDN_SEL);
exit_conf_mode_winbond_fintek_ite_8787(port);
return;
goto extra;
}
if (verbose)
@ -524,6 +528,27 @@ void probe_idregs_nuvoton(uint16_t port)
get_superio_name(reg_table, sid), chip_id, chip_rev, port);
chip_found = 1;
dump_superio("Nuvoton", reg_table, port, sid, LDN_SEL);
extra:
if (extra_dump && iobase) {
switch (chip_id & 0xfff0) {
case 0xb470: /* NCT6775F */
for (i = 0; i < 7; i++)
dump_data(iobase + 5, i);
dump_data(iobase + 5, 0xa);
dump_data(iobase + 5, 0xc);
dump_data(iobase + 5, 0xd);
break;
case 0xc330: /* NCT6776F */
for (i = 0; i < 8; i++)
dump_data(iobase + 5, i);
break;
case 0xc560: /* NCT6779D */
for (i = 0; i < 10; i++)
dump_data(iobase + 5, i);
break;
}
}
}
void print_nuvoton_chips(void)