aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/dev/amdsbwd/amd_chipset.h7
-rw-r--r--sys/dev/amdsbwd/amdsbwd.c21
2 files changed, 18 insertions, 10 deletions
diff --git a/sys/dev/amdsbwd/amd_chipset.h b/sys/dev/amdsbwd/amd_chipset.h
index 51ef8840661a..19fe49fad38b 100644
--- a/sys/dev/amdsbwd/amd_chipset.h
+++ b/sys/dev/amdsbwd/amd_chipset.h
@@ -95,9 +95,10 @@
#define AMDSB8_WDT_32KHZ 0x00
#define AMDSB8_WDT_1HZ 0x03
#define AMDSB8_WDT_RES_MASK 0x03
-#define AMDSB8_PM_RESET_STATUS0 0xc0
-#define AMDSB8_PM_RESET_STATUS1 0xc1
-#define AMDSB8_WD_RST_STS 0x20
+#define AMDSB8_PM_RESET_STATUS 0xc0 /* 32 bit wide */
+#define AMDSB8_WD_RST_STS 0x2000000
+#define AMDSB8_PM_RESET_CTRL 0xc4
+#define AMDSB8_RST_STS_DIS 0x04
/*
* Newer FCH registers in the PMIO space.
diff --git a/sys/dev/amdsbwd/amdsbwd.c b/sys/dev/amdsbwd/amdsbwd.c
index 4676d9f6ba31..ca63a468cc5f 100644
--- a/sys/dev/amdsbwd/amdsbwd.c
+++ b/sys/dev/amdsbwd/amdsbwd.c
@@ -321,16 +321,23 @@ amdsbwd_probe_sb7xx(device_t dev, struct resource *pmres, uint32_t *addr)
static void
amdsbwd_probe_sb8xx(device_t dev, struct resource *pmres, uint32_t *addr)
{
- uint8_t val;
- int i;
+ uint32_t val;
+ int i;
/* Report cause of previous reset for user's convenience. */
- val = pmio_read(pmres, AMDSB8_PM_RESET_STATUS0);
- if (val != 0)
- amdsbwd_verbose_printf(dev, "ResetStatus0 = %#04x\n", val);
- val = pmio_read(pmres, AMDSB8_PM_RESET_STATUS1);
+
+ val = pmio_read(pmres, AMDSB8_PM_RESET_CTRL);
+ if ((val & AMDSB8_RST_STS_DIS) != 0) {
+ val &= ~AMDSB8_RST_STS_DIS;
+ pmio_write(pmres, AMDSB8_PM_RESET_CTRL, val);
+ }
+ val = 0;
+ for (i = 3; i >= 0; i--) {
+ val <<= 8;
+ val |= pmio_read(pmres, AMDSB8_PM_RESET_STATUS + i);
+ }
if (val != 0)
- amdsbwd_verbose_printf(dev, "ResetStatus1 = %#04x\n", val);
+ amdsbwd_verbose_printf(dev, "ResetStatus = 0x%08x\n", val);
if ((val & AMDSB8_WD_RST_STS) != 0)
device_printf(dev, "Previous Reset was caused by Watchdog\n");