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