]> git.dujemihanovic.xyz Git - u-boot.git/commit
tpm: cr50: Check for valid locality
authorSimon Glass <sjg@chromium.org>
Thu, 31 Dec 2020 16:52:12 +0000 (09:52 -0700)
committerSimon Glass <sjg@chromium.org>
Sat, 30 Jan 2021 21:25:41 +0000 (14:25 -0700)
commit6208975e237c9549cab50756c6291d3ecde953b7
treeddf7f0c146cb7db26451e4ec01c58835a900093b
parent472a716b8fdfd88a27cb675e4ea8e12cb4f79fc3
tpm: cr50: Check for valid locality

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@chromium.org>
drivers/tpm/cr50_i2c.c