| 1 |
/* |
| 2 |
* Copyright (c) 2024, 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/arm/rse_comms.h> |
| 10 |
#include <drivers/measured_boot/rse/rse_measured_boot.h> |
| 11 |
#include <lib/psa/measured_boot.h> |
| 12 |
#include <plat/common/common_def.h> |
| 13 |
#include <platform_def.h> |
| 14 |
|
| 15 |
#include <nrd_plat.h> |
| 16 |
#include <rdv3_rse_comms.h> |
| 17 |
|
| 18 |
/* |
| 19 |
* Platform specific table with image IDs and metadata. Intentionally not a |
| 20 |
* const struct, some members might set by bootloaders during trusted boot. |
| 21 |
*/ |
| 22 |
struct rse_mboot_metadata rdv3_rse_mboot_metadata[] = { |
| 23 |
{ |
| 24 |
.id = BL31_IMAGE_ID, |
| 25 |
.slot = U(11), |
| 26 |
.signer_id_size = SIGNER_ID_MIN_SIZE, |
| 27 |
.sw_type = MBOOT_BL31_IMAGE_STRING, |
| 28 |
.lock_measurement = false |
| 29 |
}, |
| 30 |
{ |
| 31 |
.id = HW_CONFIG_ID, |
| 32 |
.slot = U(12), |
| 33 |
.signer_id_size = SIGNER_ID_MIN_SIZE, |
| 34 |
.sw_type = MBOOT_HW_CONFIG_STRING, |
| 35 |
.lock_measurement = false |
| 36 |
}, |
| 37 |
{ |
| 38 |
.id = SOC_FW_CONFIG_ID, |
| 39 |
.slot = U(13), |
| 40 |
.signer_id_size = SIGNER_ID_MIN_SIZE, |
| 41 |
.sw_type = MBOOT_SOC_FW_CONFIG_STRING, |
| 42 |
.lock_measurement = false |
| 43 |
}, |
| 44 |
#if ENABLE_RME |
| 45 |
{ |
| 46 |
.id = RMM_IMAGE_ID, |
| 47 |
.slot = U(14), |
| 48 |
.signer_id_size = SIGNER_ID_MIN_SIZE, |
| 49 |
.sw_type = MBOOT_RMM_IMAGE_STRING, |
| 50 |
.lock_measurement = false |
| 51 |
}, |
| 52 |
#endif /* ENABLE_RME */ |
| 53 |
{ |
| 54 |
.id = RSE_MBOOT_INVALID_ID |
| 55 |
} |
| 56 |
}; |
| 57 |
|
| 58 |
void bl2_plat_mboot_init(void) |
| 59 |
{ |
| 60 |
/* Initialize the communication channel between AP and RSE */ |
| 61 |
(void)plat_rse_comms_init(); |
| 62 |
|
| 63 |
rse_measured_boot_init(rdv3_rse_mboot_metadata); |
| 64 |
} |
| 65 |
|
| 66 |
void bl2_plat_mboot_finish(void) |
| 67 |
{ |
| 68 |
/* Nothing to do. */ |
| 69 |
} |