Tamas Ban | ede4f05 | 2022-09-16 16:26:15 +0200 | [diff] [blame] | 1 | /* |
Manish V Badarkhe | f7ca31b | 2023-06-16 13:04:23 +0100 | [diff] [blame] | 2 | * Copyright (c) 2022-2023, Arm Limited. All rights reserved. |
Tamas Ban | ede4f05 | 2022-09-16 16:26:15 +0200 | [diff] [blame] | 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> |
Manish V Badarkhe | 4a2cc6b | 2023-07-12 10:21:38 +0100 | [diff] [blame] | 12 | #include <tools_share/tbbr_oid.h> |
Tamas Ban | ede4f05 | 2022-09-16 16:26:15 +0200 | [diff] [blame] | 13 | |
| 14 | #include <plat/common/common_def.h> |
| 15 | #include <platform_def.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 rss_mboot_metadata tc_rss_mboot_metadata[] = { |
| 21 | { |
| 22 | .id = BL31_IMAGE_ID, |
| 23 | .slot = U(9), |
| 24 | .signer_id_size = SIGNER_ID_MIN_SIZE, |
| 25 | .sw_type = RSS_MBOOT_BL31_STRING, |
Manish V Badarkhe | 4a2cc6b | 2023-07-12 10:21:38 +0100 | [diff] [blame] | 26 | .pk_oid = BL31_IMAGE_KEY_OID, |
Tamas Ban | ede4f05 | 2022-09-16 16:26:15 +0200 | [diff] [blame] | 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 = RSS_MBOOT_HW_CONFIG_STRING, |
Manish V Badarkhe | 4a2cc6b | 2023-07-12 10:21:38 +0100 | [diff] [blame] | 33 | .pk_oid = HW_CONFIG_KEY_OID, |
Tamas Ban | ede4f05 | 2022-09-16 16:26:15 +0200 | [diff] [blame] | 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 = RSS_MBOOT_SOC_FW_CONFIG_STRING, |
Manish V Badarkhe | 4a2cc6b | 2023-07-12 10:21:38 +0100 | [diff] [blame] | 40 | .pk_oid = SOC_FW_CONFIG_KEY_OID, |
Tamas Ban | ede4f05 | 2022-09-16 16:26:15 +0200 | [diff] [blame] | 41 | .lock_measurement = true }, |
| 42 | { |
| 43 | .id = RSS_MBOOT_INVALID_ID } |
| 44 | }; |
| 45 | |
| 46 | void bl2_plat_mboot_init(void) |
| 47 | { |
| 48 | /* Initialize the communication channel between AP and RSS */ |
| 49 | (void)rss_comms_init(PLAT_RSS_AP_SND_MHU_BASE, |
| 50 | PLAT_RSS_AP_RCV_MHU_BASE); |
| 51 | |
Manish V Badarkhe | f7ca31b | 2023-06-16 13:04:23 +0100 | [diff] [blame] | 52 | rss_measured_boot_init(tc_rss_mboot_metadata); |
Tamas Ban | ede4f05 | 2022-09-16 16:26:15 +0200 | [diff] [blame] | 53 | } |
| 54 | |
| 55 | void bl2_plat_mboot_finish(void) |
| 56 | { |
| 57 | /* Nothing to do. */ |
| 58 | } |