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 | |
laurenw-arm | 7834aa0 | 2022-05-31 16:39:09 -0500 | [diff] [blame] | 10 | # Measured Boot hash algorithm. |
Sandrine Bailleux | 3c2db6f | 2021-07-07 14:47:08 +0200 | [diff] [blame] | 11 | # SHA-256 (or stronger) is required for all devices that are TPM 2.0 compliant. |
laurenw-arm | 7834aa0 | 2022-05-31 16:39:09 -0500 | [diff] [blame] | 12 | ifdef TPM_HASH_ALG |
| 13 | $(warning "TPM_HASH_ALG is deprecated. Please use MBOOT_EL_HASH_ALG instead.") |
| 14 | MBOOT_EL_HASH_ALG := ${TPM_HASH_ALG} |
| 15 | else |
| 16 | MBOOT_EL_HASH_ALG := sha256 |
| 17 | endif |
Alexei Fedorov | 71d81dc | 2020-07-13 13:58:06 +0100 | [diff] [blame] | 18 | |
laurenw-arm | 7834aa0 | 2022-05-31 16:39:09 -0500 | [diff] [blame] | 19 | ifeq (${MBOOT_EL_HASH_ALG}, sha512) |
Alexei Fedorov | 71d81dc | 2020-07-13 13:58:06 +0100 | [diff] [blame] | 20 | TPM_ALG_ID := TPM_ALG_SHA512 |
| 21 | TCG_DIGEST_SIZE := 64U |
laurenw-arm | 7834aa0 | 2022-05-31 16:39:09 -0500 | [diff] [blame] | 22 | else ifeq (${MBOOT_EL_HASH_ALG}, sha384) |
Alexei Fedorov | 71d81dc | 2020-07-13 13:58:06 +0100 | [diff] [blame] | 23 | TPM_ALG_ID := TPM_ALG_SHA384 |
| 24 | TCG_DIGEST_SIZE := 48U |
| 25 | else |
Alexei Fedorov | 71d81dc | 2020-07-13 13:58:06 +0100 | [diff] [blame] | 26 | TPM_ALG_ID := TPM_ALG_SHA256 |
| 27 | TCG_DIGEST_SIZE := 32U |
laurenw-arm | 7834aa0 | 2022-05-31 16:39:09 -0500 | [diff] [blame] | 28 | endif #MBOOT_EL_HASH_ALG |
Alexei Fedorov | 71d81dc | 2020-07-13 13:58:06 +0100 | [diff] [blame] | 29 | |
Manish V Badarkhe | e112a5a | 2021-10-06 23:41:50 +0100 | [diff] [blame] | 30 | # Set definitions for Measured Boot driver. |
Leonardo Sandoval | 65fca7c | 2020-09-10 12:18:27 -0500 | [diff] [blame] | 31 | $(eval $(call add_defines,\ |
| 32 | $(sort \ |
Leonardo Sandoval | 65fca7c | 2020-09-10 12:18:27 -0500 | [diff] [blame] | 33 | TPM_ALG_ID \ |
| 34 | TCG_DIGEST_SIZE \ |
Javier Almansa Sobrino | 0d1f6b1 | 2020-09-18 16:47:07 +0100 | [diff] [blame] | 35 | EVENT_LOG_LEVEL \ |
Leonardo Sandoval | 65fca7c | 2020-09-10 12:18:27 -0500 | [diff] [blame] | 36 | ))) |
Alexei Fedorov | 71d81dc | 2020-07-13 13:58:06 +0100 | [diff] [blame] | 37 | |
Manish V Badarkhe | f9c366c | 2022-01-18 22:40:17 +0000 | [diff] [blame] | 38 | EVENT_LOG_SRC_DIR := drivers/measured_boot/event_log/ |
Alexei Fedorov | 71d81dc | 2020-07-13 13:58:06 +0100 | [diff] [blame] | 39 | |
Manish V Badarkhe | f9c366c | 2022-01-18 22:40:17 +0000 | [diff] [blame] | 40 | EVENT_LOG_SOURCES := ${EVENT_LOG_SRC_DIR}event_log.c \ |
| 41 | ${EVENT_LOG_SRC_DIR}event_print.c |