[PATCH 1/5] tpm: cr50: Check for valid locality

Simon Glass sjg at chromium.org
Sat Jan 23 18:27:18 CET 2021


When the Cr50 starts up it doesn't have a valid locality. The driver sets
it to -1 to indicate that. Tracking this allows cr50_i2c_cleanup() to
avoid releasing a locality that was not claimed.

However the helper functions that generate the flags use a u8 type which
cannot support -1, so they return a locality of 0xff.

Fix this by updating the type. With this, 'tpm startup TPM2_SU_CLEAR'
works as expected.

Signed-off-by: Simon Glass <sjg at chromium.org>
---

 drivers/tpm/cr50_i2c.c | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

Applied to u-boot-dm, thanks!


More information about the U-Boot mailing list