xref: /rk3399_ARM-atf/plat/arm/board/fvp/fvp_common_measured_boot.c (revision 68bb3e836e93b271f9f1c05787025dd3f04dd788)
1 /*
2  * Copyright (c) 2021-2023, 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 <drivers/measured_boot/rss/rss_measured_boot.h>
13 #include <plat/arm/common/plat_arm.h>
14 #include <plat/common/platform.h>
15 
16 extern event_log_metadata_t fvp_event_log_metadata[];
17 extern struct rss_mboot_metadata fvp_rss_mboot_metadata[];
18 
19 int plat_mboot_measure_image(unsigned int image_id, image_info_t *image_data)
20 {
21 	int err;
22 
23 	/* Calculate image hash and record data in Event Log */
24 	err = event_log_measure_and_record(image_data->image_base,
25 					   image_data->image_size,
26 					   image_id,
27 					   fvp_event_log_metadata);
28 	if (err != 0) {
29 		ERROR("%s%s image id %u (%i)\n",
30 		      "Failed to ", "record in event log", image_id, err);
31 		return err;
32 	}
33 
34 	return 0;
35 }
36 
37 int plat_mboot_measure_key(const void *pk_oid, const void *pk_ptr,
38 			   size_t pk_len)
39 {
40 	return 0;
41 }
42