1 // SPDX-License-Identifier: GPL-2.0
3 * Copyright (C) 2017 Google, Inc.
4 * Thiebaud Weksteen <tweek@google.com>
8 #include <linux/init.h>
9 #include <linux/memblock.h>
11 #include <asm/early_ioremap.h>
14 * Reserve the memory associated with the TPM Event Log configuration table.
16 int __init efi_tpm_eventlog_init(void)
18 struct linux_efi_tpm_eventlog *log_tbl;
19 unsigned int tbl_size;
21 if (efi.tpm_log == EFI_INVALID_TABLE_ADDR)
24 log_tbl = early_memremap(efi.tpm_log, sizeof(*log_tbl));
26 pr_err("Failed to map TPM Event Log table @ 0x%lx\n",
28 efi.tpm_log = EFI_INVALID_TABLE_ADDR;
32 tbl_size = sizeof(*log_tbl) + log_tbl->size;
33 memblock_reserve(efi.tpm_log, tbl_size);
34 early_memunmap(log_tbl, sizeof(*log_tbl));