void probe_idregs_ali(uint16_t port) { uint16_t id; uint8_t rev; probing_for("ALi", "", port); enter_conf_mode_ali(port); id = regval(port, DEVICE_ID_BYTE1_REG) << 8; id |= regval(port, DEVICE_ID_BYTE2_REG); /* TODO: Not documented/available on M512x (?) */ rev = regval(port, DEVICE_REV_REG); if (superio_unknown(reg_table, id)) { if (verbose) printf(NOTFOUND "id=0x%04x, rev=0x%02x\n", id, rev); exit_conf_mode_ali(port); return; } printf("Found ALi %s (id=0x%04x, rev=0x%02x) at 0x%x\n", get_superio_name(reg_table, id), id, rev, port); chip_found = 1; dump_superio("ALi", reg_table, port, id, LDN_SEL); exit_conf_mode_ali(port); }
void probe_idregs_fintek_alternative(uint16_t port) { uint16_t vid, did; probing_for("Fintek", "", port); enter_conf_mode_fintek_7777(port); did = regval(port, DEVICE_ID_BYTE1_REG); did |= (regval(port, DEVICE_ID_BYTE2_REG) << 8); vid = regval(port, VENDOR_ID_BYTE1_REG); vid |= (regval(port, VENDOR_ID_BYTE2_REG) << 8); if (vid != FINTEK_VENDOR_ID || superio_unknown(reg_table, did)) { if (verbose) printf(NOTFOUND "vid=0x%04x, id=0x%04x\n", vid, did); exit_conf_mode_fintek_7777(port); return; } printf("Found Fintek %s (vid=0x%04x, id=0x%04x) at 0x%x\n", get_superio_name(reg_table, did), vid, did, port); chip_found = 1; dump_superio("Fintek", reg_table, port, did, LDN_SEL); exit_conf_mode_fintek_7777(port); }
void probe_idregs_amd(uint16_t port) { uint8_t rev, devid; probing_for("AMD EC", "", port); if (!(port = detect_ec())) return; enter_conf_mode_ec(port); devid = regval(port, DEVICE_ID_REG); rev = regval(port, DEVICE_REV_REG); if (superio_unknown(reg_table, devid)) { if (verbose) printf(NOTFOUND "id=0x%02x, rev=0x%02x\n", devid, rev); exit_conf_mode_ec(port); return; } printf("Found AMD EC %s (id=0x%02x, rev=0x%02x) at 0x%x\n", get_superio_name(reg_table, devid), devid, rev, port); chip_found = 1; dump_superio("AMD EC", reg_table, port, devid, LDN_SEL); exit_conf_mode_ec(port); }
static void probe_idregs_smsc_helper(uint16_t port, uint8_t idreg, uint8_t revreg) { uint8_t id, rev; uint16_t runtime_base; const char *info = (idreg == 0x20) ? "(idregs=0x20/0x21) " : "(idregs=0x0d/0x0e) "; probing_for("SMSC", info, port); enter_conf_mode_smsc(port); id = regval(port, idreg); rev = regval(port, revreg); if (superio_unknown(reg_table, id)) { if (verbose) printf(NOTFOUND "id=0x%02x, rev=0x%02x\n", id, rev); exit_conf_mode_smsc(port); return; } printf("Found %s %s (id=0x%02x, rev=0x%02x) at 0x%x\n", (id == 0x77 ? "ASUS" : "SMSC"), get_superio_name(reg_table, id), id, rev, port); chip_found = 1; dump_superio((id == 0x77 ? "ASUS" : "SMSC"), reg_table, port, id, LDN_SEL); if (extra_dump) { switch (id) { case 0x5a: /* LPC47N227 */ runtime_base = regval(port, 0x30) << 4; if (runtime_base) dump_io(runtime_base, 16); else printf("Runtime Register Block not mapped on this Super I/O.\n"); break; default: printf("No extra registers known for this chip.\n"); } } exit_conf_mode_smsc(port); }
void probe_idregs_nuvoton(uint16_t port) { uint8_t sid, srid; uint8_t chip_id = 0, chip_rev = 0; probing_for("Nuvoton", "(sid=0xfc) ", port); sid = regval(port, DEVICE_ID_REG); srid = regval(port, DEVICE_REV_REG); if (sid == 0xfc) { /* WPCE775xL family */ /* * bits 7-5: Chip ID * bits 4-0: Chip revision */ chip_id = srid >> 5; chip_rev = srid & 0x1f; }
void probe_idregs_nuvoton(uint16_t port) { uint8_t sid, srid; uint16_t chip_id = 0; uint8_t chip_rev = 0; /* 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); exit_conf_mode_winbond_fintek_ite_8787(port); if (!superio_unknown(reg_table, chip_id)) { printf("Found Nuvoton %s (id=0x%02x) at 0x%x\n", get_superio_name(reg_table, chip_id), chip_id, port); chip_found = 1; dump_superio("Nuvoton", reg_table, port, chip_id, LDN_SEL); return; } if (verbose) printf(NOTFOUND "chip_id=0x%04x\n", chip_id); probing_for("Nuvoton", "(sid=0xfc) ", port); sid = regval(port, DEVICE_ID_REG); srid = regval(port, DEVICE_REV_REG); if (sid == 0xfc) { /* WPCE775xL family */ /* * bits 7-5: Chip ID * bits 4-0: Chip revision */ chip_id = srid >> 5; chip_rev = srid & 0x1f; }
static void dump_regs(const struct superio_registers reg_table[], int i, int j, uint16_t port, uint8_t ldn_sel) { int k; const int16_t *idx; if (reg_table[i].ldn[j].ldn != NOLDN) { printf("LDN 0x%02x", reg_table[i].ldn[j].ldn); if (reg_table[i].ldn[j].name != NULL) printf(" (%s)", reg_table[i].ldn[j].name); regwrite(port, ldn_sel, reg_table[i].ldn[j].ldn); } else { if (reg_table[i].ldn[j].name == NULL) printf("Register dump:"); else printf("(%s)", reg_table[i].ldn[j].name); } idx = reg_table[i].ldn[j].idx; printf("\nidx"); for (k = 0; idx[k] != EOT; k++) { if (k && !(k % 8)) putchar(' '); printf(" %02x", idx[k]); } printf("\nval"); for (k = 0; idx[k] != EOT; k++) { if (k && !(k % 8)) putchar(' '); printf(" %02x", regval(port, idx[k])); } printf("\ndef"); idx = reg_table[i].ldn[j].def; for (k = 0; idx[k] != EOT; k++) { if (k && !(k % 8)) putchar(' '); if (idx[k] == NANA) printf(" NA"); else if (idx[k] == RSVD) printf(" RR"); else if (idx[k] == MISC) printf(" MM"); else printf(" %02x", idx[k]); } printf("\n"); }
static void probe_idregs_ite_helper(const char *init, uint16_t port) { uint16_t id, chipver, ecport; probing_for("ITE", init, port); id = regval(port, CHIP_ID_BYTE1_REG) << 8; id |= regval(port, CHIP_ID_BYTE2_REG); chipver = regval(port, CHIP_VERSION_REG) & 0x0f; /* Only bits 3..0 */ if (superio_unknown(reg_table, id)) { if (verbose) printf(NOTFOUND "id=0x%04x, rev=0x%01x\n", id, chipver); return; } printf("Found ITE %s (id=0x%04x, rev=0x%01x) at 0x%x\n", get_superio_name(reg_table, id), id, chipver, port); chip_found = 1; chip_found_at_port = 1; dump_superio("ITE", reg_table, port, id, LDN_SEL); if (extra_dump) { regwrite(port, LDN_SEL, 0x04); /* Select LDN 4 (EC). */ /* Get EC base address (stored in LDN 4, index 0x60/0x61). */ ecport = regval(port, 0x60) << 8; ecport |= regval(port, 0x61); /* EC address register = EC base address + 5. */ ecport += 5; printf("Environment controller (0x%04x)\n", ecport); dump_superio("ITE-EC", ec_table, ecport, id, LDN_SEL); regwrite(port, LDN_SEL, 0x10); /* Select LDN 16 (BRAM). */ /* Get EC base address (stored in LDN 16, index 0x62/0x63). */ ecport = regval(port, 0x62) << 8; ecport |= regval(port, 0x63); printf("BRAM (0x%04x)\n", ecport); dump_superio("ITE-BRAM", bram_table, ecport, id, LDN_SEL); } }
void probe_idregs_fintek(uint16_t port) { uint16_t vid, did, hwmport; probing_for("Fintek", "", port); enter_conf_mode_winbond_fintek_ite_8787(port); did = regval(port, DEVICE_ID_BYTE1_REG); did |= (regval(port, DEVICE_ID_BYTE2_REG) << 8); vid = regval(port, VENDOR_ID_BYTE1_REG); vid |= (regval(port, VENDOR_ID_BYTE2_REG) << 8); if (vid != FINTEK_VENDOR_ID || superio_unknown(reg_table, did)) { if (verbose) printf(NOTFOUND "vid=0x%04x, id=0x%04x\n", vid, did); exit_conf_mode_winbond_fintek_ite_8787(port); return; } printf("Found Fintek %s (vid=0x%04x, id=0x%04x) at 0x%x\n", get_superio_name(reg_table, did), vid, did, port); chip_found = 1; dump_superio("Fintek", reg_table, port, did, LDN_SEL); if (extra_dump) { regwrite(port, LDN_SEL, 0x04); /* Select LDN 4 (HWM). */ /* Get HWM base address (stored in LDN 4, index 0x60/0x61). */ hwmport = regval(port, 0x60) << 8; hwmport |= regval(port, 0x61); printf("Hardware monitor (0x%04x)\n", hwmport); dump_superio("Fintek-HWM", hwm_table, hwmport, did, LDN_SEL); } exit_conf_mode_winbond_fintek_ite_8787(port); }