|
17 | 17 | #include <zephyr/drivers/mbox.h>
|
18 | 18 | #include <zephyr/ipc/icmsg.h>
|
19 | 19 | #include <zephyr/ipc/pbuf.h>
|
| 20 | +#if defined(CONFIG_NRF_IRONSIDE) |
| 21 | +#include <nrf_ironside/cpuconf.h> |
| 22 | +#endif |
20 | 23 |
|
21 | 24 | #define DCACHE_LINE_SIZE (CONFIG_DCACHE_LINE_SIZE)
|
22 | 25 | BUILD_ASSERT(DCACHE_LINE_SIZE == 32,
|
23 | 26 | "Unexpected data cache line size " STRINGIFY(DCACHE_LINE_SIZE) ", expected 32");
|
24 | 27 |
|
| 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 | + |
25 | 36 | /** Structure to hold pbuf configuration and data. */
|
26 | 37 | struct nrf_modem_pbuf {
|
27 | 38 | struct pbuf_cfg pb_cfg;
|
@@ -106,6 +117,32 @@ uintptr_t nrf_modem_os_rpc_sigdev_modem_get(void)
|
106 | 117 | return (uintptr_t)modem_bellboard;
|
107 | 118 | }
|
108 | 119 |
|
| 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 *)¶ms; |
| 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 | + |
109 | 146 | static inline void pbuf_configure(struct pbuf_cfg *pb_cfg, uintptr_t mem_addr, size_t size)
|
110 | 147 | {
|
111 | 148 | const uint32_t wr_idx_offset = MAX(pb_cfg->dcache_alignment, _PBUF_IDX_SIZE);
|
|
0 commit comments