Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 27 Dec 2021 12:01:46 GMT
From:      Andriy Gapon <avg@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: e1f84822b249 - stable/12 - amdsbwd: always enable watchdog register decoding
Message-ID:  <202112271201.1BRC1knM064347@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/12 has been updated by avg:

URL: https://cgit.FreeBSD.org/src/commit/?id=e1f84822b249aa6799d92fd96a875e05498cedfa

commit e1f84822b249aa6799d92fd96a875e05498cedfa
Author:     Andriy Gapon <avg@FreeBSD.org>
AuthorDate: 2020-05-27 10:15:54 +0000
Commit:     Andriy Gapon <avg@FreeBSD.org>
CommitDate: 2021-12-27 12:01:26 +0000

    amdsbwd: always enable watchdog register decoding
    
    This seems to be required even if the watchdog is accessed via the common
    MMIO space.
    
    Tested on:
    - Ryzen 3 3200U APU;
    - Ryzen 7 5800X CPU with X570 chipset.
    
    (cherry picked from commit cca0d3bbd8c9f8b50c6940c33704a6c8c464b68f)
---
 sys/dev/amdsbwd/amdsbwd.c | 23 +++++++++++------------
 1 file changed, 11 insertions(+), 12 deletions(-)

diff --git a/sys/dev/amdsbwd/amdsbwd.c b/sys/dev/amdsbwd/amdsbwd.c
index 51d6ef93ec00..f7d3227be950 100644
--- a/sys/dev/amdsbwd/amdsbwd.c
+++ b/sys/dev/amdsbwd/amdsbwd.c
@@ -382,24 +382,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;
 	}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202112271201.1BRC1knM064347>