TF-A: Add support for Measured Boot driver in BL1 and BL2

This patch adds support for Measured Boot driver functionality
in BL1 and BL2 code.

Change-Id: I7239a94c3e32b0a3e9e73768a0140e0b52ab0361
Signed-off-by: Alexei Fedorov <Alexei.Fedorov@arm.com>
This commit is contained in:
Alexei Fedorov 2020-07-13 14:06:47 +01:00
parent d686fa3b97
commit 3f498b0dc2
2 changed files with 29 additions and 4 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2013-2019, ARM Limited and Contributors. All rights reserved.
* Copyright (c) 2013-2020, ARM Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@ -14,6 +14,9 @@
#include <common/debug.h>
#include <drivers/auth/auth_mod.h>
#include <drivers/console.h>
#if MEASURED_BOOT
#include <drivers/measured_boot/measured_boot.h>
#endif
#include <lib/extensions/pauth.h>
#include <plat/common/platform.h>
@ -88,14 +91,25 @@ void bl2_main(void)
#if TRUSTED_BOARD_BOOT
/* Initialize authentication module */
auth_mod_init();
#if MEASURED_BOOT
/* Initialize measured boot module */
measured_boot_init();
#endif /* MEASURED_BOOT */
#endif /* TRUSTED_BOARD_BOOT */
/* initialize boot source */
/* Initialize boot source */
bl2_plat_preload_setup();
/* Load the subsequent bootloader images. */
next_bl_ep_info = bl2_load_images();
#if MEASURED_BOOT
/* Finalize measured boot */
measured_boot_finish();
#endif /* MEASURED_BOOT */
#if !BL2_AT_EL3
#ifndef __aarch64__
/*

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015-2018, ARM Limited and Contributors. All rights reserved.
* Copyright (c) 2015-2020, ARM Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@ -27,7 +27,9 @@
#pragma weak bl1_plat_fwu_done
#pragma weak bl1_plat_handle_pre_image_load
#pragma weak bl1_plat_handle_post_image_load
#if MEASURED_BOOT
#pragma weak bl1_plat_set_bl2_hash
#endif
unsigned int bl1_plat_get_next_image_id(void)
{
@ -116,3 +118,12 @@ int bl1_plat_handle_post_image_load(unsigned int image_id)
(void *) bl2_tzram_layout);
return 0;
}
#if MEASURED_BOOT
/*
* Calculates and writes BL2 hash data to TB_FW_CONFIG DTB.
*/
void bl1_plat_set_bl2_hash(const image_desc_t *image_desc)
{
}
#endif