vboot: on S3 resume from Alt OS legacy, disable TPM

When booting into Alt OS legacy mode, we plan to disable TPM before
handing off control to the OS.  On S3 resume, the TPM is re-enabled,
and thus we need to disable it in coreboot's S3 resume path.

Add a helper function to check for the ALT_OS_LEGACY_BOOT flag in
vboot_handoff's VbSharedDataHeader.

Extend vboot's BS_OS_RESUME hook to disable TPM if the
ALT_OS_LEGACY_BOOT flag is detected.

BUG=b:70681930,b:118202153
TEST=Boot into Alt OS
     Suspend and resume
     Check that TPM is successfully disabled in AP console output
CQ-DEPEND=CL:1339599,CL:1362268

Signed-off-by: Joel Kitching <kitching@google.com>
Change-Id: Ie2c176d924cb6bde3c407dfc0d2b0b89b0d7799d
Reviewed-on: https://chromium-review.googlesource.com/c/1339681
Tested-by: Joel Kitching <kitching@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Reviewed-by: Namyoon Woo <namyoon@chromium.org>
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Commit-Queue: Joel Kitching <kitching@chromium.org>
3 files changed