Skip to content

Commit f73da17

Browse files
tokangasnordic-hani
authored andcommitted
lib: nrf_modem_lib: Add IronSide SE support for nRF92
Added IronSide SE support for nRF92. NCSDK-33800 Signed-off-by: Tommi Kangas <[email protected]>
1 parent 1dacd06 commit f73da17

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

lib/nrf_modem_lib/nrf_modem_os_rpc.c

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,22 @@
1717
#include <zephyr/drivers/mbox.h>
1818
#include <zephyr/ipc/icmsg.h>
1919
#include <zephyr/ipc/pbuf.h>
20+
#if defined(CONFIG_NRF_IRONSIDE)
21+
#include <nrf_ironside/cpuconf.h>
22+
#endif
2023

2124
#define DCACHE_LINE_SIZE (CONFIG_DCACHE_LINE_SIZE)
2225
BUILD_ASSERT(DCACHE_LINE_SIZE == 32,
2326
"Unexpected data cache line size " STRINGIFY(DCACHE_LINE_SIZE) ", expected 32");
2427

28+
/** IronSide SE boot report local domain context for cellcore. */
29+
struct boot_report_cellcore_ldc {
30+
uint32_t ipc_buf_addr;
31+
uint32_t ipc_buf_size;
32+
uint32_t loader_addr;
33+
uint32_t rfu;
34+
};
35+
2536
/** Structure to hold pbuf configuration and data. */
2637
struct nrf_modem_pbuf {
2738
struct pbuf_cfg pb_cfg;
@@ -106,6 +117,32 @@ uintptr_t nrf_modem_os_rpc_sigdev_modem_get(void)
106117
return (uintptr_t)modem_bellboard;
107118
}
108119

120+
int nrf_modem_os_rpc_cellcore_boot(void)
121+
{
122+
#if defined(CONFIG_NRF_IRONSIDE)
123+
struct boot_report_cellcore_ldc params;
124+
125+
params.ipc_buf_addr = DT_REG_ADDR(DT_NODELABEL(cpuapp_cpucell_ipc_shm_ctrl));
126+
params.ipc_buf_size = CONFIG_NRF_MODEM_LIB_SHMEM_CTRL_SIZE;
127+
params.loader_addr = 0;
128+
params.rfu = 0;
129+
130+
uint8_t *msg = (uint8_t *)&params;
131+
size_t msg_size = sizeof(params);
132+
133+
/* Don't wait as this is not yet supported. */
134+
bool cpu_wait = false;
135+
136+
/* TODO: Replace hardcoded value with NRF_PROCESSOR_CELLCORE when it's available
137+
* in the MDK.
138+
*/
139+
return ironside_cpuconf(4, NULL, cpu_wait, msg, msg_size);
140+
#else
141+
/* Without IronSide SE, cellcore is booted by the SDFW. */
142+
return 0;
143+
#endif
144+
}
145+
109146
static inline void pbuf_configure(struct pbuf_cfg *pb_cfg, uintptr_t mem_addr, size_t size)
110147
{
111148
const uint32_t wr_idx_offset = MAX(pb_cfg->dcache_alignment, _PBUF_IDX_SIZE);

0 commit comments

Comments
 (0)