mirror of
https://github.com/u-boot/u-boot.git
synced 2025-05-08 19:11:53 +00:00
tpm: rng: Add driver model interface for TPM RNG device
The TPM device has a builtin random number generator(RNG) functionality. Expose the RNG functions of the TPM device to the driver model so that they can be used by the EFI_RNG_PROTOCOL if the protocol is installed. Also change the function arguments and return type of the random number functions to comply with the driver model api. Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
This commit is contained in:
parent
5d98329196
commit
e67ffb5aa5
5 changed files with 37 additions and 3 deletions
|
@ -269,7 +269,7 @@ u32 tpm_get_random(struct udevice *dev, void *data, u32 count)
|
|||
if (tpm_is_v1(dev))
|
||||
return tpm1_get_random(dev, data, count);
|
||||
else if (tpm_is_v2(dev))
|
||||
return -ENOSYS; /* not implemented yet */
|
||||
else
|
||||
return -ENOSYS;
|
||||
return tpm2_get_random(dev, data, count);
|
||||
|
||||
return -ENOSYS;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue