From c7bf8f59e05513a98b6d85bc06dfd1d25cfff656 Mon Sep 17 00:00:00 2001 From: Denis 'GNUtoo' Carikli Date: Sat, 23 Jan 2016 05:46:51 +0100 Subject: [PATCH] mb/lenovo/x60: Enable TPM Enable the onboard TPM device in the devicetree, and select Kconfig options to add the appropriate ASL code. This is adapted from commit 3d02b9c7. (mainboard/lenovo/{t430s,t420s,t520,t530,x220}: Add TPM 1.2 mainboard support) Without this, coreboot doesn't touch the device and generates no ACPI entry for it. Thus, in GNU/Linux, it is not detected automatically. You can, however, force the Linux kernel to scan buses by running the following commands: # modprobe -r tpm_tis # modprobe tpm_tis force=1 Running the commands above outputs some messages to dmesg, although the actual messages vary between kernel versions. With Linux 4.9.235: tpm_tis tpm_tis: 1.2 TPM (device-id 0x3202, rev-id 5) tpm tpm0: Issuing TPM_STARTUP tpm tpm0: [Hardware Error]: Adjusting reported timeouts: A 10000->10000us B 10000->10000us C 0->750000us D 0->750000us tpm tpm0: [Hardware Error]: Adjusting reported timeouts: A 10000->10000us B 10000->10000us C 0->750000us D 0->750000us tpm tpm0: TPM is disabled/deactivated (0x6) Then /dev/tpm0 is created. The content of /sys/class/tpm/tpm0/caps is: Manufacturer: 0x41544d4c TCG version: 1.2 Firmware version: 11.5 With Linux 5.4.64: tpm_tis tpm_tis: 1.2 TPM (device-id 0xFFFF, rev-id 255) tpm tpm0: tpm_try_transmit: send(): error -5 tpm tpm0: A TPM error (-5) occurred attempting to determine the timeouts tpm_tis tpm_tis: Could not get TPM timeouts and durations In this case, tpm0 is not created. Now, coreboot tries to initialize the device but fails to do so. From the console log: lpc_tpm: Read reg 0xf00 returns 0xffffffff tis_probe: No TPM device found TPM: Can't initialize. While coreboot provides an ACPI entry anyway, for some reasons, Linux still does not scan the device automatically. See also previous discussions on LKML [1]. [1]: https://lore.kernel.org/lkml/?q=Regression+between+Linux+3.16+and+4.8%2F4.9+on+Lenovo+X60+with+coreboot Change-Id: I6e65b37507c111af1c0c56822327d5497f58f085 Signed-off-by: Denis 'GNUtoo' Carikli Signed-off-by: Paul Menzel Signed-off-by: Masanori Ogino --- src/mainboard/lenovo/x60/Kconfig | 2 ++ src/mainboard/lenovo/x60/devicetree.cb | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/mainboard/lenovo/x60/Kconfig b/src/mainboard/lenovo/x60/Kconfig index d5b5f33366..82ca3271d1 100644 --- a/src/mainboard/lenovo/x60/Kconfig +++ b/src/mainboard/lenovo/x60/Kconfig @@ -24,6 +24,8 @@ config BOARD_SPECIFIC_OPTIONS select DRIVERS_LENOVO_WACOM select I945_LVDS select INTEL_GMA_HAVE_VBT + select MAINBOARD_HAS_LPC_TPM + select MAINBOARD_HAS_TPM1 config VBOOT select VBOOT_VBNV_CMOS diff --git a/src/mainboard/lenovo/x60/devicetree.cb b/src/mainboard/lenovo/x60/devicetree.cb index 8620062928..99e6516e5f 100644 --- a/src/mainboard/lenovo/x60/devicetree.cb +++ b/src/mainboard/lenovo/x60/devicetree.cb @@ -157,7 +157,6 @@ chip northbridge/intel/i945 io 0x60 = 0x164c end end - chip superio/nsc/pc87392 device pnp 2e.0 off end #FDC @@ -182,6 +181,9 @@ chip northbridge/intel/i945 device pnp 2e.a off end # WDT end + chip drivers/pc80/tpm + device pnp 0c31.0 on end + end end device pci 1f.1 on # IDE subsystemid 0x17aa 0x200c -- 2.34.2