Alexei Fedorov | 71d81dc | 2020-07-13 13:58:06 +0100 | [diff] [blame] | 1 | # |
Manish V Badarkhe | f9c366c | 2022-01-18 22:40:17 +0000 | [diff] [blame] | 2 | # Copyright (c) 2020-2022, Arm Limited. All rights reserved. |
Alexei Fedorov | 71d81dc | 2020-07-13 13:58:06 +0100 | [diff] [blame] | 3 | # |
| 4 | # SPDX-License-Identifier: BSD-3-Clause |
| 5 | # |
| 6 | |
Javier Almansa Sobrino | 0d1f6b1 | 2020-09-18 16:47:07 +0100 | [diff] [blame] | 7 | # Default log level to dump the event log (LOG_LEVEL_INFO) |
| 8 | EVENT_LOG_LEVEL ?= 40 |
| 9 | |
Sandrine Bailleux | 3c2db6f | 2021-07-07 14:47:08 +0200 | [diff] [blame] | 10 | # TPM hash algorithm. |
| 11 | # SHA-256 (or stronger) is required for all devices that are TPM 2.0 compliant. |
Alexei Fedorov | 71d81dc | 2020-07-13 13:58:06 +0100 | [diff] [blame] | 12 | TPM_HASH_ALG := sha256 |
| 13 | |
| 14 | ifeq (${TPM_HASH_ALG}, sha512) |
Alexei Fedorov | 71d81dc | 2020-07-13 13:58:06 +0100 | [diff] [blame] | 15 | TPM_ALG_ID := TPM_ALG_SHA512 |
| 16 | TCG_DIGEST_SIZE := 64U |
| 17 | else ifeq (${TPM_HASH_ALG}, sha384) |
Alexei Fedorov | 71d81dc | 2020-07-13 13:58:06 +0100 | [diff] [blame] | 18 | TPM_ALG_ID := TPM_ALG_SHA384 |
| 19 | TCG_DIGEST_SIZE := 48U |
| 20 | else |
Alexei Fedorov | 71d81dc | 2020-07-13 13:58:06 +0100 | [diff] [blame] | 21 | TPM_ALG_ID := TPM_ALG_SHA256 |
| 22 | TCG_DIGEST_SIZE := 32U |
Manish V Badarkhe | e112a5a | 2021-10-06 23:41:50 +0100 | [diff] [blame] | 23 | endif #TPM_HASH_ALG |
Alexei Fedorov | 71d81dc | 2020-07-13 13:58:06 +0100 | [diff] [blame] | 24 | |
Manish V Badarkhe | e112a5a | 2021-10-06 23:41:50 +0100 | [diff] [blame] | 25 | # Set definitions for Measured Boot driver. |
Leonardo Sandoval | 65fca7c | 2020-09-10 12:18:27 -0500 | [diff] [blame] | 26 | $(eval $(call add_defines,\ |
| 27 | $(sort \ |
Leonardo Sandoval | 65fca7c | 2020-09-10 12:18:27 -0500 | [diff] [blame] | 28 | TPM_ALG_ID \ |
| 29 | TCG_DIGEST_SIZE \ |
Javier Almansa Sobrino | 0d1f6b1 | 2020-09-18 16:47:07 +0100 | [diff] [blame] | 30 | EVENT_LOG_LEVEL \ |
Leonardo Sandoval | 65fca7c | 2020-09-10 12:18:27 -0500 | [diff] [blame] | 31 | ))) |
Alexei Fedorov | 71d81dc | 2020-07-13 13:58:06 +0100 | [diff] [blame] | 32 | |
Manish V Badarkhe | f9c366c | 2022-01-18 22:40:17 +0000 | [diff] [blame] | 33 | EVENT_LOG_SRC_DIR := drivers/measured_boot/event_log/ |
Alexei Fedorov | 71d81dc | 2020-07-13 13:58:06 +0100 | [diff] [blame] | 34 | |
Manish V Badarkhe | f9c366c | 2022-01-18 22:40:17 +0000 | [diff] [blame] | 35 | EVENT_LOG_SOURCES := ${EVENT_LOG_SRC_DIR}event_log.c \ |
| 36 | ${EVENT_LOG_SRC_DIR}event_print.c |