A TPM is only started by U-Boot when measured boot or the EFI TCG2 protocol is used. A plain booti/bootm leaves it uninitialised, so boards work around this with 'tpm autostart' in their environment.
This series adds CONFIG_TPM_AUTOSTART, which starts the TPM from an EVT_LAST_STAGE_INIT handler, adds sandbox tests for it and converts the Xilinx Kria boards, which are the only in-tree user of the environment workaround. The Kria change is build-tested only, I do not have the hardware. Changes in v3: - Split into three patches: option + code, tests, Kria conversion - Convert the Xilinx Kria boards as the first user Michael Haener (3): tpm: Add an option to start the TPM during init tpm: Add tests for CONFIG_TPM_AUTOSTART xilinx: Use CONFIG_TPM_AUTOSTART on Kria board/xilinx/zynqmp/zynqmp_kria.env | 4 +-- configs/sandbox_defconfig | 1 + configs/xilinx_zynqmp_kria_defconfig | 1 + doc/usage/measured_boot.rst | 18 ++++++++++++ lib/Kconfig | 19 ++++++++++++ lib/Makefile | 1 + lib/tpm_autostart.c | 37 +++++++++++++++++++++++ test/dm/tpm.c | 44 ++++++++++++++++++++++++++++ 8 files changed, 122 insertions(+), 3 deletions(-) create mode 100644 lib/tpm_autostart.c base-commit: 8d7bc8add17bbc69a58dfe0002eea039dd2dc1bc -- 2.55.0
