Tyan S4880

ron minnich rminnich at lanl.gov
Mon Dec 1 23:11:01 CET 2003


I committed all this except for one thing:

diff -uNr ./freebios2/src/southbridge/amd/amd8111/amd8111_early_smbus.c ../freebios2/src/southbridge/amd/amd8111/amd8111_early_smbus.c
--- ./freebios2/src/southbridge/amd/amd8111/amd8111_early_smbus.c	2003-10-13 06:01:13.000000000 -0400
+++ ../freebios2/src/southbridge/amd/amd8111/amd8111_early_smbus.c	2003-12-01 16:14:18.000000000 -0500
@@ -120,24 +120,19 @@
 		return;
 	}
 
-	/* setup transaction */
-	/* disable interrupts */
-	outw(inw(SMBUS_IO_BASE + SMBGCTL) & ~((1<<10)|(1<<9)|(1<<8)|(1<<4)),
-			SMBUS_IO_BASE + SMBGCTL);
+//By LYH Begin
+	outb(0x37,SMBUS_IO_BASE + SMBGSTATUS);
 	/* set the device I'm talking too */
-	outw(((device & 0x7f) << 1) | 1, SMBUS_IO_BASE + SMBHSTADDR);
-	outb(address & 0xFF, SMBUS_IO_BASE + SMBHSTCMD);
-	/* set up for a byte data write */ /* FIXME */
-	outw((inw(SMBUS_IO_BASE + SMBGCTL) & ~7) | (0x1), SMBUS_IO_BASE + SMBGCTL);
-	/* clear any lingering errors, so the transaction will run */
-	/* Do I need to write the bits to a 1 to clear an error? */
-	outw(inw(SMBUS_IO_BASE + SMBGSTATUS), SMBUS_IO_BASE + SMBGSTATUS);
+	outw(((device & 0x7f) << 1) | 0, SMBUS_IO_BASE + SMBHSTADDR);
+        
+	/* data to send */
+        outb(val, SMBUS_IO_BASE + SMBHSTDAT);
 
-	/* clear the data word...*/
-	outw(val, SMBUS_IO_BASE + SMBHSTDAT);
+	outb(address & 0xFF, SMBUS_IO_BASE + SMBHSTCMD);
 
 	/* start the command */
-	outw((inw(SMBUS_IO_BASE + SMBGCTL) | (1 << 3)), SMBUS_IO_BASE + SMBGCTL);
+	outb(0xa, SMBUS_IO_BASE + SMBGCTL);
+//By LYH END
 
 	/* poll for transaction completion */
 	smbus_wait_until_done();


I'm a little worried about removing some of those lines, such as:

/* disable interrupts */
outw(inw(SMBUS_IO_BASE + SMBGCTL) & ~((1<<10)|(1<<9)|(1<<8)|(1<<4)),
                       SMBUS_IO_BASE + SMBGCTL);

does it hurt to leave this in? OR:

-       /* clear any lingering errors, so the transaction will run */
-       /* Do I need to write the bits to a 1 to clear an error? */
-       outw(inw(SMBUS_IO_BASE + SMBGSTATUS), SMBUS_IO_BASE + SMBGSTATUS);


why remove this? 

comments?

ron




More information about the coreboot mailing list