util/superiotool: distinguish between VT82C686 and VT1211

They both have a device id of 0x3c. The former is part of the PCI chip set
accessible via port 0x3f0 while the latter is a standalone LPC chip accessible
via 0x2e/0x4e depending on strapping.

They're not register compatible: the VT82C686 only provides a FDC, LPT and part
of UARTs.

The VT82C686 documentation suggests it has revision 0x00 while the VT1211
datasheet indicates 0x01. Nevertheless, the VT1211 I happen to have hs a
revision of 0x02. Thus the revision is probably not good enough to tell one
from the another.

Change-Id: Ic7529c84724c8d6b9eb75b863f1bceef5e4b52b5
Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
Reviewed-on: https://review.coreboot.org/22254
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
This commit is contained in:
Lubomir Rintel 2017-10-31 09:25:18 +01:00 committed by Stefan Reinauer
parent 2f6a29e2e6
commit 4d1bbe9908
1 changed files with 17 additions and 11 deletions

View File

@ -23,7 +23,9 @@
#define DEVICE_REV_VT1211_REG 0x21 #define DEVICE_REV_VT1211_REG 0x21
static const struct superio_registers reg_table[] = { static const struct superio_registers reg_table[] = {
{0x3c, "VT82C686A/VT82C686B/VT1211", { {0x3c00, "VT82C686A/VT82C686B", {
{EOT}}},
{0x3c01, "VT1211", {
{EOT}}}, {EOT}}},
{EOT} {EOT}
}; };
@ -75,41 +77,45 @@ static void exit_conf_mode_via_vt82c686(void)
void probe_idregs_via(uint16_t port) void probe_idregs_via(uint16_t port)
{ {
uint16_t id; uint16_t id;
uint8_t devid;
uint8_t rev; uint8_t rev;
if (port == 0x3f0) { if (port == 0x3f0) {
probing_for("VIA", "(init=vt82c686)", port); probing_for("VIA", "(init=vt82c686) ", port);
if (enter_conf_mode_via_vt82c686()) if (enter_conf_mode_via_vt82c686())
return; return;
id = regval(port, DEVICE_ID_VT82C686_REG); devid = regval(port, DEVICE_ID_VT82C686_REG);
rev = regval(port, DEVICE_REV_VT82C686_REG); rev = regval(port, DEVICE_REV_VT82C686_REG);
id = devid << 8;
if (superio_unknown(reg_table, id)) { if (superio_unknown(reg_table, id)) {
if (verbose) if (verbose)
printf(NOTFOUND "id=0x%04x, rev=0x%02x\n", id, rev); printf(NOTFOUND "id=0x%02x, rev=0x%02x\n", devid, rev);
} else { } else {
printf("Found VIA %s (id=0x%04x, rev=0x%02x) at 0x%x\n", printf("Found VIA %s (id=0x%02x, rev=0x%02x) at 0x%x\n",
get_superio_name(reg_table, id), id, rev, port); get_superio_name(reg_table, id), devid, rev, port);
chip_found = 1; chip_found = 1;
} }
exit_conf_mode_via_vt82c686(); exit_conf_mode_via_vt82c686();
if (chip_found) if (chip_found)
return; return;
} else { } else {
probing_for("VIA", "(init=0x87,0x87)", port); probing_for("VIA", "(init=0x87,0x87) ", port);
enter_conf_mode_winbond_fintek_ite_8787(port); enter_conf_mode_winbond_fintek_ite_8787(port);
id = regval(port, DEVICE_ID_VT1211_REG); devid = regval(port, DEVICE_ID_VT1211_REG);
rev = regval(port, DEVICE_REV_VT1211_REG); rev = regval(port, DEVICE_REV_VT1211_REG);
id = (devid << 8) | 1;
if (superio_unknown(reg_table, id)) { if (superio_unknown(reg_table, id)) {
if (verbose) if (verbose)
printf(NOTFOUND "id=0x%04x, rev=0x%02x\n", id, rev); printf(NOTFOUND "id=0x%02x, rev=0x%02x\n", devid, rev);
} else { } else {
printf("Found VIA %s (id=0x%04x, rev=0x%02x) at 0x%x\n", printf("Found VIA %s (id=0x%02x, rev=0x%02x) at 0x%x\n",
get_superio_name(reg_table, id), id, rev, port); get_superio_name(reg_table, id), devid, rev, port);
chip_found = 1; chip_found = 1;
dump_superio("VIA", reg_table, port, id, LDN_SEL);
} }
} }