From owner-dev-commits-src-all@freebsd.org Thu Aug 26 10:05:03 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 67CDD6668B1; Thu, 26 Aug 2021 10:05:03 +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 4GwJPC29Ksz4XRX; Thu, 26 Aug 2021 10:05:03 +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 328E06277; Thu, 26 Aug 2021 10:05:03 +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 17QA53rF018815; Thu, 26 Aug 2021 10:05:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17QA53dv018814; Thu, 26 Aug 2021 10:05:03 GMT (envelope-from git) Date: Thu, 26 Aug 2021 10:05:03 GMT Message-Id: <202108261005.17QA53dv018814@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Wojciech Macek Subject: git: 9da8235cc843 - main - ichwd: add Lewisburg Super SKUs, Cannon and Comet Lake support MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wma X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9da8235cc843364bd2df7a4d6fcd8c1be7ca67c0 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Aug 2021 10:05:03 -0000 The branch main has been updated by wma: URL: https://cgit.FreeBSD.org/src/commit/?id=9da8235cc843364bd2df7a4d6fcd8c1be7ca67c0 commit 9da8235cc843364bd2df7a4d6fcd8c1be7ca67c0 Author: Paweł Anikiel AuthorDate: 2021-07-30 08:57:28 +0000 Commit: Wojciech Macek CommitDate: 2021-08-26 10:04:28 +0000 ichwd: add Lewisburg Super SKUs, Cannon and Comet Lake support Cannon and Comet Lake PCHs have their PMC hidden, so when reading the ACPI Base Address fails, we assume a default value. Obtained from: Semihalf Sponsored by: Stormshield --- sys/dev/ichwd/ichwd.c | 27 ++++++++++++++++++++------- sys/dev/ichwd/ichwd.h | 14 ++++++++++++++ 2 files changed, 34 insertions(+), 7 deletions(-) diff --git a/sys/dev/ichwd/ichwd.c b/sys/dev/ichwd/ichwd.c index 587f99f9e7ee..5aab4af0a1f7 100644 --- a/sys/dev/ichwd/ichwd.c +++ b/sys/dev/ichwd/ichwd.c @@ -296,6 +296,9 @@ static struct ichwd_device ichwd_devices[] = { static struct ichwd_device ichwd_smb_devices[] = { { DEVICEID_LEWISBURG_SMB, "Lewisburg watchdog timer", 10, 4 }, + { DEVICEID_LEWISBURG_SMB_SSKU, "Lewisburg watchdog timer", 10, 4 }, + { DEVICEID_CANNON_SMB, "Cannon Lake watchdog timer", 10, 4, PMC_HIDDEN}, + { DEVICEID_COMET_SMB, "Comet Lake watchdog timer", 10, 4, PMC_HIDDEN}, { DEVICEID_SRPTLP_SMB, "Sunrise Point-LP watchdog timer", 10, 4 }, { DEVICEID_C3000, "Intel Atom C3000 watchdog timer", 10, 4 }, { 0, NULL, 0, 0 }, @@ -788,13 +791,23 @@ ichwd_smb_attach(device_t dev) isab = device_get_parent(device_get_parent(dev)); pmdev = pci_find_dbsf(pci_get_domain(isab), pci_get_bus(isab), 31, 2); if (pmdev == NULL) { - device_printf(dev, "unable to find Power Management device\n"); - return (ENXIO); - } - acpi_base = pci_read_config(pmdev, ICH_PMBASE, 4) & 0xffffff00; - if (acpi_base == 0) { - device_printf(dev, "ACPI base address is not set\n"); - return (ENXIO); + if (id_p->quirks & PMC_HIDDEN) { + /* + * Since the PMC is hidden, we take the default value for the + * given device, which happens to be the same for the ones we + * support. + */ + acpi_base = ACPI_DEFAULT_CANNON; + } else { + device_printf(dev, "unable to find Power Management device\n"); + return (ENXIO); + } + } else { + acpi_base = pci_read_config(pmdev, ICH_PMBASE, 4) & 0xffffff00; + if (acpi_base == 0) { + device_printf(dev, "ACPI base address is not set\n"); + return (ENXIO); + } } /* Allocate SMI control I/O register space. */ diff --git a/sys/dev/ichwd/ichwd.h b/sys/dev/ichwd/ichwd.h index f78485249871..4a15d5201a4b 100644 --- a/sys/dev/ichwd/ichwd.h +++ b/sys/dev/ichwd/ichwd.h @@ -38,6 +38,7 @@ struct ichwd_device { char *desc; unsigned int ich_version; unsigned int tco_version; + uint32_t quirks; }; struct ichwd_softc { @@ -277,6 +278,9 @@ struct ichwd_softc { #define DEVICEID_WCPT_LP7 0x9cc7 #define DEVICEID_WCPT_LP9 0x9cc9 #define DEVICEID_LEWISBURG_SMB 0xa1a3 +#define DEVICEID_LEWISBURG_SMB_SSKU 0xa223 +#define DEVICEID_CANNON_SMB 0xa323 +#define DEVICEID_COMET_SMB 0x06a3 #define DEVICEID_SRPTLP_SMB 0x9d23 /* ICH LPC Interface Bridge Registers (ICH5 and older) */ @@ -386,6 +390,9 @@ struct ichwd_softc { #define TCO_INTRD_SEL_INTR 0x0001 #define TCO_INTRD_SEL_SMI 0x0002 +/* default ACPI Base values */ +#define ACPI_DEFAULT_CANNON 0x1800 + /* * Masks for the TCO timer value field in TCO_RLD. * If the datasheets are to be believed, the minimum value actually varies @@ -408,4 +415,11 @@ struct ichwd_softc { */ #define ICHWD_TCO_V3_TICK 1000000000 +/* + * Quirks + */ + +/* On Cannon Lake and Commet Lake PHCs, the PMC is hidden */ +#define PMC_HIDDEN (1 << 0) + #endif