xref: /rk3399_ARM-atf/plat/arm/board/tc/tc_bl2_measured_boot.c (revision 52e486f6a6192bd18d36cdcbc35c59092eefc810)
1 /*
2  * Copyright (c) 2022-2025, Arm Limited and Contributors. All rights reserved.
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  */
6 
7 #include <stdint.h>
8 
9 #include <drivers/measured_boot/metadata.h>
10 #include <drivers/measured_boot/rse/rse_measured_boot.h>
11 #include <tools_share/tbbr_oid.h>
12 
13 #include <plat/common/common_def.h>
14 #include <platform_def.h>
15 #include <tc_rse_comms.h>
16 
17 /* TC specific table with image IDs and metadata. Intentionally not a
18  * const struct, some members might set by bootloaders during trusted boot.
19  */
20 struct rse_mboot_metadata tc_rse_mboot_metadata[] = {
21 	{
22 		.id = BL31_IMAGE_ID,
23 		.slot = U(9),
24 		.signer_id_size = SIGNER_ID_MIN_SIZE,
25 		.sw_type = MBOOT_BL31_IMAGE_STRING,
26 		.pk_oid = BL31_IMAGE_KEY_OID,
27 		.lock_measurement = true },
28 	{
29 		.id = HW_CONFIG_ID,
30 		.slot = U(10),
31 		.signer_id_size = SIGNER_ID_MIN_SIZE,
32 		.sw_type = MBOOT_HW_CONFIG_STRING,
33 		.pk_oid = HW_CONFIG_KEY_OID,
34 		.lock_measurement = true },
35 	{
36 		.id = SOC_FW_CONFIG_ID,
37 		.slot = U(11),
38 		.signer_id_size = SIGNER_ID_MIN_SIZE,
39 		.sw_type = MBOOT_SOC_FW_CONFIG_STRING,
40 		.pk_oid = SOC_FW_CONFIG_KEY_OID,
41 		.lock_measurement = true },
42 	{
43 		.id = SCP_BL2_IMAGE_ID,
44 		.slot = U(12),
45 		.signer_id_size = SIGNER_ID_MIN_SIZE,
46 		.sw_type = MBOOT_SCP_BL2_IMAGE_STRING,
47 		.pk_oid = SCP_BL2_IMAGE_KEY_OID,
48 		.lock_measurement = true },
49 	{
50 		.id = RSE_MBOOT_INVALID_ID }
51 };
52 
53 void bl2_plat_mboot_init(void)
54 {
55 	/* Initialize the communication channel between AP and RSE */
56 	(void)plat_rse_comms_init();
57 
58 	rse_measured_boot_init(tc_rse_mboot_metadata);
59 }
60 
61 void bl2_plat_mboot_finish(void)
62 {
63 	/* Nothing to do. */
64 }
65