tpm: Export the function to set up the TPM log

In some cases, we may wish to set up the TPM log under full control of
a driver in U-Boot. Export the required function to make this possible.

This avoids calling the weak function tcg2_platform_get_log() when the
caller already knows where the log is.

Series-to: u-boot
Signed-off-by: Simon Glass <sjg@chromium.org>
Series-links: 1:458273
This commit is contained in:
Simon Glass
2025-03-26 15:29:07 -06:00
parent 14a5090f90
commit dce9be4dda
2 changed files with 10 additions and 1 deletions

View File

@@ -345,4 +345,13 @@ void tcg2_platform_startup_error(struct udevice *dev, int rc);
*/
u32 tcg2_algorithm_to_mask(enum tpm2_algorithms);
/**
* tcg2_log_init() - Set up the elog
*
* @dev: TPM device, used to find the number of PCRs
* @elog Platform event log
* Return: zero on success, negative errno otherwise
*/
int tcg2_log_init(struct udevice *dev, struct tcg2_event_log *elog);
#endif /* __TPM_TCG_V2_H */

View File

@@ -220,7 +220,7 @@ static int tcg2_log_append_check(struct tcg2_event_log *elog, u32 pcr_index,
return 0;
}
static int tcg2_log_init(struct udevice *dev, struct tcg2_event_log *elog)
int tcg2_log_init(struct udevice *dev, struct tcg2_event_log *elog)
{
struct tpm_chip_priv *priv = dev_get_uclass_priv(dev);
struct tcg_efi_spec_id_event *ev;