summaryrefslogtreecommitdiff
path: root/sys/dev/acpi
diff options
context:
space:
mode:
authorthorpej <thorpej@NetBSD.org>2021-01-16 01:23:04 +0000
committerthorpej <thorpej@NetBSD.org>2021-01-16 01:23:04 +0000
commitb0dc2b6749d4ec55fb81f27ae68d5bc098a14aa7 (patch)
treef5f9e8d2c50f493ac59366c1914083debd008284 /sys/dev/acpi
parent439c0dce56ac3314a8bfaf915b4dc4ae539ab799 (diff)
Match PNP0C31 as a TPM 1.2 device. Works on my ThinkPad X260, and
eliminates the last of the devices that attach to "isa".
Diffstat (limited to 'sys/dev/acpi')
-rw-r--r--sys/dev/acpi/tpm_acpi.c23
1 files changed, 20 insertions, 3 deletions
diff --git a/sys/dev/acpi/tpm_acpi.c b/sys/dev/acpi/tpm_acpi.c
index f95667d939a..82c7d0d8363 100644
--- a/sys/dev/acpi/tpm_acpi.c
+++ b/sys/dev/acpi/tpm_acpi.c
@@ -1,4 +1,4 @@
-/* $NetBSD: tpm_acpi.c,v 1.11 2019/10/09 14:03:57 maxv Exp $ */
+/* $NetBSD: tpm_acpi.c,v 1.12 2021/01/16 01:23:04 thorpej Exp $ */
/*
* Copyright (c) 2012, 2019 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tpm_acpi.c,v 1.11 2019/10/09 14:03:57 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tpm_acpi.c,v 1.12 2021/01/16 01:23:04 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -56,6 +56,14 @@ CFATTACH_DECL_NEW(tpm_acpi, sizeof(struct tpm_softc), tpm_acpi_match,
tpm_acpi_attach, NULL, NULL);
/*
+ * Supported TPM 1.2 devices.
+ */
+static const char * const tpm_1_2_acpi_ids[] = {
+ "PNP0C31",
+ NULL
+};
+
+/*
* Supported TPM 2.0 devices.
*/
static const char * const tpm2_acpi_ids[] = {
@@ -77,6 +85,11 @@ tpm_acpi_match(device_t parent, cfdata_t match, void *aux)
if (tpm_cd.cd_devs && tpm_cd.cd_devs[0])
return 0;
+ if (acpi_match_hid(aa->aa_node->ad_devinfo, tpm_1_2_acpi_ids)) {
+ /* XXX assume TPM 1.2 devices are memory-mapped. */
+ return 1;
+ }
+
if (!acpi_match_hid(aa->aa_node->ad_devinfo, tpm2_acpi_ids))
return 0;
@@ -122,7 +135,11 @@ tpm_acpi_attach(device_t parent, device_t self, void *aux)
size = mem->ar_length;
sc->sc_dev = self;
- sc->sc_ver = TPM_2_0;
+ if (acpi_match_hid(aa->aa_node->ad_devinfo, tpm_1_2_acpi_ids)) {
+ sc->sc_ver = TPM_1_2;
+ } else {
+ sc->sc_ver = TPM_2_0;
+ }
mutex_init(&sc->sc_lock, MUTEX_DEFAULT, IPL_NONE);
sc->sc_busy = false;
sc->sc_intf = &tpm_intf_tis12;