summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/southbridge/intel/common/Kconfig4
-rw-r--r--src/southbridge/intel/common/smbus.c16
2 files changed, 20 insertions, 0 deletions
diff --git a/src/southbridge/intel/common/Kconfig b/src/southbridge/intel/common/Kconfig
index 669569e18c..304ecbfba3 100644
--- a/src/southbridge/intel/common/Kconfig
+++ b/src/southbridge/intel/common/Kconfig
@@ -1,9 +1,13 @@
config SOUTHBRIDGE_INTEL_COMMON
def_bool n
+
config SOUTHBRIDGE_INTEL_COMMON_GPIO
def_bool n
+
config SOUTHBRIDGE_INTEL_COMMON_SMBUS
def_bool n
+ select HAVE_DEBUG_SMBUS
+
config HAVE_INTEL_CHIPSET_LOCKDOWN
def_bool n
diff --git a/src/southbridge/intel/common/smbus.c b/src/southbridge/intel/common/smbus.c
index 90ef03ee12..2067baa8b2 100644
--- a/src/southbridge/intel/common/smbus.c
+++ b/src/southbridge/intel/common/smbus.c
@@ -16,11 +16,18 @@
*/
#include <arch/io.h>
+#include <console/console.h>
#include <device/smbus_def.h>
#include <stdlib.h>
#include "smbus.h"
+#if IS_ENABLED(CONFIG_DEBUG_SMBUS)
+#define dprintk(args...) printk(BIOS_DEBUG, ##args)
+#else
+#define dprintk(args...) do {} while (0)
+#endif
+
/* I801 command constants */
#define I801_QUICK (0 << 2)
#define I801_BYTE (1 << 2)
@@ -256,6 +263,9 @@ int do_smbus_block_read(unsigned int smbus_base, u8 device, u8 cmd,
}
} while ((status & SMBHSTSTS_HOST_BUSY) && loops);
+ dprintk("%s: status = %02x, len = %d / %d, loops = %d\n",
+ __func__, status, bytes_read, slave_bytes, loops);
+
/* Post-check we received complete message. */
slave_bytes = inb(smbus_base + SMBHSTDAT0);
if (bytes_read < slave_bytes)
@@ -329,6 +339,9 @@ int do_smbus_block_write(unsigned int smbus_base, u8 device, u8 cmd,
}
} while ((status & SMBHSTSTS_HOST_BUSY) && loops);
+ dprintk("%s: status = %02x, len = %d / %d, loops = %d\n",
+ __func__, status, bytes_sent, bytes, loops);
+
if (bytes_sent < bytes)
return SMBUS_ERROR;
@@ -396,6 +409,9 @@ int do_i2c_block_read(unsigned int smbus_base, u8 device,
}
} while ((status & SMBHSTSTS_HOST_BUSY) && loops);
+ dprintk("%s: status = %02x, len = %d / %d, loops = %d\n",
+ __func__, status, bytes_read, bytes, loops);
+
if (bytes_read < bytes)
return SMBUS_ERROR;