blob: d3fbbb5ae55c596a59329f30f5f969f0b374ff1f [file] [log] [blame]
Alexei Fedorov71d81dc2020-07-13 13:58:06 +01001#
Manish V Badarkhe5797b802021-08-06 09:26:20 +01002# Copyright (c) 2020-2021, 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
Sandrine Bailleux3c2db6f2021-07-07 14:47:08 +020033MEASURED_BOOT_SRC_DIR := drivers/measured_boot/event_log/
Alexei Fedorov71d81dc2020-07-13 13:58:06 +010034
Manish V Badarkhe5797b802021-08-06 09:26:20 +010035MEASURED_BOOT_SOURCES := ${MEASURED_BOOT_SRC_DIR}event_log.c \
36 ${MEASURED_BOOT_SRC_DIR}event_print.c
Alexei Fedorov71d81dc2020-07-13 13:58:06 +010037
38BL2_SOURCES += ${MEASURED_BOOT_SOURCES}
Manish V Badarkhea74d9632021-09-14 23:12:42 +010039BL1_SOURCES += ${MEASURED_BOOT_SOURCES}