How to determine if computer has TPM (Trusted Platform Module) available

TPMs don't necessarily appear in the ACPI tables, but the modules do print a message when they find a supported module; for example

[  134.026892] tpm_tis 00:08: 1.2 TPM (device-id 0xB, rev-id 16)

So dmesg | grep -i tpm is a good indicator.

The definitive indicator is your firmware's setup tool: TPMs involve ownership procedures which are managed from the firmware setup. If your setup doesn't mention anything TPM-related then you don't have a TPM.

TPMs are usually found in servers and business laptops (and ChromeBooks, as explained by icarus), they're rare in desktops or "non-business" laptops. Anything supporting Intel TXT has a TPM.


Also can also detect it via sysfs:

$ [ -d $(ls -d /sys/kernel/security/tpm* 2>/dev/null | head -1) ] && echo "TPM available" \
    || echo "TPM missing"

And since kernel 5.6 (commit 7084eddf6be9 tpm: Add tpm_version_major sysfs file), version can be detected with sysfs file:

$ cat /sys/class/tpm/tpm*/tpm_version_major
1

NOTE: some TPM don't export sysfs (bug?).

Other way is to check for /dev/tpm0 or /dev/tpmrm0. All TPM devices should have /dev/tpm0. /dev/tpmrm0 is only for TPM 2.0, but it was added in v4.12-rc1 (fdc915f7f719 tpm: expose spaces via a device link /dev/tpmrm):

[ -c /dev/tpmrm0 ] && echo "TPM 2.0" # since v4.12-rc1

[ -c /dev/tpm0 ] && echo "TPM 1.2 or 2.0"