1# 2# Copyright (c) 2020, Arm Limited. All rights reserved. 3# 4# SPDX-License-Identifier: BSD-3-Clause 5# 6 7# Default log level to dump the event log (LOG_LEVEL_INFO) 8EVENT_LOG_LEVEL ?= 40 9 10# TPM hash algorithm 11TPM_HASH_ALG := sha256 12 13ifeq (${TPM_HASH_ALG}, sha512) 14 MBEDTLS_MD_ID := MBEDTLS_MD_SHA512 15 TPM_ALG_ID := TPM_ALG_SHA512 16 TCG_DIGEST_SIZE := 64U 17else ifeq (${TPM_HASH_ALG}, sha384) 18 MBEDTLS_MD_ID := MBEDTLS_MD_SHA384 19 TPM_ALG_ID := TPM_ALG_SHA384 20 TCG_DIGEST_SIZE := 48U 21else 22 MBEDTLS_MD_ID := MBEDTLS_MD_SHA256 23 TPM_ALG_ID := TPM_ALG_SHA256 24 TCG_DIGEST_SIZE := 32U 25endif 26 27# Event Log length in bytes 28EVENT_LOG_SIZE := 1024 29 30# Set definitions for mbed TLS library and Measured Boot driver 31$(eval $(call add_defines,\ 32 $(sort \ 33 MBEDTLS_MD_ID \ 34 TPM_ALG_ID \ 35 TCG_DIGEST_SIZE \ 36 EVENT_LOG_SIZE \ 37 EVENT_LOG_LEVEL \ 38))) 39 40ifeq (${HASH_ALG}, sha256) 41ifneq (${TPM_HASH_ALG}, sha256) 42$(eval $(call add_define,MBEDTLS_SHA512_C)) 43endif 44endif 45 46MEASURED_BOOT_SRC_DIR := drivers/measured_boot/ 47 48MEASURED_BOOT_SOURCES := ${MEASURED_BOOT_SRC_DIR}measured_boot.c \ 49 ${MEASURED_BOOT_SRC_DIR}event_log.c \ 50 ${MEASURED_BOOT_SRC_DIR}event_print.c 51 52BL2_SOURCES += ${MEASURED_BOOT_SOURCES} 53