blob: 1ff4aa81c2ce9d78de8ae46547aa55cbf0c082e7 [file] [log] [blame]
Alexei Fedorov71d81dc2020-07-13 13:58:06 +01001#
Manish V Badarkhef9c366c2022-01-18 22:40:17 +00002# Copyright (c) 2020-2022, Arm Limited. All rights reserved.
Alexei Fedorov71d81dc2020-07-13 13:58:06 +01003#
4# SPDX-License-Identifier: BSD-3-Clause
5#
6
Javier Almansa Sobrino0d1f6b12020-09-18 16:47:07 +01007# Default log level to dump the event log (LOG_LEVEL_INFO)
8EVENT_LOG_LEVEL ?= 40
9
Sandrine Bailleux3c2db6f2021-07-07 14:47:08 +020010# TPM hash algorithm.
11# SHA-256 (or stronger) is required for all devices that are TPM 2.0 compliant.
Alexei Fedorov71d81dc2020-07-13 13:58:06 +010012TPM_HASH_ALG := sha256
13
14ifeq (${TPM_HASH_ALG}, sha512)
Alexei Fedorov71d81dc2020-07-13 13:58:06 +010015 TPM_ALG_ID := TPM_ALG_SHA512
16 TCG_DIGEST_SIZE := 64U
17else ifeq (${TPM_HASH_ALG}, sha384)
Alexei Fedorov71d81dc2020-07-13 13:58:06 +010018 TPM_ALG_ID := TPM_ALG_SHA384
19 TCG_DIGEST_SIZE := 48U
20else
Alexei Fedorov71d81dc2020-07-13 13:58:06 +010021 TPM_ALG_ID := TPM_ALG_SHA256
22 TCG_DIGEST_SIZE := 32U
Manish V Badarkhee112a5a2021-10-06 23:41:50 +010023endif #TPM_HASH_ALG
Alexei Fedorov71d81dc2020-07-13 13:58:06 +010024
Manish V Badarkhee112a5a2021-10-06 23:41:50 +010025# Set definitions for Measured Boot driver.
Leonardo Sandoval65fca7c2020-09-10 12:18:27 -050026$(eval $(call add_defines,\
27 $(sort \
Leonardo Sandoval65fca7c2020-09-10 12:18:27 -050028 TPM_ALG_ID \
29 TCG_DIGEST_SIZE \
Javier Almansa Sobrino0d1f6b12020-09-18 16:47:07 +010030 EVENT_LOG_LEVEL \
Leonardo Sandoval65fca7c2020-09-10 12:18:27 -050031)))
Alexei Fedorov71d81dc2020-07-13 13:58:06 +010032
Manish V Badarkhef9c366c2022-01-18 22:40:17 +000033EVENT_LOG_SRC_DIR := drivers/measured_boot/event_log/
Alexei Fedorov71d81dc2020-07-13 13:58:06 +010034
Manish V Badarkhef9c366c2022-01-18 22:40:17 +000035EVENT_LOG_SOURCES := ${EVENT_LOG_SRC_DIR}event_log.c \
36 ${EVENT_LOG_SRC_DIR}event_print.c