From nobody Mon Dec 27 12:01:46 2021 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id D73CD191BB87; Mon, 27 Dec 2021 12:01:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4JMx963xpXz3l4y; Mon, 27 Dec 2021 12:01:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 62D941D8AD; Mon, 27 Dec 2021 12:01:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1BRC1kvM064348; Mon, 27 Dec 2021 12:01:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1BRC1knM064347; Mon, 27 Dec 2021 12:01:46 GMT (envelope-from git) Date: Mon, 27 Dec 2021 12:01:46 GMT Message-Id: <202112271201.1BRC1knM064347@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andriy Gapon Subject: git: e1f84822b249 - stable/12 - amdsbwd: always enable watchdog register decoding List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: avg X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: e1f84822b249aa6799d92fd96a875e05498cedfa Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1640606506; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7Va2T/fzMMnbqDBZYLtR6eKA+NWd4tzQ0mLUTro8ZX4=; b=xY2iN0qBeHc8bT1Ug7+t8cuVmDjTsiygrfJ5a2SiyoM09heciT9zt0g5tvS3HeJ9hgcgzY si4jKLlZLXRznGUq04Q35DOZOlUqGbUy8u4ATxBDVIG6waQwC2eLHMNktSU5Sh0698s6i7 Q0az5gbVRGOmbA4dyL5OvZCq4YZyhwk72c4Hu0YtRJh1syUb7ZI1MpxeGA4jqUAB602KOV OAknORaqe1sBjH6Q8y+t4G3gGmiJd2qFbL+ZRDPXgRQsg+hZeLl/Mchwb7YJZAhABeyqO2 MgYQmyx4udm+rhABpM9dTpd3zhHEIzTNktG+f//Qi7cvteY/sED6AP0bVDqVHQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1640606506; a=rsa-sha256; cv=none; b=fwEb1kTQBMs4mH9q2O0fY44ZugjLvhVCHXo0dgpO6PiaaISnNHm3rlBXlPQHjhl+He0NpZ oz/MLKy1DaBKcRnEyhxcJKScqHtdDyO36CkBX3tV//7LSlxd0mcpTnGLu4fluVGmRVyk7m 0c/8NjENTR/eZP0L2YoBrswqe3zZEXQT1A+JQzIxspchi/EFVOsGZmhsthDsuwP55j84ij CvYPr/o8OCPXIOzb+V5BwOss+xF7J/zFfi/BTdDi1Mg1UoQnBnOSEe74IXLGPU/Gr71Sc1 uZ8Jneq8QUSPj2rIHOU1hgrirUkhI69tnBZOeWA2dmQSN9Cu4URkiMOotNyqtg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by avg: URL: https://cgit.FreeBSD.org/src/commit/?id=e1f84822b249aa6799d92fd96a875e05498cedfa commit e1f84822b249aa6799d92fd96a875e05498cedfa Author: Andriy Gapon AuthorDate: 2020-05-27 10:15:54 +0000 Commit: Andriy Gapon 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; }