blob: b7aa48bb976934261ad8c28a1f07694231e93f24 [file] [log] [blame]
Alexei Fedorov71d81dc2020-07-13 13:58:06 +01001#
2# Copyright (c) 2020, Arm Limited. All rights reserved.
3#
4# SPDX-License-Identifier: BSD-3-Clause
5#
6
7# TPM hash algorithm
8TPM_HASH_ALG := sha256
9
10ifeq (${TPM_HASH_ALG}, sha512)
11 MBEDTLS_MD_ID := MBEDTLS_MD_SHA512
12 TPM_ALG_ID := TPM_ALG_SHA512
13 TCG_DIGEST_SIZE := 64U
14else ifeq (${TPM_HASH_ALG}, sha384)
15 MBEDTLS_MD_ID := MBEDTLS_MD_SHA384
16 TPM_ALG_ID := TPM_ALG_SHA384
17 TCG_DIGEST_SIZE := 48U
18else
19 MBEDTLS_MD_ID := MBEDTLS_MD_SHA256
20 TPM_ALG_ID := TPM_ALG_SHA256
21 TCG_DIGEST_SIZE := 32U
22endif
23
24# Event Log length in bytes
25EVENT_LOG_SIZE := 1024
26
27# Set definitions for mbed TLS library and Measured Boot driver
Leonardo Sandoval65fca7c2020-09-10 12:18:27 -050028$(eval $(call add_defines,\
29 $(sort \
30 MBEDTLS_MD_ID \
31 TPM_ALG_ID \
32 TCG_DIGEST_SIZE \
33 EVENT_LOG_SIZE \
34)))
Alexei Fedorov71d81dc2020-07-13 13:58:06 +010035
36ifeq (${HASH_ALG}, sha256)
37ifneq (${TPM_HASH_ALG}, sha256)
38$(eval $(call add_define,MBEDTLS_SHA512_C))
39endif
40endif
41
42MEASURED_BOOT_SRC_DIR := drivers/measured_boot/
43
44MEASURED_BOOT_SOURCES := ${MEASURED_BOOT_SRC_DIR}measured_boot.c \
45 ${MEASURED_BOOT_SRC_DIR}event_log.c \
46 ${MEASURED_BOOT_SRC_DIR}event_print.c
47
48BL2_SOURCES += ${MEASURED_BOOT_SOURCES}