Merge changes I712712d7,I1932500e,I75dda77e,I12f3b8a3,Ia72e5900 into integration

* changes:
  refactor(rse)!: remove rse_comms_init
  refactor(arm): switch to rse_mbx_init
  refactor(rse): put MHU code in a dedicated file
  refactor(tc): add plat_rse_comms_init
  refactor(arm)!: rename PLAT_MHU_VERSION flag
This commit is contained in:
Manish V Badarkhe 2025-02-13 16:03:10 +01:00 committed by TrustedFirmware Code Review
commit e0be63c880
21 changed files with 206 additions and 96 deletions

View file

@ -25,9 +25,15 @@ RSE communication layer
-----------------------
The communication between RSE and other subsystems are primarily relying on the
Message Handling Unit (MHU) module. The number of MHU interfaces between RSE
and other cores is IMPDEF. Besides MHU other modules also could take part in
the communication. RSE is capable of mapping the AP memory to its address space.
Message Handling Unit (MHU) module.
However, this is possible to use this communication protocol with a different
mailbox than MHU, by setting the flag ``PLAT_MHU=NO_MHU`` and implementing the
APIs given in the file: ``include/drivers/arm/rse_comms.h``.
The number of MHU interfaces between RSE and other cores is IMPDEF. Besides MHU
other modules also could take part in the communication. RSE is capable of
mapping the AP memory to its address space.
Thereby either RSE core itself or a DMA engine if it is present, can move the
data between memory belonging to RSE or AP. In this way, a bigger amount of data
can be transferred in a short time.
@ -812,3 +818,4 @@ References
*Copyright (c) 2023-2024, Arm Limited. All rights reserved.*
*Copyright (c) 2024, Linaro Limited. All rights reserved.*
*Copyright (c) 2025, STMicroelectronics - All Rights Reserved*

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2022-2024, Arm Limited. All rights reserved.
* Copyright (c) 2022-2025, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@ -8,7 +8,6 @@
#include <string.h>
#include <common/debug.h>
#include <drivers/arm/mhu.h>
#include <drivers/arm/rse_comms.h>
#include <psa/client.h>
#include <rse_comms_protocol.h>
@ -24,7 +23,7 @@ union __packed __attribute__((aligned(4))) rse_comms_io_buffer_t {
static uint8_t select_protocol_version(const psa_invec *in_vec, size_t in_len,
const psa_outvec *out_vec, size_t out_len)
{
size_t comms_mhu_msg_size;
size_t comms_mbx_msg_size;
size_t comms_embed_msg_min_size;
size_t comms_embed_reply_min_size;
size_t in_size_total = 0;
@ -38,7 +37,7 @@ static uint8_t select_protocol_version(const psa_invec *in_vec, size_t in_len,
out_size_total += out_vec[i].len;
}
comms_mhu_msg_size = mhu_get_max_message_size();
comms_mbx_msg_size = rse_mbx_get_max_message_size();
comms_embed_msg_min_size = sizeof(struct serialized_rse_comms_header_t) +
sizeof(struct rse_embed_msg_t) -
@ -49,9 +48,9 @@ static uint8_t select_protocol_version(const psa_invec *in_vec, size_t in_len,
PLAT_RSE_COMMS_PAYLOAD_MAX_SIZE;
/* Use embed if we can pack into one message and reply, else use
* pointer_access. The underlying MHU transport protocol uses a
* pointer_access. The underlying mailbox transport protocol uses a
* single uint32_t to track the length, so the amount of data that
* can be in a message is 4 bytes less than mhu_get_max_message_size
* can be in a message is 4 bytes less than rse_mbx_get_max_message_size
* reports.
*
* TODO tune this with real performance numbers, it's possible a
@ -60,9 +59,9 @@ static uint8_t select_protocol_version(const psa_invec *in_vec, size_t in_len,
* pointers.
*/
if ((comms_embed_msg_min_size + in_size_total >
comms_mhu_msg_size - sizeof(uint32_t)) ||
comms_mbx_msg_size - sizeof(uint32_t)) ||
(comms_embed_reply_min_size + out_size_total >
comms_mhu_msg_size - sizeof(uint32_t))) {
comms_mbx_msg_size - sizeof(uint32_t))) {
return RSE_COMMS_PROTOCOL_POINTER_ACCESS;
} else {
return RSE_COMMS_PROTOCOL_EMBED;
@ -76,7 +75,7 @@ psa_status_t psa_call(psa_handle_t handle, int32_t type, const psa_invec *in_vec
* functions not being reentrant becomes a problem.
*/
static union rse_comms_io_buffer_t io_buf;
enum mhu_error_t err;
int err;
psa_status_t status;
static uint8_t seq_num = 1U;
size_t msg_size;
@ -109,8 +108,8 @@ psa_status_t psa_call(psa_handle_t handle, int32_t type, const psa_invec *in_vec
VERBOSE("in_vec[%lu].buf=%p\n", idx, (void *)in_vec[idx].base);
}
err = mhu_send_data((uint8_t *)&io_buf.msg, msg_size);
if (err != MHU_ERR_NONE) {
err = rse_mbx_send_data((uint8_t *)&io_buf.msg, msg_size);
if (err != 0) {
return PSA_ERROR_COMMUNICATION_FAILURE;
}
@ -122,8 +121,8 @@ psa_status_t psa_call(psa_handle_t handle, int32_t type, const psa_invec *in_vec
memset(&io_buf.msg, 0xA5, msg_size);
#endif
err = mhu_receive_data((uint8_t *)&io_buf.reply, &reply_size);
if (err != MHU_ERR_NONE) {
err = rse_mbx_receive_data((uint8_t *)&io_buf.reply, &reply_size);
if (err != 0) {
return PSA_ERROR_COMMUNICATION_FAILURE;
}
@ -144,37 +143,10 @@ psa_status_t psa_call(psa_handle_t handle, int32_t type, const psa_invec *in_vec
VERBOSE("out_vec[%lu].buf=%p\n", idx, (void *)out_vec[idx].base);
}
/* Clear the MHU message buffer to remove assets from memory */
/* Clear the mailbox message buffer to remove assets from memory */
memset(&io_buf, 0x0, sizeof(io_buf));
seq_num++;
return return_val;
}
int rse_comms_init(uintptr_t mhu_sender_base, uintptr_t mhu_receiver_base)
{
enum mhu_error_t err;
err = mhu_init_sender(mhu_sender_base);
if (err != MHU_ERR_NONE) {
if (err == MHU_ERR_ALREADY_INIT) {
INFO("[RSE-COMMS] Host to RSE MHU driver already initialized\n");
} else {
ERROR("[RSE-COMMS] Host to RSE MHU driver initialization failed: %d\n", err);
return -1;
}
}
err = mhu_init_receiver(mhu_receiver_base);
if (err != MHU_ERR_NONE) {
if (err == MHU_ERR_ALREADY_INIT) {
INFO("[RSE-COMMS] RSE to Host MHU driver already initialized\n");
} else {
ERROR("[RSE-COMMS] RSE to Host MHU driver initialization failed: %d\n", err);
return -1;
}
}
return 0;
}

View file

@ -1,5 +1,5 @@
#
# Copyright (c) 2022-2024, Arm Limited. All rights reserved.
# Copyright (c) 2022-2025, Arm Limited and Contributors. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#
@ -13,15 +13,16 @@ RSE_COMMS_SOURCES := $(addprefix drivers/arm/rse/, \
rse_comms_protocol_pointer_access.c \
)
# Default to MHUv2 if PLAT_MHU_VERSION undefined
PLAT_MHU_VERSION ?= 2
# Default to MHUv2 if PLAT_MHU undefined
PLAT_MHU ?= MHUv2
ifeq (${PLAT_MHU_VERSION}, 3)
ifneq (${PLAT_MHU}, NO_MHU)
ifeq (${PLAT_MHU}, MHUv3)
RSE_COMMS_SOURCES += $(addprefix drivers/arm/mhu/, \
mhu_v3_x.c \
mhu_wrapper_v3_x.c \
)
else ifeq (${PLAT_MHU_VERSION}, 2)
else ifeq (${PLAT_MHU}, MHUv2)
RSE_COMMS_SOURCES += $(addprefix drivers/arm/mhu/, \
mhu_v2_x.c \
mhu_wrapper_v2_x.c \
@ -30,6 +31,12 @@ else
$(error Unsupported MHU version)
endif
RSE_COMMS_SOURCES += $(addprefix drivers/arm/rse/, \
rse_comms_mhu.c \
)
PLAT_INCLUDES += -Idrivers/arm/mhu
endif
PLAT_INCLUDES += -Idrivers/arm/rse \
-Idrivers/arm/mhu \
-Iinclude/lib/psa

View file

@ -0,0 +1,71 @@
/*
* Copyright (c) 2025, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <stdint.h>
#include <string.h>
#include <common/debug.h>
#include <drivers/arm/mhu.h>
#include <drivers/arm/rse_comms.h>
size_t rse_mbx_get_max_message_size(void)
{
return mhu_get_max_message_size();
}
int rse_mbx_send_data(const uint8_t *send_buffer, size_t size)
{
enum mhu_error_t err = mhu_send_data(send_buffer, size);
if (err != MHU_ERR_NONE) {
ERROR("mhu_send_data err=%d\n", err);
return -1;
}
return 0;
}
int rse_mbx_receive_data(uint8_t *receive_buffer, size_t *size)
{
enum mhu_error_t err = mhu_receive_data(receive_buffer, size);
if (err != MHU_ERR_NONE) {
ERROR("mhu_receive_data err=%d\n", err);
return -1;
}
return 0;
}
int rse_mbx_init(const void *init_data)
{
enum mhu_error_t err;
const struct mhu_addr *mbx_addr = (const struct mhu_addr *)init_data;
err = mhu_init_sender(mbx_addr->sender_base);
if (err != MHU_ERR_NONE) {
if (err == MHU_ERR_ALREADY_INIT) {
INFO("[RSE-COMMS] Host to RSE MHU driver already initialized\n");
} else {
ERROR("[RSE-COMMS] Host to RSE MHU driver initialization failed: %d\n",
err);
return -1;
}
}
err = mhu_init_receiver(mbx_addr->receiver_base);
if (err != MHU_ERR_NONE) {
if (err == MHU_ERR_ALREADY_INIT) {
INFO("[RSE-COMMS] RSE to Host MHU driver already initialized\n");
} else {
ERROR("[RSE-COMMS] RSE to Host MHU driver initialization failed: %d\n",
err);
return -1;
}
}
return 0;
}

View file

@ -1,5 +1,6 @@
/*
* Copyright (c) 2022, Arm Limited. All rights reserved.
* Copyright (c) 2025, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@ -24,6 +25,14 @@ enum mhu_error_t {
MHU_ERR_GENERAL = -7,
};
/**
* Structure used by RSE comms
*/
struct mhu_addr {
uintptr_t sender_base;
uintptr_t receiver_base;
};
/**
* Initializes sender MHU.
*

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2022, Arm Limited. All rights reserved.
* Copyright (c) 2022-2025, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*
@ -8,8 +8,12 @@
#ifndef RSE_COMMS_H
#define RSE_COMMS_H
#include <stddef.h>
#include <stdint.h>
int rse_comms_init(uintptr_t mhu_sender_base, uintptr_t mhu_receiver_base);
size_t rse_mbx_get_max_message_size(void);
int rse_mbx_send_data(const uint8_t *send_buffer, size_t size);
int rse_mbx_receive_data(uint8_t *receive_buffer, size_t *size);
int rse_mbx_init(const void *init_data);
#endif /* RSE_COMMS_H */

View file

@ -1,4 +1,4 @@
# Copyright (c) 2024, Arm Limited. All rights reserved.
# Copyright (c) 2024-2025, Arm Limited and Contributors. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#
@ -33,7 +33,7 @@ GIC_ENABLE_V4_EXTN := 1
GICV3_SUPPORT_GIC600 := 1
HW_ASSISTED_COHERENCY := 1
NEED_BL32 := yes
PLAT_MHU_VERSION := 1
PLAT_MHU := MHUv1
RESET_TO_BL2 := 1
SVE_VECTOR_LEN := 128
USE_COHERENT_MEM := 0

View file

@ -51,7 +51,7 @@ GICV3_IMPL_GIC600_MULTICHIP := 1
endif
# RD-V3 uses MHUv3
PLAT_MHU_VERSION := 3
PLAT_MHU := MHUv3
include plat/arm/board/neoverse_rd/common/nrd-common.mk
include drivers/arm/rse/rse_comms.mk

View file

@ -6,6 +6,7 @@
#include <common/debug.h>
#include <drivers/arm/gic600_multichip.h>
#include <drivers/arm/mhu.h>
#include <drivers/arm/rse_comms.h>
#include <plat/arm/common/plat_arm.h>
#include <plat/common/platform.h>
@ -188,15 +189,15 @@ int plat_rmmd_load_manifest(struct rmm_manifest *manifest)
int plat_rse_comms_init(void)
{
uintptr_t snd_base, rcv_base;
struct mhu_addr mhu_addresses;
/* Get sender and receiver frames for AP-RSE communication */
mhu_v3_get_secure_device_base(&snd_base, true);
mhu_v3_get_secure_device_base(&rcv_base, false);
mhu_v3_get_secure_device_base(&mhu_addresses.sender_base, true);
mhu_v3_get_secure_device_base(&mhu_addresses.receiver_base, false);
VERBOSE("Initializing the rse_comms now\n");
/* Initialize the communication channel between AP and RSE */
return rse_comms_init(snd_base, rcv_base);
return rse_mbx_init(&mhu_addresses);
}
int plat_spmd_handle_group0_interrupt(uint32_t intid)

View file

@ -0,0 +1,12 @@
/*
* Copyright (c) 2025, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef TC_RSE_COMMS_H
#define TC_RSE_COMMS_H
int plat_rse_comms_init(void);
#endif /* TC_RSE_COMMS_H */

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2023, Arm Limited. All rights reserved.
* Copyright (c) 2023-2025, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@ -7,11 +7,11 @@
#include <stdint.h>
#include <stdio.h>
#include <drivers/arm/rse_comms.h>
#include <plat/common/platform.h>
#include "rse_platform_api.h"
#include <platform_def.h>
#include <tc_rse_comms.h>
int nv_counter_test(void)
{
@ -20,7 +20,7 @@ int nv_counter_test(void)
uint32_t new_val;
uint32_t id;
status = rse_comms_init(PLAT_RSE_AP_SND_MHU_BASE, PLAT_RSE_AP_RCV_MHU_BASE);
status = plat_rse_comms_init();
if (status != PSA_SUCCESS) {
printf("Failed to initialize RSE communication channel - psa_status = %d\n", status);
return -1;

View file

@ -112,9 +112,9 @@ PRESERVE_DSU_PMU_REGS := 1
# Specify MHU type based on platform
ifneq ($(filter ${TARGET_PLATFORM}, 2),)
PLAT_MHU_VERSION := 2
PLAT_MHU := MHUv2
else
PLAT_MHU_VERSION := 3
PLAT_MHU := MHUv3
endif
# Include GICv3 driver files
@ -249,9 +249,12 @@ $(eval $(call TOOL_ADD_PAYLOAD,${TC_HW_CONFIG},--hw-config,${TC_HW_CONFIG}))
$(info Including rse_comms.mk)
include drivers/arm/rse/rse_comms.mk
BL1_SOURCES += ${RSE_COMMS_SOURCES}
BL2_SOURCES += ${RSE_COMMS_SOURCES}
BL1_SOURCES += ${RSE_COMMS_SOURCES} \
plat/arm/board/tc/tc_rse_comms.c
BL2_SOURCES += ${RSE_COMMS_SOURCES} \
plat/arm/board/tc/tc_rse_comms.c
BL31_SOURCES += ${RSE_COMMS_SOURCES} \
plat/arm/board/tc/tc_rse_comms.c \
lib/psa/rse_platform.c
# Include Measured Boot makefile before any Crypto library makefile.

View file

@ -1,4 +1,4 @@
# Copyright (c) 2022-2024, Arm Limited. All rights reserved.
# Copyright (c) 2022-2025, Arm Limited and Contributors. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#
@ -9,7 +9,8 @@ ifeq (${PLATFORM_TEST},rse-nv-counters)
include drivers/arm/rse/rse_comms.mk
# Test code.
BL31_SOURCES += plat/arm/board/tc/nv_counter_test.c
BL31_SOURCES += plat/arm/board/tc/nv_counter_test.c \
plat/arm/board/tc/tc_rse_comms.c
# Code under testing.
BL31_SOURCES += lib/psa/rse_platform.c \
@ -22,7 +23,8 @@ else ifeq (${PLATFORM_TEST},rse-rotpk)
include drivers/arm/rse/rse_comms.mk
# Test code.
BL31_SOURCES += plat/arm/board/tc/rotpk_test.c
BL31_SOURCES += plat/arm/board/tc/rotpk_test.c \
plat/arm/board/tc/tc_rse_comms.c
# Code under testing.
BL31_SOURCES += lib/psa/rse_platform.c \
@ -75,6 +77,7 @@ else ifeq (${PLATFORM_TEST},tfm-testsuite)
${TC_BASE}/rse_ap_tests.c \
${TC_BASE}/rse_ap_testsuites.c \
${TC_BASE}/rse_ap_test_stubs.c \
${TC_BASE}/tc_rse_comms.c \
$(TF_M_TESTS_PATH)/tests_reg/test/framework/test_framework.c \
$(MEASURED_BOOT_TESTS_PATH)/measured_boot_common.c \
$(MEASURED_BOOT_TESTS_PATH)/measured_boot_tests_common.c \

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2023, Arm Limited. All rights reserved.
* Copyright (c) 2023-2025, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@ -7,10 +7,10 @@
#include <stdint.h>
#include <stdio.h>
#include <drivers/arm/rse_comms.h>
#include <plat/common/platform.h>
#include <rse_platform_api.h>
#include <tc_plat.h>
#include <tc_rse_comms.h>
static void print_hex(const char *key_id_name, size_t key_size, const uint8_t *key_buf)
{
@ -33,9 +33,10 @@ int rotpk_test(void)
{.key_id = RSE_BUILTIN_KEY_ID_HOST_CCA_ROTPK, .key_id_name = "CCA-ROTPK"}
};
status = rse_comms_init(PLAT_RSE_AP_SND_MHU_BASE, PLAT_RSE_AP_RCV_MHU_BASE);
status = plat_rse_comms_init();
if (status != PSA_SUCCESS) {
printf("Failed to initialize RSE communication channel - psa_status = %d\n", status);
printf("Failed to initialize RSE communication channel - psa_status = %d\n",
status);
return -1;
}
@ -43,7 +44,8 @@ int rotpk_test(void)
status = rse_platform_key_read(key_ids[i].key_id, key_buf,
sizeof(key_buf), &key_size);
if (status != PSA_SUCCESS) {
printf("Failed to retrieve %s - psa_status = %d\n", key_ids[i].key_id_name, status);
printf("Failed to retrieve %s - psa_status = %d\n", key_ids[i].key_id_name,
status);
return -1;
}
print_hex(key_ids[i].key_id_name, key_size, key_buf);

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2022, Arm Ltd. All rights reserved.
* Copyright (c) 2022-2025, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@ -10,9 +10,9 @@
#include <mbedtls_common.h>
#include <plat/common/platform.h>
#include <psa/crypto.h>
#include <rse_comms.h>
#include "rse_ap_testsuites.h"
#include <tc_rse_comms.h>
static struct test_suite_t test_suites[] = {
{.freg = register_testsuite_delegated_attest},
@ -32,7 +32,7 @@ static int run_tests(void)
size_t i;
/* Initialize test environment. */
rse_comms_init(PLAT_RSE_AP_SND_MHU_BASE, PLAT_RSE_AP_RCV_MHU_BASE);
plat_rse_comms_init();
mbedtls_init();
status = psa_crypto_init();
if (status != PSA_SUCCESS) {

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2024, Arm Limited. All rights reserved.
* Copyright (c) 2024-2025, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@ -8,7 +8,6 @@
#include <common/debug.h>
#include <drivers/arm/css/sds.h>
#include <drivers/arm/rse_comms.h>
#include <drivers/delay_timer.h>
#include <drivers/generic_delay_timer.h>
#include <drivers/measured_boot/metadata.h>
@ -19,6 +18,7 @@
#include <tools_share/zero_oid.h>
#include "tc_dpe.h"
#include <tc_rse_comms.h>
struct dpe_metadata tc_dpe_metadata[] = {
{
@ -122,8 +122,7 @@ void plat_dpe_get_context_handle(int *ctx_handle)
void bl1_plat_mboot_init(void)
{
/* Initialize the communication channel between AP and RSE */
(void)rse_comms_init(PLAT_RSE_AP_SND_MHU_BASE,
PLAT_RSE_AP_RCV_MHU_BASE);
(void)plat_rse_comms_init();
dpe_init(tc_dpe_metadata);
}

View file

@ -1,18 +1,18 @@
/*
* Copyright (c) 2022-2024, Arm Limited. All rights reserved.
* Copyright (c) 2022-2025, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <stdint.h>
#include <drivers/arm/rse_comms.h>
#include <drivers/measured_boot/metadata.h>
#include <drivers/measured_boot/rse/rse_measured_boot.h>
#include <tools_share/zero_oid.h>
#include <plat/arm/common/plat_arm.h>
#include <platform_def.h>
#include <tc_rse_comms.h>
/* Table with platform specific image IDs and metadata. Intentionally not a
* const struct, some members might set by bootloaders during trusted boot.
@ -47,8 +47,7 @@ struct rse_mboot_metadata tc_rse_mboot_metadata[] = {
void bl1_plat_mboot_init(void)
{
/* Initialize the communication channel between AP and RSE */
(void)rse_comms_init(PLAT_RSE_AP_SND_MHU_BASE,
PLAT_RSE_AP_RCV_MHU_BASE);
(void)plat_rse_comms_init();
rse_measured_boot_init(tc_rse_mboot_metadata);
}

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2024, Arm Limited. All rights reserved.
* Copyright (c) 2024-2025, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@ -7,7 +7,6 @@
#include <stdint.h>
#include <common/debug.h>
#include <drivers/arm/rse_comms.h>
#include <drivers/measured_boot/metadata.h>
#include <drivers/measured_boot/rse/dice_prot_env.h>
#include <plat/arm/common/plat_arm.h>
@ -16,6 +15,7 @@
#include <tools_share/tbbr_oid.h>
#include "tc_dpe.h"
#include <tc_rse_comms.h>
/*
* The content and the values of this array depends on:
@ -254,8 +254,7 @@ void bl2_plat_mboot_init(void)
#endif
/* Initialize the communication channel between AP and RSE */
(void)rse_comms_init(PLAT_RSE_AP_SND_MHU_BASE,
PLAT_RSE_AP_RCV_MHU_BASE);
(void)plat_rse_comms_init();
dpe_init(tc_dpe_metadata);
}

View file

@ -1,18 +1,18 @@
/*
* Copyright (c) 2022-2024, Arm Limited. All rights reserved.
* Copyright (c) 2022-2025, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <stdint.h>
#include <drivers/arm/rse_comms.h>
#include <drivers/measured_boot/metadata.h>
#include <drivers/measured_boot/rse/rse_measured_boot.h>
#include <tools_share/tbbr_oid.h>
#include <plat/common/common_def.h>
#include <platform_def.h>
#include <tc_rse_comms.h>
/* TC specific table with image IDs and metadata. Intentionally not a
* const struct, some members might set by bootloaders during trusted boot.
@ -53,8 +53,7 @@ struct rse_mboot_metadata tc_rse_mboot_metadata[] = {
void bl2_plat_mboot_init(void)
{
/* Initialize the communication channel between AP and RSE */
(void)rse_comms_init(PLAT_RSE_AP_SND_MHU_BASE,
PLAT_RSE_AP_RCV_MHU_BASE);
(void)plat_rse_comms_init();
rse_measured_boot_init(tc_rse_mboot_metadata);
}

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2020-2024, Arm Limited and Contributors. All rights reserved.
* Copyright (c) 2020-2025, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@ -27,8 +27,8 @@
#endif /* PLATFORM_TEST_TFM_TESTSUITE */
#include <psa/error.h>
#include <drivers/arm/rse_comms.h>
#include <plat/common/platform.h>
#include <tc_rse_comms.h>
#ifdef PLATFORM_TEST_TFM_TESTSUITE
/*
@ -126,7 +126,7 @@ void bl31_platform_setup(void)
#endif
/* Initialise RSE communication channel */
status = rse_comms_init(PLAT_RSE_AP_SND_MHU_BASE, PLAT_RSE_AP_RCV_MHU_BASE);
status = plat_rse_comms_init();
if (status != PSA_SUCCESS) {
ERROR("Failed to initialize RSE communication channel - psa_status = %d\n", status);
}

View file

@ -0,0 +1,23 @@
/*
* Copyright (c) 2022-2025, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <common/debug.h>
#include <drivers/arm/mhu.h>
#include <drivers/arm/rse_comms.h>
#include <platform_def.h>
#include <tc_rse_comms.h>
static const struct mhu_addr mhu_addresses = {
PLAT_RSE_AP_SND_MHU_BASE,
PLAT_RSE_AP_RCV_MHU_BASE
};
int plat_rse_comms_init(void)
{
VERBOSE("Initializing the rse_comms now\n");
/* Initialize the communication channel between AP and RSE */
return rse_mbx_init(&mhu_addresses);
}