Patchwork Board enable for Asus A7V600-X.

login
register
about
Submitter Luc Verhaegen
Date 2009-09-01 12:32:07
Message ID <20090901123207.GA6419@skynet.be>
Download mbox | patch
Permalink /patch/234/
State Accepted
Commit r705
Headers show

Comments

Luc Verhaegen - 2009-09-01 12:32:07
On irc, agaran pointed me in the right direction, and i think that the 
issue has been found now.

While in the previous board enable, w836xx_ext_enter/leave is perfectly 
ok for the IT8703F, it is no longer ok for the IT8712F. We need to use 
enter/exit_conf_mode_ite instead.

Luc Verhaegen.
Board enable for Asus A7V600-X.

Raises GP32 on IT8712F, and comes with a more general routine to set
io lines on the IT8712F.

Signed-off-by: Luc Verhaegen <libv@skynet.be>
Putlinuxonit - 2009-09-01 18:07:37
Tested the patch against r682 and can confirm it works P.R.E.W on the Asus
A7V600-X.


Acked-by: Udu Ogah <putlinuxonit@gmail.com>


2009/9/1 Luc Verhaegen <libv@skynet.be>

> On irc, agaran pointed me in the right direction, and i think that the
> issue has been found now.
>
> While in the previous board enable, w836xx_ext_enter/leave is perfectly
> ok for the IT8703F, it is no longer ok for the IT8712F. We need to use
> enter/exit_conf_mode_ite instead.
>
> Luc Verhaegen.
>
> _______________________________________________
> flashrom mailing list
> flashrom@flashrom.org
> http://www.flashrom.org/mailman/listinfo/flashrom
>
Luc Verhaegen - 2009-09-01 21:24:14
On Tue, Sep 01, 2009 at 07:07:37PM +0100, Putlinuxonit wrote:
> Tested the patch against r682 and can confirm it works P.R.E.W on the Asus
> A7V600-X.
> 
> 
> Acked-by: Udu Ogah <putlinuxonit@gmail.com>
> -- 
> Udu E. Ogah

Great -> r705.

Luc Verhaegen.

Patch

Index: board_enable.c
===================================================================
--- board_enable.c	(revision 682)
+++ board_enable.c	(working copy)
@@ -888,6 +888,70 @@ 
 }
 
 /**
+ * General routine for raising/dropping GPIO lines on the ITE IT8712F.
+ * There is only some limited checking on the port numbers.
+ */
+static int
+it8712f_gpio_set(unsigned int line, int raise)
+{
+	unsigned int port;
+	uint16_t id, base;
+	uint8_t tmp;
+
+	port = line / 10;
+	port--;
+	line %= 10;
+
+	/* Check line */
+	if ((port > 4) || /* also catches unsigned -1 */
+	    ((port < 4) && (line > 7)) || ((port == 4) && (line > 5))) {
+	    fprintf(stderr,
+		    "\nERROR: Unsupported IT8712F GPIO Line %02d.\n", line);
+	    return -1;
+	}
+
+	/* find the IT8712F */
+	enter_conf_mode_ite(0x2E);
+	id = (sio_read(0x2E, 0x20) << 8) | sio_read(0x2E, 0x21);
+	exit_conf_mode_ite(0x2E);
+
+	if (id != 0x8712) {
+		fprintf(stderr, "\nERROR: IT8712F SuperIO not found.\n");
+		return -1;
+	}
+
+	/* Get the GPIO base */
+	enter_conf_mode_ite(0x2E);
+	sio_write(0x2E, 0x07, 0x07);
+	base = (sio_read(0x2E, 0x62) << 8) | sio_read(0x2E, 0x63);
+	exit_conf_mode_ite(0x2E);
+
+	if (!base) {
+		fprintf(stderr, "\nERROR: Failed to read IT8712F SuperIO GPIO"
+			" Base.\n");
+		return -1;
+	}
+
+	/* set GPIO. */
+	tmp = INB(base + port);
+	if (raise)
+	    tmp |= 1 << line;
+	else
+	    tmp &= ~(1 << line);
+	OUTB(tmp, base + port);
+
+	return 0;
+}
+
+/**
+ * Suited for Asus A7V600-X: VIA KT600 + VT8237 + IT8712F
+ */
+static int board_asus_a7v600x(const char *name)
+{
+	return it8712f_gpio_set(32, 1);
+}
+
+/**
  * Suited for Asus P4P800-E: Intel Intel 865PE + ICH5R.
  */
 static int board_asus_p4p800(const char *name)
@@ -943,6 +1007,7 @@ 
 	{0x1106, 0x3205, 0x1106, 0x3205,  0x10EC, 0x8139, 0xA0A0, 0x0477, NULL,         NULL,          "AOpen",       "vKM400 AM-s",        board_aopen_vkm400},
 	{0x1022, 0x2090,      0,      0,  0x1022, 0x2080,      0,      0, "artecgroup", "dbe61",       "Artec Group", "DBE61",              board_artecgroup_dbe6x},
 	{0x1022, 0x2090,      0,      0,  0x1022, 0x2080,      0,      0, "artecgroup", "dbe62",       "Artec Group", "DBE62",              board_artecgroup_dbe6x},
+	{0x1106, 0x3189, 0x1043, 0x807F,  0x1106, 0x3065, 0x1043, 0x80ED, NULL,         NULL,          "ASUS",        "A7V600-X",           board_asus_a7v600x},
 	{0x1106, 0x3189, 0x1043, 0x807F,  0x1106, 0x3177, 0x1043, 0x808C, NULL,         NULL,          "ASUS",        "A7V8X",              board_asus_a7v8x},
 	{0x1106, 0x3177, 0x1043, 0x80A1,  0x1106, 0x3205, 0x1043, 0x8118, NULL,         NULL,          "ASUS",        "A7V8X-MX SE",        board_asus_a7v8x_mx},
 	{0x8086, 0x1a30, 0x1043, 0x8070,  0x8086, 0x244b, 0x1043, 0x8028, NULL,         NULL,          "ASUS",        "P4B266",             ich2_gpio22_raise},