[coreboot] [commit] r5407 - trunk/src/southbridge/intel/i82801dx

repository service svn at coreboot.org
Sun Apr 11 22:02:48 CEST 2010


Author: stepan
Date: Sun Apr 11 22:02:47 2010
New Revision: 5407
URL: https://tracker.coreboot.org/trac/coreboot/changeset/5407

Log:
do better error reporting in i82801dx early smbus functions.
Signed-off-by: Stefan Reinauer <stepan at coresystems.de>
Acked-by: Stefan Reinauer <stepan at coresystems.de>

Modified:
   trunk/src/southbridge/intel/i82801dx/i82801dx_early_smbus.c

Modified: trunk/src/southbridge/intel/i82801dx/i82801dx_early_smbus.c
==============================================================================
--- trunk/src/southbridge/intel/i82801dx/i82801dx_early_smbus.c	Sun Apr 11 21:02:10 2010	(r5406)
+++ trunk/src/southbridge/intel/i82801dx/i82801dx_early_smbus.c	Sun Apr 11 22:02:47 2010	(r5407)
@@ -18,8 +18,7 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
  */
 
-//#define SMBUS_IO_BASE 0x1000
-//#define SMBUS_IO_BASE 0x0f00
+#include "i82801dx.h"
 
 #define SMBHSTSTAT 0x0
 #define SMBHSTCTL  0x2
@@ -42,7 +41,7 @@
 {
 	device_t dev = PCI_DEV(0x0, 0x1f, 0x3);
 
-	print_debug("SMBus controller enabled\n");
+	printk(BIOS_DEBUG, "SMBus controller enabled\n");
 	/* set smbus iobase */
 	pci_write_config32(dev, 0x20, SMBUS_IO_BASE | 1);
 	/* Set smbus enable */
@@ -118,9 +117,9 @@
 	unsigned char global_status_register;
 	unsigned char byte;
 
-	/*print_err("smbus_read_byte\n"); */
+	/* printk(BIOS_ERR, "smbus_read_byte\n"); */
 	if (smbus_wait_until_ready() < 0) {
-		print_err_hex8(-2);
+		printk(BIOS_ERR, "SMBUS not ready (%02x)\n", -2);
 		return -2;
 	}
 
@@ -146,13 +145,13 @@
 	     SMBUS_IO_BASE + SMBHSTCTL);
 	/* poll for it to start */
 	if (smbus_wait_until_active() < 0) {
-		print_err_hex8(-4);
+		printk(BIOS_ERR, "SMBUS not active (%02x)\n", -4);
 		return -4;
 	}
 
 	/* poll for transaction completion */
 	if (smbus_wait_until_done() < 0) {
-		print_err_hex8(-3);
+		printk(BIOS_ERR, "SMBUS not completed (%02x)\n", -3);
 		return -3;
 	}
 
@@ -162,14 +161,10 @@
 	byte = inb(SMBUS_IO_BASE + SMBHSTDAT0);
 
 	if (global_status_register != 2) {
-		print_err_hex8(-1);
+		//printk(BIOS_SPEW, "%s: no device (%02x, %02x)\n", __func__, device, address);
 		return -1;
 	}
-/*
-        print_err("smbus_read_byte: ");
-	print_err_hex32(device); print_err(" ad "); print_err_hex32(address);
-	print_err("value "); print_err_hex8(byte); print_err("\n");
- */
+	//printk(BIOS_DEBUG, "%s: %02x@%02x = %02x\n", __func__, device, address, byte);
 	return byte;
 }
 




More information about the coreboot mailing list