superiotool: Don't skip probing on a port if a a chip was detected on another port.
Only skip probing if chip was found on the same port already to avoid duplicates. Signed-off-by: Stefan Reinauer <stepan@coreboot.org> Acked-by: Stefan Reinauer <stepan@coreboot.org> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@6222 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
This commit is contained in:
parent
84be0f59b7
commit
d7ce71d58f
|
@ -798,6 +798,8 @@ static void exit_conf_mode_ite(uint16_t port)
|
||||||
regwrite(port, 0x02, 0x02);
|
regwrite(port, 0x02, 0x02);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int chip_found_at_port;
|
||||||
|
|
||||||
static void probe_idregs_ite_helper(const char *init, uint16_t port)
|
static void probe_idregs_ite_helper(const char *init, uint16_t port)
|
||||||
{
|
{
|
||||||
uint16_t id, chipver, ecport;
|
uint16_t id, chipver, ecport;
|
||||||
|
@ -817,6 +819,7 @@ static void probe_idregs_ite_helper(const char *init, uint16_t port)
|
||||||
printf("Found ITE %s (id=0x%04x, rev=0x%01x) at 0x%x\n",
|
printf("Found ITE %s (id=0x%04x, rev=0x%01x) at 0x%x\n",
|
||||||
get_superio_name(reg_table, id), id, chipver, port);
|
get_superio_name(reg_table, id), id, chipver, port);
|
||||||
chip_found = 1;
|
chip_found = 1;
|
||||||
|
chip_found_at_port = 1;
|
||||||
|
|
||||||
dump_superio("ITE", reg_table, port, id, LDN_SEL);
|
dump_superio("ITE", reg_table, port, id, LDN_SEL);
|
||||||
|
|
||||||
|
@ -837,41 +840,43 @@ static void probe_idregs_ite_helper(const char *init, uint16_t port)
|
||||||
|
|
||||||
void probe_idregs_ite(uint16_t port)
|
void probe_idregs_ite(uint16_t port)
|
||||||
{
|
{
|
||||||
|
chip_found_at_port = 0;
|
||||||
|
|
||||||
if (port == 0x3f0 || port == 0x3bd || port == 0x370) {
|
if (port == 0x3f0 || port == 0x3bd || port == 0x370) {
|
||||||
enter_conf_mode_ite_legacy(port, initkey_it8661f);
|
enter_conf_mode_ite_legacy(port, initkey_it8661f);
|
||||||
probe_idregs_ite_helper("(init=legacy/it8661f) ", port);
|
probe_idregs_ite_helper("(init=legacy/it8661f) ", port);
|
||||||
exit_conf_mode_ite(port);
|
exit_conf_mode_ite(port);
|
||||||
if (chip_found) return;
|
if (chip_found_at_port) return;
|
||||||
|
|
||||||
enter_conf_mode_ite_legacy(port, initkey_it8671f);
|
enter_conf_mode_ite_legacy(port, initkey_it8671f);
|
||||||
probe_idregs_ite_helper("(init=legacy/it8671f) ", port);
|
probe_idregs_ite_helper("(init=legacy/it8671f) ", port);
|
||||||
exit_conf_mode_ite(port);
|
exit_conf_mode_ite(port);
|
||||||
if (chip_found) return;
|
if (chip_found_at_port) return;
|
||||||
} else {
|
} else {
|
||||||
enter_conf_mode_ite(port);
|
enter_conf_mode_ite(port);
|
||||||
probe_idregs_ite_helper("(init=standard) ", port);
|
probe_idregs_ite_helper("(init=standard) ", port);
|
||||||
exit_conf_mode_ite(port);
|
exit_conf_mode_ite(port);
|
||||||
if (chip_found) return;
|
if (chip_found_at_port) return;
|
||||||
|
|
||||||
enter_conf_mode_ite_it8502e(port);
|
enter_conf_mode_ite_it8502e(port);
|
||||||
probe_idregs_ite_helper("(init=it8502e) ", port);
|
probe_idregs_ite_helper("(init=it8502e) ", port);
|
||||||
exit_conf_mode_ite(port);
|
exit_conf_mode_ite(port);
|
||||||
if (chip_found) return;
|
if (chip_found_at_port) return;
|
||||||
|
|
||||||
enter_conf_mode_ite_it8761e(port);
|
enter_conf_mode_ite_it8761e(port);
|
||||||
probe_idregs_ite_helper("(init=it8761e) ", port);
|
probe_idregs_ite_helper("(init=it8761e) ", port);
|
||||||
exit_conf_mode_ite(port);
|
exit_conf_mode_ite(port);
|
||||||
if (chip_found) return;
|
if (chip_found_at_port) return;
|
||||||
|
|
||||||
enter_conf_mode_ite_it8228e(port);
|
enter_conf_mode_ite_it8228e(port);
|
||||||
probe_idregs_ite_helper("(init=it8228e) ", port);
|
probe_idregs_ite_helper("(init=it8228e) ", port);
|
||||||
exit_conf_mode_ite(port);
|
exit_conf_mode_ite(port);
|
||||||
if (chip_found) return;
|
if (chip_found_at_port) return;
|
||||||
|
|
||||||
enter_conf_mode_winbond_fintek_ite_8787(port);
|
enter_conf_mode_winbond_fintek_ite_8787(port);
|
||||||
probe_idregs_ite_helper("(init=0x87,0x87) ", port);
|
probe_idregs_ite_helper("(init=0x87,0x87) ", port);
|
||||||
exit_conf_mode_winbond_fintek_ite_8787(port);
|
exit_conf_mode_winbond_fintek_ite_8787(port);
|
||||||
if (chip_found) return;
|
if (chip_found_at_port) return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -625,6 +625,8 @@ static void enter_conf_mode_winbond_86(uint16_t port)
|
||||||
OUTB(0x86, port);
|
OUTB(0x86, port);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int chip_found_at_port;
|
||||||
|
|
||||||
static void probe_idregs_winbond_helper(const char *init, uint16_t port)
|
static void probe_idregs_winbond_helper(const char *init, uint16_t port)
|
||||||
{
|
{
|
||||||
uint16_t id, hwmport;
|
uint16_t id, hwmport;
|
||||||
|
@ -662,6 +664,7 @@ static void probe_idregs_winbond_helper(const char *init, uint16_t port)
|
||||||
printf("Found Winbond %s (id=0x%02x, rev=0x%02x) at 0x%x\n",
|
printf("Found Winbond %s (id=0x%02x, rev=0x%02x) at 0x%x\n",
|
||||||
get_superio_name(reg_table, id), devid, rev, port);
|
get_superio_name(reg_table, id), devid, rev, port);
|
||||||
chip_found = 1;
|
chip_found = 1;
|
||||||
|
chip_found_at_port = 1;
|
||||||
|
|
||||||
dump_superio("Winbond", reg_table, port, id, LDN_SEL);
|
dump_superio("Winbond", reg_table, port, id, LDN_SEL);
|
||||||
|
|
||||||
|
@ -688,25 +691,27 @@ static void probe_idregs_winbond_helper(const char *init, uint16_t port)
|
||||||
|
|
||||||
void probe_idregs_winbond(uint16_t port)
|
void probe_idregs_winbond(uint16_t port)
|
||||||
{
|
{
|
||||||
|
chip_found_at_port = 0;
|
||||||
|
|
||||||
enter_conf_mode_winbond_88(port);
|
enter_conf_mode_winbond_88(port);
|
||||||
probe_idregs_winbond_helper("(init=0x88) ", port);
|
probe_idregs_winbond_helper("(init=0x88) ", port);
|
||||||
exit_conf_mode_winbond_fintek_ite_8787(port);
|
exit_conf_mode_winbond_fintek_ite_8787(port);
|
||||||
if (chip_found) return;
|
if (chip_found_at_port) return;
|
||||||
|
|
||||||
enter_conf_mode_winbond_89(port);
|
enter_conf_mode_winbond_89(port);
|
||||||
probe_idregs_winbond_helper("(init=0x89) ", port);
|
probe_idregs_winbond_helper("(init=0x89) ", port);
|
||||||
exit_conf_mode_winbond_fintek_ite_8787(port);
|
exit_conf_mode_winbond_fintek_ite_8787(port);
|
||||||
if (chip_found) return;
|
if (chip_found_at_port) return;
|
||||||
|
|
||||||
enter_conf_mode_winbond_86(port);
|
enter_conf_mode_winbond_86(port);
|
||||||
probe_idregs_winbond_helper("(init=0x86,0x86) ", port);
|
probe_idregs_winbond_helper("(init=0x86,0x86) ", port);
|
||||||
exit_conf_mode_winbond_fintek_ite_8787(port);
|
exit_conf_mode_winbond_fintek_ite_8787(port);
|
||||||
if (chip_found) return;
|
if (chip_found_at_port) return;
|
||||||
|
|
||||||
enter_conf_mode_winbond_fintek_ite_8787(port);
|
enter_conf_mode_winbond_fintek_ite_8787(port);
|
||||||
probe_idregs_winbond_helper("(init=0x87,0x87) ", port);
|
probe_idregs_winbond_helper("(init=0x87,0x87) ", port);
|
||||||
exit_conf_mode_winbond_fintek_ite_8787(port);
|
exit_conf_mode_winbond_fintek_ite_8787(port);
|
||||||
if (chip_found) return;
|
if (chip_found_at_port) return;
|
||||||
}
|
}
|
||||||
|
|
||||||
void print_winbond_chips(void)
|
void print_winbond_chips(void)
|
||||||
|
|
Loading…
Reference in New Issue