2 * This file is part of the LinuxBIOS project.
4 * Copyright (C) 2006 Ronald Minnich <rminnich@gmail.com>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21 #include "superiotool.h"
23 /* Well, they really thought this through, eh? Family is 8 bits! */
24 static const char *familyid[] = {
25 [0xf1] = "PC8374 (Winbond/NatSemi)"
28 void dump_ns8374(uint16_t port)
30 printf("Enables: 21=%02x, 22=%02x, 23=%02x, 24=%02x, 26=%02x\n",
31 regval(port, 0x21), regval(port, 0x22), regval(port, 0x23),
32 regval(port, 0x24), regval(port, 0x26));
33 printf("SMBUS at %02x\n", regval(port, 0x2a));
35 /* Check COM1. This is all we care about at present. */
36 printf("COM 1 is globally %s\n",
37 regval(port, 0x26) & 8 ? "disabled" : "enabled");
40 regwrite(port, 0x07, 0x03);
41 printf("COM 1 is locally %s\n",
42 regval(port, 0x30) & 1 ? "enabled" : "disabled");
44 ("COM1 60=%02x, 61=%02x, 70=%02x, 71=%02x, 74=%02x, 75=%02x, f0=%02x\n",
45 regval(port, 0x60), regval(port, 0x61), regval(port, 0x70),
46 regval(port, 0x71), regval(port, 0x74), regval(port, 0x75),
50 regwrite(port, 0x07, 0x07);
51 printf("GPIO is %s\n", regval(port, 0x30) & 1 ? "enabled" : "disabled");
53 ("GPIO 60=%02x, 61=%02x, 70=%02x, 71=%02x, 74=%02x, 75=%02x, f0=%02x\n",
54 regval(port, 0x60), regval(port, 0x61), regval(port, 0x70),
55 regval(port, 0x71), regval(port, 0x74), regval(port, 0x75),
59 void probe_idregs_simple(uint16_t port)
64 if (inb(port) != 0x20) {
65 if (inb(port) == 0xff)
66 printf("No Super I/O chip found at 0x%04x\n", port);
68 printf("Probing 0x%04x, failed (0x%02x), data returns 0x%02x\n", port, inb(port), inb(port + 1));
73 printf("Super I/O found at 0x%02x: id = 0x%02x\n", port, id);
78 printf("%s\n", familyid[id]);
80 printf("<unknown>\n");
87 printf("No dump for 0x%02x\n", id);