refactor(rse): put MHU code in a dedicated file
To be able to use RSE comms without MHU, a first step is to disentangle
the rse_comms.c file with MHU code direct calls. This is done with the
creation of a new file rse_comms_mhu.c. New APIs are created to
initialize the mailbox, get max message size and send and receive data.
Signed-off-by: Yann Gautier <yann.gautier@st.com>
Change-Id: I75dda77e1886beaa6ced6f92c311617125918cfa
diff --git a/include/drivers/arm/mhu.h b/include/drivers/arm/mhu.h
index 31c6a81..cc74e27 100644
--- a/include/drivers/arm/mhu.h
+++ b/include/drivers/arm/mhu.h
@@ -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
*/
@@ -25,6 +26,14 @@
};
/**
+ * Structure used by RSE comms
+ */
+struct mhu_addr {
+ uintptr_t sender_base;
+ uintptr_t receiver_base;
+};
+
+/**
* Initializes sender MHU.
*
* mhu_sender_base Base address of sender MHU.
diff --git a/include/drivers/arm/rse_comms.h b/include/drivers/arm/rse_comms.h
index e4169a5..e390cce 100644
--- a/include/drivers/arm/rse_comms.h
+++ b/include/drivers/arm/rse_comms.h
@@ -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,13 @@
#ifndef RSE_COMMS_H
#define RSE_COMMS_H
+#include <stddef.h>
#include <stdint.h>
+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);
int rse_comms_init(uintptr_t mhu_sender_base, uintptr_t mhu_receiver_base);
#endif /* RSE_COMMS_H */