Skip to content

Commit ece11af

Browse files
committed
[nrf fromlist] modules: hal_nordic: ironside: Add NRF_MPCCONF_API_IN_RAM
Upstream PR #: 104759 Add an option for calling the MPCCONF service from RAM, by plugging in the `__ramfunc` attribute via IronSide SE support package's glue layer. Signed-off-by: Grzegorz Swiderski <grzegorz.swiderski@nordicsemi.no> (cherry picked from commit 61ece1acb3d506ab17cfb8854d9625d6a5e1b6b2)
1 parent aab8d88 commit ece11af

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

modules/hal_nordic/ironside/se/Kconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,4 +127,16 @@ config NRF_PERIPHCONF_SECTION_KEEP_BY_DEFAULT
127127
CONFIG_NRF_PERIPHCONF_SECTION_STRIP=n unless explicitly configured otherwise.
128128
To override this behavior, set CONFIG_NRF_PERIPHCONF_SECTION_STRIP=y directly.
129129

130+
config NRF_MPCCONF_API_IN_RAM
131+
bool "MPCCONF API in RAM"
132+
depends on IRONSIDE_SE_CALL
133+
depends on !IRONSIDE_SE_CALL_ZEPHYR || !XIP
134+
help
135+
Ensure that the functions used to modify and lock the MPC configuration
136+
- namely, ironside_se_mpcconf_write() and ironside_se_mpcconf_finish_init() -
137+
are placed in RAM. This may be needed to reconfigure permissions for XIP memory.
138+
139+
This is not supported with the default IronSide call driver in Zephyr,
140+
unless it and all of its dependencies are also relocated to be executed from RAM.
141+
130142
endmenu # IronSide SE

modules/hal_nordic/ironside/se/include/ironside_zephyr/se/glue_impl.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,10 @@
1212
#define IRONSIDE_SE_ALWAYS_INLINE ALWAYS_INLINE
1313
#endif
1414

15+
#if defined(CONFIG_NRF_MPCCONF_API_IN_RAM)
16+
/* Place MPCCONF APIs in RAM by plugging in function attributes. */
17+
#define IRONSIDE_SE_MPCCONF_WRITE_FUNC_ATTR __ramfunc
18+
#define IRONSIDE_SE_MPCCONF_FINISH_INIT_FUNC_ATTR __ramfunc
19+
#endif
20+
1521
#endif /* ZEPHYR_MODULES_HAL_NORDIC_IRONSIDE_SE_INCLUDE_IRONSIDE_ZEPHYR_SE_GLUE_IMPL_H_ */

0 commit comments

Comments
 (0)