1 /*
2  * Copyright (c) 2022, Arm Limited. All rights reserved.
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  */
6 
7 #include <stdint.h>
8 
9 #include <drivers/arm/rss_comms.h>
10 #include <drivers/measured_boot/rss/rss_measured_boot.h>
11 #include <lib/psa/measured_boot.h>
12 
13 #include <plat/arm/common/plat_arm.h>
14 #include <platform_def.h>
15 
16 /* Table with platform specific image IDs and metadata. Intentionally not a
17  * const struct, some members might set by bootloaders during trusted boot.
18  */
19 struct rss_mboot_metadata tc_rss_mboot_metadata[] = {
20 	{
21 		.id = FW_CONFIG_ID,
22 		.slot = U(6),
23 		.signer_id_size = SIGNER_ID_MIN_SIZE,
24 		.sw_type = RSS_MBOOT_FW_CONFIG_STRING,
25 		.lock_measurement = true },
26 	{
27 		.id = TB_FW_CONFIG_ID,
28 		.slot = U(7),
29 		.signer_id_size = SIGNER_ID_MIN_SIZE,
30 		.sw_type = RSS_MBOOT_TB_FW_CONFIG_STRING,
31 		.lock_measurement = true },
32 	{
33 		.id = BL2_IMAGE_ID,
34 		.slot = U(8),
35 		.signer_id_size = SIGNER_ID_MIN_SIZE,
36 		.sw_type = RSS_MBOOT_BL2_STRING,
37 		.lock_measurement = true },
38 
39 	{
40 		.id = RSS_MBOOT_INVALID_ID }
41 };
42 
bl1_plat_mboot_init(void)43 void bl1_plat_mboot_init(void)
44 {
45 	/* Initialize the communication channel between AP and RSS */
46 	(void)rss_comms_init(PLAT_RSS_AP_SND_MHU_BASE,
47 			     PLAT_RSS_AP_RCV_MHU_BASE);
48 
49 	rss_measured_boot_init();
50 }
51 
bl1_plat_mboot_finish(void)52 void bl1_plat_mboot_finish(void)
53 {
54 	/* Nothing to do. */
55 }
56