1 /* SPDX-License-Identifier: GPL-2.0 */
3 #ifndef __TPM_EVENTLOG_H__
4 #define __TPM_EVENTLOG_H__
6 #include <crypto/hash_info.h>
8 #define TCG_EVENT_NAME_LEN_MAX 255
9 #define MAX_TEXT_EVENT 1000 /* Max event string length */
10 #define ACPI_TCPA_SIG "TCPA" /* 0x41504354 /'TCPA' */
11 #define TPM2_ACTIVE_PCR_BANKS 3
14 #define do_endian_conversion(x) be32_to_cpu(x)
16 #define do_endian_conversion(x) x
19 enum bios_platform_class
{
27 u8 pcr_value
[20]; /* SHA1 */
32 enum tcpa_event_types
{
43 PLATFORM_CONFIG_FLAGS
,
53 struct tcpa_pc_event
{
59 enum tcpa_pc_event_ids
{
68 OPTION_ROM_MICROCODE
= 10,
72 HOST_TABLE_OF_DEVICES
,
75 /* http://www.trustedcomputinggroup.org/tcg-efi-protocol-specification/ */
77 struct tcg_efi_specid_event_algs
{
82 struct tcg_efi_specid_event
{
85 u8 spec_version_minor
;
86 u8 spec_version_major
;
90 struct tcg_efi_specid_event_algs digest_sizes
[TPM2_ACTIVE_PCR_BANKS
];
95 struct tcg_pcr_event
{
103 struct tcg_event_field
{
108 struct tcg_pcr_event2
{
112 struct tpm2_digest digests
[TPM2_ACTIVE_PCR_BANKS
];
113 struct tcg_event_field event
;
116 extern const struct seq_operations tpm2_binary_b_measurements_seqops
;
118 #if defined(CONFIG_ACPI)
119 int tpm_read_log_acpi(struct tpm_chip
*chip
);
121 static inline int tpm_read_log_acpi(struct tpm_chip
*chip
)
126 #if defined(CONFIG_OF)
127 int tpm_read_log_of(struct tpm_chip
*chip
);
129 static inline int tpm_read_log_of(struct tpm_chip
*chip
)
135 int tpm_bios_log_setup(struct tpm_chip
*chip
);
136 void tpm_bios_log_teardown(struct tpm_chip
*chip
);