aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndriy Gapon <avg@FreeBSD.org>2020-05-27 10:15:54 +0000
committerAndriy Gapon <avg@FreeBSD.org>2021-12-13 11:36:50 +0000
commitcca0d3bbd8c9f8b50c6940c33704a6c8c464b68f (patch)
tree49d73ebf5ad928f0f4479ab40884eef52771a254
parent1de4665dfcd7e158b09757dba31648397cd11c81 (diff)
-rw-r--r--sys/dev/amdsbwd/amdsbwd.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/sys/dev/amdsbwd/amdsbwd.c b/sys/dev/amdsbwd/amdsbwd.c
index 452b014d2240..a7ab67f1a8b8 100644
--- a/sys/dev/amdsbwd/amdsbwd.c
+++ b/sys/dev/amdsbwd/amdsbwd.c
@@ -381,24 +381,23 @@ amdsbwd_probe_fch41(device_t dev, struct resource *pmres, uint32_t *addr)
uint8_t val;
char buf[36];
+ /*
+ * Enable decoding of watchdog MMIO address.
+ */
+ val = pmio_read(pmres, AMDFCH41_PM_DECODE_EN0);
+ val |= AMDFCH41_WDT_EN;
+ pmio_write(pmres, AMDFCH41_PM_DECODE_EN0, val);
+#ifdef AMDSBWD_DEBUG
+ val = pmio_read(pmres, AMDFCH41_PM_DECODE_EN0);
+ device_printf(dev, "AMDFCH41_PM_DECODE_EN0 value = %#04x\n", val);
+#endif
+
val = pmio_read(pmres, AMDFCH41_PM_ISA_CTRL);
if ((val & AMDFCH41_MMIO_EN) != 0) {
/* Fixed offset for the watchdog within ACPI MMIO range. */
amdsbwd_verbose_printf(dev, "ACPI MMIO range is enabled\n");
*addr = AMDFCH41_MMIO_ADDR + AMDFCH41_MMIO_WDT_OFF;
} else {
- /*
- * Enable decoding of watchdog MMIO address.
- */
- val = pmio_read(pmres, AMDFCH41_PM_DECODE_EN0);
- val |= AMDFCH41_WDT_EN;
- pmio_write(pmres, AMDFCH41_PM_DECODE_EN0, val);
-#ifdef AMDSBWD_DEBUG
- val = pmio_read(pmres, AMDFCH41_PM_DECODE_EN0);
- device_printf(dev, "AMDFCH41_PM_DECODE_EN0 value = %#04x\n",
- val);
-#endif
-
/* Special fixed MMIO range for the watchdog. */
*addr = AMDFCH41_WDT_FIXED_ADDR;
}