tpm2: add tlcl_force_clear and use it before factory init

tlcl_force_clear() needs to be issued each time when the device mode
switches between normal/development/recovery.

This patch adds command implementation using TPM_Clear TPM2 command,
and also invokes it before factory initialization.

TEST=verified that TPM_Clear command succeeds at factory startup and
     the boot proceeds normally.

Change-Id: Ia431390870cbe448bc1b6f1755ed17953be9bdf1
Signed-off-by: Martin Roth <>
Original-Commit-Id: 347ff17b97da45fa4df547ff32f9dd2c8972cefd
Original-Change-Id: I2a0e62527ad46f9dd060afe5e75c7e4d56752849
Original-Signed-off-by: Vadim Bendebury <>
Original-Reviewed-by: Aaron Durbin <>
Original-Reviewed-by: Darren Krahn <>
Tested-by: build bot (Jenkins)
Reviewed-by: Philipp Deppenwiese <>
2 files changed