1 /* SPDX-License-Identifier: BSD-3-Clause */
2 /*
3  * Copyright (c) 2020, ARM Limited. All rights reserved.
4  */
5 
6 #ifndef __KERNEL_TPM_H__
7 #define __KERNEL_TPM_H__
8 
9 #include <tee_api_types.h>
10 
11 #ifdef CFG_CORE_TPM_EVENT_LOG
12 
13 /*
14  * Returns the TPM Event Log information previously retrieved
15  * by @tpm_map_log_area.
16  *
17  * @buf Pointer to a buffer where to store a copy of the TPM Event log.
18  */
19 TEE_Result tpm_get_event_log(void *buf, size_t *size);
20 
21 /*
22  * Reads the TPM Event log information and store it internally.
23  * If support for DTB is enabled, it will read the parameters there.
24  * Otherwise, it will use the constant parameters hardcoded in conf.mk.
25  *
26  * @fdt Pointer to the DTB blob where the TPM Event log information
27  * is expected to be.
28  */
29 void tpm_map_log_area(void *fdt);
30 
31 #else
32 
tpm_get_event_log(void * buf __unused,size_t * size __unused)33 static inline TEE_Result tpm_get_event_log(void *buf __unused,
34 					   size_t *size __unused)
35 {
36 	return TEE_ERROR_NOT_SUPPORTED;
37 }
38 
tpm_map_log_area(void * fdt __unused)39 static inline void tpm_map_log_area(void *fdt __unused)
40 {}
41 
42 #endif /* CFG_CORE_TPM_EVENT_LOG */
43 
44 #endif /* __KERNEL_TPM_H__ */
45