##
-## This file is part of the LinuxBIOS project.
+## This file is part of the superiotool project.
##
## Copyright (C) 2007 Uwe Hermann <uwe@hermann-uwe.de>
##
/*
- * This file is part of the LinuxBIOS project.
+ * This file is part of the superiotool project.
*
* Copyright (C) 2007 Uwe Hermann <uwe@hermann-uwe.de>
*
rev = regval(port, DEVICE_REV_REG);
if (superio_unknown(reg_table, id)) {
- no_superio_found(port);
+ no_superio_found("ALi", "", port);
exit_conf_mode_ali(port);
return;
}
/*
- * This file is part of the LinuxBIOS project.
+ * This file is part of the superiotool project.
*
* Copyright (C) 2006 coresystems GmbH <info@coresystems.de>
* Copyright (C) 2007 Uwe Hermann <uwe@hermann-uwe.de>
vid |= (regval(port, VENDOR_ID_BYTE2_REG) << 8);
if (vid != FINTEK_VENDOR_ID || superio_unknown(reg_table, did)) {
- no_superio_found(port);
+ no_superio_found("Fintek", "", port);
exit_conf_mode_winbond_fintek_ite_8787(port);
return;
}
/*
- * This file is part of the LinuxBIOS project.
+ * This file is part of the superiotool project.
*
* Copyright (C) 2007 Carl-Daniel Hailfinger
* Copyright (C) 2007 Uwe Hermann <uwe@hermann-uwe.de>
regwrite(port, 0x02, 0x02);
}
-static void probe_idregs_ite_helper(uint16_t port)
+static void probe_idregs_ite_helper(const char *init, uint16_t port)
{
uint16_t id, chipver;
chipver = regval(port, CHIP_VERSION_REG) & 0x0f; /* Only bits 3..0 */
if (superio_unknown(reg_table, id)) {
- no_superio_found(port);
+ no_superio_found("ITE", init, port);
exit_conf_mode_ite(port);
return;
}
void probe_idregs_ite(uint16_t port)
{
enter_conf_mode_ite(port);
- probe_idregs_ite_helper(port);
+ probe_idregs_ite_helper("(init=0x87,0x01,0x55,0x55/0xaa) ", port);
exit_conf_mode_ite(port);
enter_conf_mode_winbond_fintek_ite_8787(port);
- probe_idregs_ite_helper(port);
+ probe_idregs_ite_helper("(init=0x87,0x87) ", port);
exit_conf_mode_winbond_fintek_ite_8787(port);
}
/*
- * This file is part of the LinuxBIOS project.
+ * This file is part of the superiotool project.
*
* Copyright (C) 2006 Ronald Minnich <rminnich@gmail.com>
*
outb(0x20, port);
if (inb(port) != 0x20) {
- no_superio_found(port);
+ no_superio_found("NSC", "", port);
/* TODO: Exit config mode? */
return;
}
/*
- * This file is part of the LinuxBIOS project.
+ * This file is part of the superiotool project.
*
* Copyright (C) 2007 Uwe Hermann <uwe@hermann-uwe.de>
*
rev = regval(port, revreg);
if (superio_unknown(reg_table, id)) {
- no_superio_found(port);
+ no_superio_found("SMSC", "", port);
exit_conf_mode_smsc(port);
return;
}
/*
- * This file is part of the LinuxBIOS project.
+ * This file is part of the superiotool project.
*
* Copyright (C) 2006 Ronald Minnich <rminnich@gmail.com>
* Copyright (C) 2007 Uwe Hermann <uwe@hermann-uwe.de>
printf("No human-readable dump available for this Super I/O\n");
}
-void no_superio_found(uint16_t port)
+void no_superio_found(const char *vendor, const char *info, uint16_t port)
{
if (!verbose)
return;
if (inb(port) == 0xff)
- printf("No Super I/O chip found at 0x%04x\n", port);
+ /* Yes, there's no space between '%s' and 'at'! */
+ printf("Probing for %s Super I/O %sat 0x%x... failed\n",
+ vendor, info, port);
else
- printf("Probing 0x%04x, failed (0x%02x), data returns 0x%02x\n",
+ printf("Probing 0x%x, failed (0x%02x), data returns 0x%02x\n",
port, inb(port), inb(port + 1));
}
/*
- * This file is part of the LinuxBIOS project.
+ * This file is part of the superiotool project.
*
* Copyright (C) 2007 Carl-Daniel Hailfinger
* Copyright (C) 2007 Uwe Hermann <uwe@hermann-uwe.de>
#include <getopt.h>
#include <sys/io.h>
-#define SUPERIOTOOL_VERSION "0.1"
+#define SUPERIOTOOL_VERSION "r$Rev$"
#define USAGE "Usage: superiotool [-d] [-D] [-V] [-v] [-h]\n\n\
-d | --dump Dump Super I/O registers\n\
-v | --version Show the superiotool version\n\
-h | --help Show a short help text\n\n\
Per default (no options) superiotool will just probe for a Super I/O\n\
-and print its vendor, name, ID, version, and config port.\n"
+and print its vendor, name, ID, revision, and config port.\n"
#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
void dump_superio(const char *name, const struct superio_registers reg_table[],
uint16_t port, uint16_t id);
void dump_superio_readable(uint16_t port);
-void no_superio_found(uint16_t port);
+void no_superio_found(const char *vendor, const char *info, uint16_t port);
/* ali.c */
void probe_idregs_ali(uint16_t port);
/*
- * This file is part of the LinuxBIOS project.
+ * This file is part of the superiotool project.
*
* Copyright (C) 2007 Uwe Hermann <uwe@hermann-uwe.de>
*
outb(0x86, port);
}
-void probe_idregs_winbond_helper(uint16_t port)
+void probe_idregs_winbond_helper(const char *init, uint16_t port)
{
uint16_t id;
uint8_t devid, rev, olddevid;
id = olddevid & 0x0f; /* ID[3..0] */
if (superio_unknown(reg_table, id)) {
- no_superio_found(port);
+ no_superio_found("Winbond", init, port);
exit_conf_mode_winbond_fintek_ite_8787(port);
return;
}
{
/* TODO: Not all init sequences are valid for all ports. */
- enter_conf_mode_winbond_fintek_ite_8787(port);
- probe_idregs_winbond_helper(port);
- exit_conf_mode_winbond_fintek_ite_8787(port);
-
enter_conf_mode_winbond_88(port);
- probe_idregs_winbond_helper(port);
+ probe_idregs_winbond_helper("(init=0x88) ", port);
exit_conf_mode_winbond_fintek_ite_8787(port);
enter_conf_mode_winbond_89(port);
- probe_idregs_winbond_helper(port);
+ probe_idregs_winbond_helper("(init=0x89) ", port);
exit_conf_mode_winbond_fintek_ite_8787(port);
enter_conf_mode_winbond_86(port);
- probe_idregs_winbond_helper(port);
+ probe_idregs_winbond_helper("(init=0x86,0x86) ", port);
+ exit_conf_mode_winbond_fintek_ite_8787(port);
+
+ enter_conf_mode_winbond_fintek_ite_8787(port);
+ probe_idregs_winbond_helper("(init=0x87,0x87) ", port);
exit_conf_mode_winbond_fintek_ite_8787(port);
}