1d89bec83SSandrine Bailleux# 236e3d877SAbhi.Singh# Copyright (c) 2020-2025, Arm Limited. All rights reserved. 3d89bec83SSandrine Bailleux# 4d89bec83SSandrine Bailleux# SPDX-License-Identifier: BSD-3-Clause 5d89bec83SSandrine Bailleux# 6d89bec83SSandrine Bailleux 7*cb03020eSHarrison MutaiEVENT_LOG_SRC_DIR := drivers/measured_boot/event_log/ 8*cb03020eSHarrison Mutai 9d89bec83SSandrine Bailleux# Default log level to dump the event log (LOG_LEVEL_INFO) 10d89bec83SSandrine BailleuxEVENT_LOG_LEVEL ?= 40 11d89bec83SSandrine Bailleux 1236e3d877SAbhi.Singh# When using a TPM, adopt the TPM's hash algorithm for 1336e3d877SAbhi.Singh# measurements through the Event Log mechanism, ensuring 1436e3d877SAbhi.Singh# the TPM uses the same algorithm for measurements and 1536e3d877SAbhi.Singh# extends the PCR accordingly, allowing for comparison 1636e3d877SAbhi.Singh# between PCR value and Event Log measurements required 1736e3d877SAbhi.Singh# for attestation. 1836e3d877SAbhi.Singhifdef MBOOT_TPM_HASH_ALG 1936e3d877SAbhi.Singh MBOOT_EL_HASH_ALG := ${MBOOT_TPM_HASH_ALG} 2078da42a5Slaurenw-armelse 2178da42a5Slaurenw-arm MBOOT_EL_HASH_ALG := sha256 2278da42a5Slaurenw-armendif 23d89bec83SSandrine Bailleux 2436e3d877SAbhi.Singh# Measured Boot hash algorithm. 2536e3d877SAbhi.Singh# SHA-256 (or stronger) is required for all devices that are TPM 2.0 compliant. 2678da42a5Slaurenw-armifeq (${MBOOT_EL_HASH_ALG}, sha512) 27d89bec83SSandrine Bailleux TPM_ALG_ID := TPM_ALG_SHA512 28d89bec83SSandrine Bailleux TCG_DIGEST_SIZE := 64U 2978da42a5Slaurenw-armelse ifeq (${MBOOT_EL_HASH_ALG}, sha384) 30d89bec83SSandrine Bailleux TPM_ALG_ID := TPM_ALG_SHA384 31d89bec83SSandrine Bailleux TCG_DIGEST_SIZE := 48U 32d89bec83SSandrine Bailleuxelse 33d89bec83SSandrine Bailleux TPM_ALG_ID := TPM_ALG_SHA256 34d89bec83SSandrine Bailleux TCG_DIGEST_SIZE := 32U 3578da42a5Slaurenw-armendif #MBOOT_EL_HASH_ALG 36d89bec83SSandrine Bailleux 3714db963fSManish V Badarkhe# Set definitions for Measured Boot driver. 38d89bec83SSandrine Bailleux$(eval $(call add_defines,\ 39d89bec83SSandrine Bailleux $(sort \ 40d89bec83SSandrine Bailleux TPM_ALG_ID \ 41d89bec83SSandrine Bailleux TCG_DIGEST_SIZE \ 42d89bec83SSandrine Bailleux EVENT_LOG_LEVEL \ 43d89bec83SSandrine Bailleux))) 44d89bec83SSandrine Bailleux 45*cb03020eSHarrison MutaiINCLUDES += -Iinclude/drivers/measured_boot/event_log \ 46*cb03020eSHarrison Mutai -Iinclude/drivers/auth 47d89bec83SSandrine Bailleux 48992d97c4SManish V BadarkheEVENT_LOG_SOURCES := ${EVENT_LOG_SRC_DIR}event_log.c \ 49992d97c4SManish V Badarkhe ${EVENT_LOG_SRC_DIR}event_print.c 50