vboot2: Fix flows for TPM_E_MUST_REBOOT
While migrating from vboot1 to vboot2, the tpm_init was moved out of
vboot library and implemented in coreboot. However, while doing this,
the initial factory flow was missed.
We need to ensure following flow for tpm_init:
1. Perform tpm_init
2. If tpm_init fails, set secdata_context flag to indicate to vboot
that tpm needs reboot.
3. Call vb2_api_phase1
4. If vb2_api_phase1 returns error code saying boot into recovery,
continue booting into recovery. For all other error codes, save
context if required and reboot.
[pg: everything but step 2 was already done, so this upstream commit is
TEST=Verified behavior on smaug. Steps to test:
1. Reboot into recovery
2. tpmc clear
3. Reboot device
Expected Behavior: Device should reboot after Enabling TPM. Should not
Confirmed that the device behaves as expected.
Signed-off-by: Patrick Georgi <email@example.com>
Original-Signed-off-by: Furquan Shaikh <firstname.lastname@example.org>
Original-Commit-Ready: Furquan Shaikh <email@example.com>
Original-Tested-by: Furquan Shaikh <firstname.lastname@example.org>
Original-Reviewed-by: Randall Spangler <email@example.com>
Original-Reviewed-by: Julius Werner <firstname.lastname@example.org>
Reviewed-by: Aaron Durbin <email@example.com>
Tested-by: build bot (Jenkins)
1 file changed