tpm: add wrapper and helper APIs for PCR allocate
authorRaymond Mao <raymond.mao@linaro.org>
Mon, 27 Jan 2025 14:58:48 +0000 (06:58 -0800)
committerIlias Apalodimas <ilias.apalodimas@linaro.org>
Tue, 28 Jan 2025 06:58:41 +0000 (08:58 +0200)
commitb6228b2e785df93fa4a1176d374976a9e2205924
tree6feee183cfc11104718dc5b47fccf748a582e054
parent9d2bc92ba7bba25bb7827848aa4c51534aff904c
tpm: add wrapper and helper APIs for PCR allocate

Add PCR allocate wrapper APIs for using in tcg2 protocol.
The wrapper proceeds a PCR allocate command, followed by a
shutdown command.
A system boot is required after two commands since TPM device needs
a HW reset to activate the new algorithms config.
Also, a helper function is included to determine the new bank mask
for PCR allocation by combining the status of current active,
supported and eventlog bank masks.
A new kconfig is created. PCR allocate and system reboot only
happens when the kconfig is selected, otherwise just exit with
errors.

Signed-off-by: Raymond Mao <raymond.mao@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
include/tpm-v2.h
lib/Kconfig
lib/tpm-v2.c