commit 71981ccc3dd55c729f2f5001050aa1c0e60ac9a5
Author: Böszörményi Zoltán <zb@cybertec.at>
Date:   Sun May 26 17:01:24 2013 +0200

    Add AMD SC3200 support to superiotool.

diff --git a/util/superiotool/Makefile b/util/superiotool/Makefile
index 3ebf6d5..e1a1b45 100644
--- a/util/superiotool/Makefile
+++ b/util/superiotool/Makefile
@@ -31,7 +31,7 @@ VERSION := -D'SUPERIOTOOL_VERSION="$(shell git describe 2>/dev/null)"'
 CFLAGS += -O2 -Wall -Wstrict-prototypes -Wundef -Wstrict-aliasing \
          -Werror-implicit-function-declaration -ansi -pedantic $(VERSION)
 
-OBJS = superiotool.o serverengines.o ali.o fintek.o ite.o nsc.o nuvoton.o \
+OBJS = superiotool.o serverengines.o ali.o amd2.o fintek.o ite.o nsc.o nuvoton.o \
        smsc.o winbond.o infineon.o
 
 OS_ARCH = $(shell uname)
diff --git a/util/superiotool/amd2.c b/util/superiotool/amd2.c
new file mode 100644
index 0000000..f25f501
--- /dev/null
+++ b/util/superiotool/amd2.c
@@ -0,0 +1,98 @@
+/*
+ * This file is part of the superiotool project.
+ *
+ * Copyright (C) 2013 Zoltán Böszörményi <zboszormenyi@sicom.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "superiotool.h"
+
+#define CHIP_ID_REG	0x20	/* Super I/O ID (SID) / family */
+#define CHIP_REV_REG	0x27	/* Super I/O revision ID (SRID) */
+
+static const struct superio_registers reg_table[] = {
+	{0xf5, "SC3200", {
+		{NOLDN, NULL,
+			{0x20,0x21,0x22,0x27,EOT},
+			{0xf5,MISC,MISC,NANA,EOT}},
+		{0x0, "Real-time clock (RTC)",
+			{0x30,0x60,0x61,0x62,0x63,0x70,0x71,0x74,0x75,0xf0,0xf1,0xf2,0xf3,EOT},
+			{MISC,0x00,0x70,0x00,0x72,0x08,0x00,0x04,0x04,0x00,0x00,0x00,0x00,EOT}},
+		{0x1, "System wake-up control (SWC)",
+			{0x30,0x60,0x61,0x70,0x71,0x74,0x75,EOT},
+			{0x00,0x00,0x00,0x00,0x03,0x04,0x04,EOT}},
+		{0x2, "COM3 / IR",
+			{0x30,0x60,0x61,0x70,0x71,0x74,0x75,0xf0,EOT},
+			{0x00,0x03,0xe8,0x00,0x03,0x04,0x04,0x02,EOT}},
+		{0x3, "COM1",
+			{0x30,0x60,0x61,0x70,0x71,0x74,0x75,0xf0,EOT},
+			{0x00,0x03,0xf8,0x04,0x03,0x04,0x04,0x02,EOT}},
+		{0x5, "ACCESS.bus 1 (ACB)",
+			{0x30,0x60,0x61,0x70,0x71,0x74,0x75,0xf0,EOT},
+			{0x00,0x00,0x00,0x00,0x03,0x04,0x04,0x00,EOT}},
+		{0x6, "ACCESS.bus 2 (ACB)",
+			{0x30,0x60,0x61,0x70,0x71,0x74,0x75,0xf0,EOT},
+			{0x00,0x00,0x00,0x00,0x03,0x04,0x04,0x00,EOT}},
+		{0x7, "Parallel port",
+			{0x30,0x60,0x61,0x70,0x71,0x74,0x75,0xf0,EOT},
+			{0x00,0x02,0x78,0x07,0x02,0x04,0x04,0xf2,EOT}},
+		{0x8, "COM2",
+			{0x30,0x60,0x61,0x70,0x71,0x74,0x75,0xf0,EOT},
+			{0x00,0x02,0xf8,0x03,0x03,0x04,0x04,0x02,EOT}},
+		{EOT}}},
+	{EOT}
+};
+
+void probe_idregs_amd2(uint16_t port)
+{
+	uint8_t id, rev;
+
+	probing_for("AMD", "", port);
+
+	OUTB(CHIP_ID_REG, port);
+	if (INB(port) != CHIP_ID_REG) {
+		if (verbose)
+			printf(NOTFOUND "port=0x%02x, port+1=0x%02x\n",
+			       INB(port), INB(port + 1));
+		return;
+	}
+	id = INB(port + 1);
+
+	OUTB(CHIP_REV_REG, port);
+	if (INB(port) != CHIP_REV_REG) {
+		printf("Warning: Can't get chip revision. Setting to 0xff.\n");
+		rev = 0xff;
+	} else {
+		rev = INB(port + 1);
+	}
+
+	if (superio_unknown(reg_table, id)) {
+		if (verbose)
+			printf(NOTFOUND "sid=0x%02x, srid=0x%02x\n", id, rev);
+		return;
+	}
+
+	printf("Found AMD %s (sid=0x%02x, srid=0x%02x) at 0x%x\n",
+		get_superio_name(reg_table, id), id, rev, port);
+	chip_found = 1;
+
+	dump_superio("AMD", reg_table, port, id, LDN_SEL);
+}
+
+void print_amd2_chips(void)
+{
+	print_vendor_chips("AMD", reg_table);
+}
diff --git a/util/superiotool/superiotool.h b/util/superiotool/superiotool.h
index 624b933..1e8772e 100644
--- a/util/superiotool/superiotool.h
+++ b/util/superiotool/superiotool.h
@@ -190,6 +190,10 @@ void print_ali_chips(void);
 void probe_idregs_amd(uint16_t port);
 void print_amd_chips(void);
 
+/* amd2.c */
+void probe_idregs_amd2(uint16_t port);
+void print_amd2_chips(void);
+
 /* serverengines.c */
 void probe_idregs_serverengines(uint16_t port);
 void print_serverengines_chips(void);
@@ -252,6 +256,7 @@ static const struct {
 #endif
 	{probe_idregs_serverengines,	{0x2e, EOT}},
 	{probe_idregs_infineon,	{0x2e, 0x4e, EOT}},
+	{probe_idregs_amd2, {0x2e, 0x15c, EOT}},
 };
 
 /** Table of functions to print out supported Super I/O chips. */
@@ -271,6 +276,7 @@ static const struct {
 #endif
 	{print_serverengines_chips},
 	{print_infineon_chips},
+	{print_amd2_chips},
 };
 
 #endif
