aboutsummaryrefslogtreecommitdiff
path: root/src/southbridge/amd/cs5535/cs5535_early_smbus.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/southbridge/amd/cs5535/cs5535_early_smbus.c')
-rw-r--r--src/southbridge/amd/cs5535/cs5535_early_smbus.c44
1 files changed, 24 insertions, 20 deletions
diff --git a/src/southbridge/amd/cs5535/cs5535_early_smbus.c b/src/southbridge/amd/cs5535/cs5535_early_smbus.c
index 4a57dd7438..b7dd436887 100644
--- a/src/southbridge/amd/cs5535/cs5535_early_smbus.c
+++ b/src/southbridge/amd/cs5535/cs5535_early_smbus.c
@@ -3,35 +3,39 @@
#define SMBUS_IO_BASE 0x6000
/* initialization for SMBus Controller */
-static int enable_smbus(void)
+static int cs5535_enable_smbus(void)
{
unsigned char val;
- /* FixME: move to early_iobase.c */
- /* setup LBAR for SMBus controller */
- __builtin_wrmsr(0x5140000B, 0x00006000, 0x0000f001);
- /* setup LBAR for GPIO at 0x6100 */
- __builtin_wrmsr(0x5140000C, 0x00006100, 0x0000f001);
-
-
- /* setup GPIO pins for SDA/SCL */
-
- /* Setup SMBus host controller address to 0xEF */
- val = inb(SMBUS_IO_BASE + SMB_ADD);
- val |= (0xEF | SMB_ADD_SAEN);
- outb(val, SMBUS_IO_BASE + SMB_ADD);
+ outb(0, SMBUS_IO_BASE + SMB_CTRL2);
/* Set SCL freq and enable SMB controller */
- outb(0x00, SMBUS_IO_BASE + SMB_CTRL2);
val = inb(SMBUS_IO_BASE + SMB_CTRL2);
- val |= (0x7F < 1) | SMB_CTRL2_ENABLE;
+ val |= ((0x7F << 1) | SMB_CTRL2_ENABLE);
outb(val, SMBUS_IO_BASE + SMB_CTRL2);
- /* Is SDA pulled high ? */
- val = inb(SMBUS_IO_BASE + SMB_CTRL_STS);
- if (val & SMB_CSTS_TSDA)
- return SMBUS_ERROR;
+ /* Setup SMBus host controller address to 0xEF */
+ val = inb(SMBUS_IO_BASE + SMB_ADD);
+ val |= (0xEF | SMB_ADD_SAEN);
+ outb(val, SMBUS_IO_BASE + SMB_ADD);
+#if 0
+ print_debug("SMBUS registers ");
+ print_debug_hex8(inb(SMBUS_IO_BASE));
+ print_debug(" ");
+ print_debug_hex8(inb(SMBUS_IO_BASE + 1));
+ print_debug(" ");
+ print_debug_hex8(inb(SMBUS_IO_BASE + 2));
+ print_debug(" ");
+ print_debug_hex8(inb(SMBUS_IO_BASE + 3));
+ print_debug(" ");
+ print_debug_hex8(inb(SMBUS_IO_BASE + 4));
+ print_debug(" ");
+ print_debug_hex8(inb(SMBUS_IO_BASE + 5));
+ print_debug(" ");
+ print_debug_hex8(inb(SMBUS_IO_BASE + 6));
+ print_debug("\n\r");
+#endif
}
#if 0