feat(st-drivers): add RISAF driver
Introduction of Resource Isolation Slave for Address space - Full
(RISAF) driver to configure main memory regions with access rights
defined in device node in DT(through FCONF compliance) or statically.
The driver is enabled as BL2 sources. Add driver-related platform
services.
RISAF base addresses and key size are set in platform definitions.
Signed-off-by: Nicolas Le Bayon <nicolas.le.bayon@st.com>
Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Maxime Méré <maxime.mere@foss.st.com>
Change-Id: Iae99985e8db7cb2b27f9ca25669e74c8e08792d2
diff --git a/plat/st/stm32mp2/stm32mp2_private.c b/plat/st/stm32mp2/stm32mp2_private.c
index ea9d2fc..2070cea 100644
--- a/plat/st/stm32mp2/stm32mp2_private.c
+++ b/plat/st/stm32mp2/stm32mp2_private.c
@@ -1,10 +1,11 @@
/*
- * Copyright (c) 2023-2024, STMicroelectronics - All Rights Reserved
+ * Copyright (c) 2023-2025, STMicroelectronics - All Rights Reserved
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <assert.h>
+#include <errno.h>
#include <lib/xlat_tables/xlat_tables_v2.h>
@@ -324,6 +325,66 @@
return false;
}
+int stm32_risaf_get_instance(uintptr_t base)
+{
+ switch (base) {
+ case RISAF2_BASE:
+ return (int)RISAF2_INST;
+ case RISAF4_BASE:
+ return (int)RISAF4_INST;
+ default:
+ return -ENODEV;
+ }
+}
+
+uintptr_t stm32_risaf_get_base(int instance)
+{
+ switch (instance) {
+ case RISAF2_INST:
+ return (uintptr_t)RISAF2_BASE;
+ case RISAF4_INST:
+ return (uintptr_t)RISAF4_BASE;
+ default:
+ return 0U;
+ }
+}
+
+int stm32_risaf_get_max_region(int instance)
+{
+ switch (instance) {
+ case RISAF2_INST:
+ return (int)RISAF2_MAX_REGION;
+ case RISAF4_INST:
+ return (int)RISAF4_MAX_REGION;
+ default:
+ return 0;
+ }
+}
+
+uintptr_t stm32_risaf_get_memory_base(int instance)
+{
+ switch (instance) {
+ case RISAF2_INST:
+ return (uintptr_t)STM32MP_OSPI_MM_BASE;
+ case RISAF4_INST:
+ return (uintptr_t)STM32MP_DDR_BASE;
+ default:
+ return 0U;
+ }
+}
+
+size_t stm32_risaf_get_memory_size(int instance)
+{
+ switch (instance) {
+ case RISAF2_INST:
+ return STM32MP_OSPI_MM_SIZE;
+ case RISAF4_INST:
+ return dt_get_ddr_size();
+ default:
+ return 0U;
+ }
+}
+
uintptr_t stm32_get_bkpr_boot_mode_addr(void)
{
return tamp_bkpr(BKPR_BOOT_MODE);