blob: 5ea4c554a075fb2720667eab6d012d28ec3433ce [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
laurenw-arm7834aa02022-05-31 16:39:09 -050010# Measured Boot hash algorithm.
Sandrine Bailleux3c2db6f2021-07-07 14:47:08 +020011# SHA-256 (or stronger) is required for all devices that are TPM 2.0 compliant.
laurenw-arm7834aa02022-05-31 16:39:09 -050012ifdef TPM_HASH_ALG
13 $(warning "TPM_HASH_ALG is deprecated. Please use MBOOT_EL_HASH_ALG instead.")
14 MBOOT_EL_HASH_ALG := ${TPM_HASH_ALG}
15else
16 MBOOT_EL_HASH_ALG := sha256
17endif
Alexei Fedorov71d81dc2020-07-13 13:58:06 +010018
laurenw-arm7834aa02022-05-31 16:39:09 -050019ifeq (${MBOOT_EL_HASH_ALG}, sha512)
Alexei Fedorov71d81dc2020-07-13 13:58:06 +010020 TPM_ALG_ID := TPM_ALG_SHA512
21 TCG_DIGEST_SIZE := 64U
laurenw-arm7834aa02022-05-31 16:39:09 -050022else ifeq (${MBOOT_EL_HASH_ALG}, sha384)
Alexei Fedorov71d81dc2020-07-13 13:58:06 +010023 TPM_ALG_ID := TPM_ALG_SHA384
24 TCG_DIGEST_SIZE := 48U
25else
Alexei Fedorov71d81dc2020-07-13 13:58:06 +010026 TPM_ALG_ID := TPM_ALG_SHA256
27 TCG_DIGEST_SIZE := 32U
laurenw-arm7834aa02022-05-31 16:39:09 -050028endif #MBOOT_EL_HASH_ALG
Alexei Fedorov71d81dc2020-07-13 13:58:06 +010029
Manish V Badarkhee112a5a2021-10-06 23:41:50 +010030# Set definitions for Measured Boot driver.
Leonardo Sandoval65fca7c2020-09-10 12:18:27 -050031$(eval $(call add_defines,\
32 $(sort \
Leonardo Sandoval65fca7c2020-09-10 12:18:27 -050033 TPM_ALG_ID \
34 TCG_DIGEST_SIZE \
Javier Almansa Sobrino0d1f6b12020-09-18 16:47:07 +010035 EVENT_LOG_LEVEL \
Leonardo Sandoval65fca7c2020-09-10 12:18:27 -050036)))
Alexei Fedorov71d81dc2020-07-13 13:58:06 +010037
Manish V Badarkhef9c366c2022-01-18 22:40:17 +000038EVENT_LOG_SRC_DIR := drivers/measured_boot/event_log/
Alexei Fedorov71d81dc2020-07-13 13:58:06 +010039
Manish V Badarkhef9c366c2022-01-18 22:40:17 +000040EVENT_LOG_SOURCES := ${EVENT_LOG_SRC_DIR}event_log.c \
41 ${EVENT_LOG_SRC_DIR}event_print.c