mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2026-06-13 15:03:58 +03:00
tpm: Remove use of build-time TPM versions
There is only one place in the code which assumes at build-time that we are using either a v1 or a v2 TPM. Fix this up and add a new function to return the version of a TPM. Supported TPM versions (v1 and v2) can be enabled independently and it is possible to use both versions at once. This is useful for sandbox when running tests. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
@@ -274,4 +274,15 @@ static inline cmd_tbl_t *get_tpm2_commands(unsigned int *size)
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* tpm_get_version() - Find the version of a TPM
|
||||
*
|
||||
* This checks the uclass data for a TPM device and returns the version number
|
||||
* it supports.
|
||||
*
|
||||
* @dev: TPM device
|
||||
* @return version number (TPM_V1 or TPMV2)
|
||||
*/
|
||||
enum tpm_version tpm_get_version(struct udevice *dev);
|
||||
|
||||
#endif /* __TPM_COMMON_H */
|
||||
|
||||
Reference in New Issue
Block a user