xref: /rk3399_ARM-atf/drivers/measured_boot/event_log/event_log.mk (revision a5645148a6f1805d85a0f6167e3d09b8d18cc7eb)
1#
2# Copyright (c) 2020-2021, 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.
11# SHA-256 (or stronger) is required for all devices that are TPM 2.0 compliant.
12TPM_HASH_ALG			:=	sha256
13
14ifeq (${TPM_HASH_ALG}, sha512)
15    TPM_ALG_ID			:=	TPM_ALG_SHA512
16    TCG_DIGEST_SIZE		:=	64U
17else ifeq (${TPM_HASH_ALG}, sha384)
18    TPM_ALG_ID			:=	TPM_ALG_SHA384
19    TCG_DIGEST_SIZE		:=	48U
20else
21    TPM_ALG_ID			:=	TPM_ALG_SHA256
22    TCG_DIGEST_SIZE		:=	32U
23endif #TPM_HASH_ALG
24
25# Set definitions for Measured Boot driver.
26$(eval $(call add_defines,\
27    $(sort \
28        TPM_ALG_ID \
29        TCG_DIGEST_SIZE \
30        EVENT_LOG_LEVEL \
31)))
32
33MEASURED_BOOT_SRC_DIR	:= drivers/measured_boot/event_log/
34
35MEASURED_BOOT_SOURCES	:= ${MEASURED_BOOT_SRC_DIR}event_log.c		\
36			   ${MEASURED_BOOT_SRC_DIR}event_print.c
37
38BL2_SOURCES		+= ${MEASURED_BOOT_SOURCES}
39BL1_SOURCES             += ${MEASURED_BOOT_SOURCES}
40