2 #ifndef __TPM_EVENTLOG_H__
3 #define __TPM_EVENTLOG_H__
5 #include <crypto/hash_info.h>
7 #define TCG_EVENT_NAME_LEN_MAX 255
8 #define MAX_TEXT_EVENT 1000 /* Max event string length */
9 #define ACPI_TCPA_SIG "TCPA" /* 0x41504354 /'TCPA' */
10 #define TPM2_ACTIVE_PCR_BANKS 3
13 #define do_endian_conversion(x) be32_to_cpu(x)
15 #define do_endian_conversion(x) x
18 enum bios_platform_class
{
26 u8 pcr_value
[20]; /* SHA1 */
31 enum tcpa_event_types
{
42 PLATFORM_CONFIG_FLAGS
,
52 struct tcpa_pc_event
{
58 enum tcpa_pc_event_ids
{
67 OPTION_ROM_MICROCODE
= 10,
71 HOST_TABLE_OF_DEVICES
,
74 /* http://www.trustedcomputinggroup.org/tcg-efi-protocol-specification/ */
76 struct tcg_efi_specid_event_algs
{
81 struct tcg_efi_specid_event
{
84 u8 spec_version_minor
;
85 u8 spec_version_major
;
89 struct tcg_efi_specid_event_algs digest_sizes
[TPM2_ACTIVE_PCR_BANKS
];
94 struct tcg_pcr_event
{
102 struct tcg_event_field
{
107 struct tcg_pcr_event2
{
111 struct tpm2_digest digests
[TPM2_ACTIVE_PCR_BANKS
];
112 struct tcg_event_field event
;
115 extern const struct seq_operations tpm2_binary_b_measurements_seqops
;
117 #if defined(CONFIG_ACPI)
118 int tpm_read_log_acpi(struct tpm_chip
*chip
);
120 static inline int tpm_read_log_acpi(struct tpm_chip
*chip
)
125 #if defined(CONFIG_OF)
126 int tpm_read_log_of(struct tpm_chip
*chip
);
128 static inline int tpm_read_log_of(struct tpm_chip
*chip
)
134 int tpm_bios_log_setup(struct tpm_chip
*chip
);
135 void tpm_bios_log_teardown(struct tpm_chip
*chip
);