2 * Copyright (C) 2017 Google, Inc.
3 * Thiebaud Weksteen <tweek@google.com>
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
10 #include <linux/efi.h>
11 #include <linux/init.h>
12 #include <linux/memblock.h>
14 #include <asm/early_ioremap.h>
17 * Reserve the memory associated with the TPM Event Log configuration table.
19 int __init
efi_tpm_eventlog_init(void)
21 struct linux_efi_tpm_eventlog
*log_tbl
;
22 unsigned int tbl_size
;
24 if (efi
.tpm_log
== EFI_INVALID_TABLE_ADDR
)
27 log_tbl
= early_memremap(efi
.tpm_log
, sizeof(*log_tbl
));
29 pr_err("Failed to map TPM Event Log table @ 0x%lx\n",
31 efi
.tpm_log
= EFI_INVALID_TABLE_ADDR
;
35 tbl_size
= sizeof(*log_tbl
) + log_tbl
->size
;
36 memblock_reserve(efi
.tpm_log
, tbl_size
);
37 early_memunmap(log_tbl
, sizeof(*log_tbl
));