summaryrefslogtreecommitdiff
path: root/src/southbridge/nvidia
diff options
context:
space:
mode:
Diffstat (limited to 'src/southbridge/nvidia')
-rw-r--r--src/southbridge/nvidia/ck804/ck804_early_setup.c20
-rw-r--r--src/southbridge/nvidia/ck804/ck804_early_setup_car.c20
-rw-r--r--src/southbridge/nvidia/ck804/ck804_enable_rom.c1
-rw-r--r--src/southbridge/nvidia/ck804/ck804_smbus.h16
4 files changed, 49 insertions, 8 deletions
diff --git a/src/southbridge/nvidia/ck804/ck804_early_setup.c b/src/southbridge/nvidia/ck804/ck804_early_setup.c
index 7a7e467e72..bd14635541 100644
--- a/src/southbridge/nvidia/ck804/ck804_early_setup.c
+++ b/src/southbridge/nvidia/ck804/ck804_early_setup.c
@@ -383,3 +383,23 @@ static int ck804_early_setup_x(void)
ck804_early_clear_port();
return set_ht_link_ck804(4);
}
+
+static void hard_reset(void)
+{
+ set_bios_reset();
+
+ /* full reset */
+ outb(0x0a, 0x0cf9);
+ outb(0x0e, 0x0cf9);
+}
+
+static void soft_reset(void)
+{
+ set_bios_reset();
+#if 1
+ /* link reset */
+ outb(0x02, 0x0cf9);
+ outb(0x06, 0x0cf9);
+#endif
+}
+
diff --git a/src/southbridge/nvidia/ck804/ck804_early_setup_car.c b/src/southbridge/nvidia/ck804/ck804_early_setup_car.c
index bc382ca7e3..a144f1227a 100644
--- a/src/southbridge/nvidia/ck804/ck804_early_setup_car.c
+++ b/src/southbridge/nvidia/ck804/ck804_early_setup_car.c
@@ -426,3 +426,23 @@ static int ck804_early_setup_x(void)
ck804_early_clear_port(ck804_num, busn, io_base);
return set_ht_link_ck804(4);
}
+
+static void hard_reset(void)
+{
+ set_bios_reset();
+
+ /* full reset */
+ outb(0x0a, 0x0cf9);
+ outb(0x0e, 0x0cf9);
+}
+
+static void soft_reset(void)
+{
+ set_bios_reset();
+#if 1
+ /* link reset */
+ outb(0x02, 0x0cf9);
+ outb(0x06, 0x0cf9);
+#endif
+}
+
diff --git a/src/southbridge/nvidia/ck804/ck804_enable_rom.c b/src/southbridge/nvidia/ck804/ck804_enable_rom.c
index 48ce689358..070c09efe3 100644
--- a/src/southbridge/nvidia/ck804/ck804_enable_rom.c
+++ b/src/southbridge/nvidia/ck804/ck804_enable_rom.c
@@ -3,6 +3,7 @@
* by yhlu@tyan.com
*/
+
static void ck804_enable_rom(void)
{
unsigned char byte;
diff --git a/src/southbridge/nvidia/ck804/ck804_smbus.h b/src/southbridge/nvidia/ck804/ck804_smbus.h
index 079007836f..88843585aa 100644
--- a/src/southbridge/nvidia/ck804/ck804_smbus.h
+++ b/src/southbridge/nvidia/ck804/ck804_smbus.h
@@ -29,14 +29,13 @@ static int smbus_wait_until_ready(unsigned smbus_io_base)
unsigned char val;
smbus_delay();
val = inb(smbus_io_base + SMBHSTSTAT);
- if ((val & 0x1f) == 0) {
- break;
- }
- if(loops == (SMBUS_TIMEOUT / 2)) {
- outb((val & 0x1f),smbus_io_base + SMBHSTSTAT);
+ val &= 0x1f;
+ if (val == 0) {
+ return 0;
}
+ outb(val,smbus_io_base + SMBHSTSTAT);
} while(--loops);
- return loops?0:-2;
+ return -2;
}
static int smbus_wait_until_done(unsigned smbus_io_base)
@@ -49,10 +48,10 @@ static int smbus_wait_until_done(unsigned smbus_io_base)
val = inb(smbus_io_base + SMBHSTSTAT);
if ( (val & 0xff) != 0) {
- break;
+ return 0;
}
} while(--loops);
- return loops?0:-3;
+ return -3;
}
static int do_smbus_recv_byte(unsigned smbus_io_base, unsigned device)
{
@@ -200,3 +199,4 @@ static int do_smbus_write_byte(unsigned smbus_io_base, unsigned device, unsigned
}
return 0;
}
+