hwdb: introduce hwdb for tpm2 devices

This hwdb is can carry hw quirks and similar for us, in particular tell
us if nvpcrs have a chance of working.
This commit is contained in:
Lennart Poettering
2026-03-04 08:28:41 +01:00
parent dc75e54270
commit f2eed3fa25
4 changed files with 18 additions and 0 deletions
+14
View File
@@ -0,0 +1,14 @@
# This file is part of systemd.
#
# Use "systemd-analyze identify-tpm2" to generate the modalias string for your
# hardware. Don't forget to prefix it with "tpm:" for inclusion in a match here.
#
# Currently, the only relevant property to set here is TPM2_BROKEN_NVPCR=1,
# which should be set on TPMs where NvPCRs don't work. Specifically, because
# on some hardware the combination of TPMA_NV_ORDERLY + TPM2_NT_EXTEND cause
# NV_Extend() operations to time out. For details, see:
# https://github.com/systemd/systemd/issues/40485
# ST33TPHF2ESPI Firmware 73.4
tpm2:*:mfSTM:*:fw73.4.*:
TPM2_BROKEN_NVPCR=1
+1
View File
@@ -26,6 +26,7 @@ hwdb_files_test = files(
'60-keyboard.hwdb',
'60-seat.hwdb',
'60-sensor.hwdb',
'60-tpm2.hwdb',
'70-analyzers.hwdb',
'70-av-production.hwdb',
'70-cameras.hwdb',
+2
View File
@@ -105,6 +105,7 @@ GENERAL_MATCHES = {'acpi',
'OUI',
'pci',
'sdio',
'tpm2',
'usb',
'vmbus',
}
@@ -213,6 +214,7 @@ def property_grammar():
('ID_SYSFS_ATTRIBUTE_MODEL', name_literal),
('ID_NET_NAME_FROM_DATABASE', name_literal),
('ID_NET_NAME_INCLUDE_DOMAIN', zero_one),
('TPM2_BROKEN_NVPCR', zero_one),
)
fixed_props = [Literal(name)('NAME') - Suppress('=') - val('VALUE')
for name, val in props]
+1
View File
@@ -5,5 +5,6 @@ SUBSYSTEM!="tpmrm", GOTO="tpm2_id_end"
KERNEL!="tpmrm[0-9]*", GOTO="tpm2_id_end"
IMPORT{program}="tpm2_id identify"
ENV{ID_TPM2_MODALIAS}!="", IMPORT{builtin}="hwdb 'tpm2:$env{ID_TPM2_MODALIAS}'"
LABEL="tpm2_id_end"