xref: /rk3399_ARM-atf/drivers/measured_boot/event_log/event_log.mk (revision 78da42a5f1f33ca55019dddf0890c0db1c2fa05f)
1d89bec83SSandrine Bailleux#
2992d97c4SManish V Badarkhe# Copyright (c) 2020-2022, Arm Limited. All rights reserved.
3d89bec83SSandrine Bailleux#
4d89bec83SSandrine Bailleux# SPDX-License-Identifier: BSD-3-Clause
5d89bec83SSandrine Bailleux#
6d89bec83SSandrine Bailleux
7d89bec83SSandrine Bailleux# Default log level to dump the event log (LOG_LEVEL_INFO)
8d89bec83SSandrine BailleuxEVENT_LOG_LEVEL         ?= 40
9d89bec83SSandrine Bailleux
10*78da42a5Slaurenw-arm# Measured Boot hash algorithm.
11d89bec83SSandrine Bailleux# SHA-256 (or stronger) is required for all devices that are TPM 2.0 compliant.
12*78da42a5Slaurenw-armifdef TPM_HASH_ALG
13*78da42a5Slaurenw-arm    $(warning "TPM_HASH_ALG is deprecated. Please use MBOOT_EL_HASH_ALG instead.")
14*78da42a5Slaurenw-arm    MBOOT_EL_HASH_ALG		:=	${TPM_HASH_ALG}
15*78da42a5Slaurenw-armelse
16*78da42a5Slaurenw-arm    MBOOT_EL_HASH_ALG		:=	sha256
17*78da42a5Slaurenw-armendif
18d89bec83SSandrine Bailleux
19*78da42a5Slaurenw-armifeq (${MBOOT_EL_HASH_ALG}, sha512)
20d89bec83SSandrine Bailleux    TPM_ALG_ID			:=	TPM_ALG_SHA512
21d89bec83SSandrine Bailleux    TCG_DIGEST_SIZE		:=	64U
22*78da42a5Slaurenw-armelse ifeq (${MBOOT_EL_HASH_ALG}, sha384)
23d89bec83SSandrine Bailleux    TPM_ALG_ID			:=	TPM_ALG_SHA384
24d89bec83SSandrine Bailleux    TCG_DIGEST_SIZE		:=	48U
25d89bec83SSandrine Bailleuxelse
26d89bec83SSandrine Bailleux    TPM_ALG_ID			:=	TPM_ALG_SHA256
27d89bec83SSandrine Bailleux    TCG_DIGEST_SIZE		:=	32U
28*78da42a5Slaurenw-armendif #MBOOT_EL_HASH_ALG
29d89bec83SSandrine Bailleux
3014db963fSManish V Badarkhe# Set definitions for Measured Boot driver.
31d89bec83SSandrine Bailleux$(eval $(call add_defines,\
32d89bec83SSandrine Bailleux    $(sort \
33d89bec83SSandrine Bailleux        TPM_ALG_ID \
34d89bec83SSandrine Bailleux        TCG_DIGEST_SIZE \
35d89bec83SSandrine Bailleux        EVENT_LOG_LEVEL \
36d89bec83SSandrine Bailleux)))
37d89bec83SSandrine Bailleux
38992d97c4SManish V BadarkheEVENT_LOG_SRC_DIR	:= drivers/measured_boot/event_log/
39d89bec83SSandrine Bailleux
40992d97c4SManish V BadarkheEVENT_LOG_SOURCES	:= ${EVENT_LOG_SRC_DIR}event_log.c		\
41992d97c4SManish V Badarkhe			   ${EVENT_LOG_SRC_DIR}event_print.c
42