1# 2# Copyright (c) 2020-2025, Arm Limited. All rights reserved. 3# 4# SPDX-License-Identifier: BSD-3-Clause 5# 6 7EVENT_LOG_SRC_DIR := drivers/measured_boot/event_log/ 8 9# Default log level to dump the event log (LOG_LEVEL_INFO) 10EVENT_LOG_LEVEL ?= 40 11 12# When using a TPM, adopt the TPM's hash algorithm for 13# measurements through the Event Log mechanism, ensuring 14# the TPM uses the same algorithm for measurements and 15# extends the PCR accordingly, allowing for comparison 16# between PCR value and Event Log measurements required 17# for attestation. 18ifdef MBOOT_TPM_HASH_ALG 19 MBOOT_EL_HASH_ALG := ${MBOOT_TPM_HASH_ALG} 20else 21 MBOOT_EL_HASH_ALG := sha256 22endif 23 24# Measured Boot hash algorithm. 25# SHA-256 (or stronger) is required for all devices that are TPM 2.0 compliant. 26ifeq (${MBOOT_EL_HASH_ALG}, sha512) 27 TPM_ALG_ID := TPM_ALG_SHA512 28 TCG_DIGEST_SIZE := 64U 29else ifeq (${MBOOT_EL_HASH_ALG}, sha384) 30 TPM_ALG_ID := TPM_ALG_SHA384 31 TCG_DIGEST_SIZE := 48U 32else 33 TPM_ALG_ID := TPM_ALG_SHA256 34 TCG_DIGEST_SIZE := 32U 35endif #MBOOT_EL_HASH_ALG 36 37# Set definitions for Measured Boot driver. 38$(eval $(call add_defines,\ 39 $(sort \ 40 TPM_ALG_ID \ 41 TCG_DIGEST_SIZE \ 42 EVENT_LOG_LEVEL \ 43))) 44 45INCLUDES += -Iinclude/drivers/measured_boot/event_log \ 46 -Iinclude/drivers/auth 47 48EVENT_LOG_SOURCES := ${EVENT_LOG_SRC_DIR}event_log.c \ 49 ${EVENT_LOG_SRC_DIR}event_print.c 50 51 52ifeq (${TRANSFER_LIST}, 1) 53EVENT_LOG_SOURCES += ${EVENT_LOG_SRC_DIR}/event_handoff.c 54endif 55