cr50: add unmarshaling of vendor commands and process 'enable_update'

Hardware / Coreboot - Vadim Bendebury [] - 23 March 2017 18:49 EDT

The upcoming Cr50 firmware changes will require the AP to enable the previously downloaded Cr50 firmware update(s).

A new vendor command (TPM2_CR50_SUB_CMD_TURN_UPDATE_ON) is used for that. The command accepts one parameter - a timeout value in range of 0 to 1000 ms.

When processing the command the Cr50 checks if the alternative RO or RW image(s) need to be enabled, and if so - enables them and returns to the host the number of enabled headers.

If the vendor command requested a non-zero timeout, the Cr50 starts a timer to trigger system reboot after the requested timeout expires.

The host acts on the number of enabled headers - if the number is nonzero, the host prepares the device to be reset and waits for the Cr50 to reboot the device after timeout expires.

This patch also adds more formal vendor command marshaling/unmarshaling to make future additions easier.

BRANCH=gru,reef BUG=b:35580805 TEST=with the actual user of this code in the next patch verified that the cr50 update is enabled as expected.

Change-Id: Ic76d384d637c0eeaad206e0a8242cbb8e2b19b37

021ec28 cr50: add unmarshaling of vendor commands and process 'enable_update'
src/include/tpm_lite/tlcl.h | 12 ++++++++++++
src/lib/tpm2_marshaling.c | 35 +++++++++++++++++++++++++----------
src/lib/tpm2_tlcl.c | 19 +++++++++++++++++++
src/lib/tpm2_tlcl_structures.h | 9 +++++++++
4 files changed, 65 insertions(+), 10 deletions(-)


  • Share