]> git.baikalelectronics.ru Git - uboot.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)
commita17fba764b348b519d9821b9cb8dc3a10298453e
treeddf7f0c146cb7db26451e4ec01c58835a900093b
parent017042e3f2531a55273ea8dc775f5ab82c89a719
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