1 /*
2  * Copyright (c) 2021, Arm Limited. All rights reserved.
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  */
6 
7 #include <assert.h>
8 #include <stdint.h>
9 
10 #include <common/desc_image_load.h>
11 #include <drivers/measured_boot/event_log/event_log.h>
12 #include <plat/arm/common/plat_arm.h>
13 #include <plat/common/platform.h>
14 
15 extern event_log_metadata_t fvp_event_log_metadata[];
16 
plat_event_log_get_metadata(void)17 const event_log_metadata_t *plat_event_log_get_metadata(void)
18 {
19 	return fvp_event_log_metadata;
20 }
21 
plat_mboot_measure_image(unsigned int image_id,image_info_t * image_data)22 int plat_mboot_measure_image(unsigned int image_id, image_info_t *image_data)
23 {
24 	/* Calculate image hash and record data in Event Log */
25 	int err = event_log_measure_and_record(image_data->image_base,
26 					       image_data->image_size,
27 					       image_id);
28 	if (err != 0) {
29 		ERROR("%s%s image id %u (%i)\n",
30 		      "Failed to ", "record", image_id, err);
31 		return err;
32 	}
33 
34 	return 0;
35 }
36