|
23 | 23 | #if IS_ENABLED(CONFIG_SOC_COMPATIBLE_NRF54LX) |
24 | 24 | #include <nrfx_power.h> |
25 | 25 | #endif |
| 26 | +#if IS_ENABLED(CONFIG_SOC_SERIES_NRF54L) |
| 27 | +#include <nrf_sys_event.h> |
| 28 | +#endif |
| 29 | + |
26 | 30 | #if defined(CONFIG_SOC_SERIES_NRF54H) |
27 | 31 | #include <hal/nrf_dppi.h> |
28 | 32 | #endif |
@@ -190,6 +194,12 @@ static struct k_work mpsl_low_prio_work; |
190 | 194 | struct k_work_q mpsl_work_q; |
191 | 195 | static K_THREAD_STACK_DEFINE(mpsl_work_stack, CONFIG_MPSL_WORK_STACK_SIZE); |
192 | 196 |
|
| 197 | +#if IS_ENABLED(CONFIG_SOC_SERIES_NRF54L) && !IS_ENABLED(CONFIG_TRUSTED_EXECUTION_NONSECURE) |
| 198 | +#if IS_ENABLED(CONFIG_NRF_SYS_EVENT_IRQ_LATENCY) |
| 199 | +static int m_nvm_low_latency_event_handle = -1; |
| 200 | +#endif /* IS_ENABLED(CONFIG_NRF_SYS_EVENT_IRQ_LATENCY) */ |
| 201 | +#endif /* IS_ENABLED(CONFIG_SOC_SERIES_NRF54L) && !IS_ENABLED(CONFIG_TRUSTED_EXECUTION_NONSECURE) */ |
| 202 | + |
193 | 203 | #define MPSL_TIMESLOT_SESSION_COUNT (\ |
194 | 204 | CONFIG_MPSL_TIMESLOT_SESSION_COUNT + \ |
195 | 205 | CONFIG_SOC_FLASH_NRF_RADIO_SYNC_MPSL_TIMESLOT_SESSION_COUNT) |
@@ -603,6 +613,35 @@ void mpsl_lowpower_request_callback(void) |
603 | 613 | nrf_power_task_trigger(NRF_POWER, NRF_POWER_TASK_LOWPWR); |
604 | 614 | #endif |
605 | 615 | } |
| 616 | + |
| 617 | +void mpsl_nvm_low_latency_request_callback(void) |
| 618 | +{ |
| 619 | +#if IS_ENABLED(CONFIG_NRF_SYS_EVENT_IRQ_LATENCY) && !IS_ENABLED(CONFIG_TRUSTED_EXECUTION_NONSECURE) |
| 620 | + int event_handle = nrf_sys_event_register(0, true); |
| 621 | + |
| 622 | + if (event_handle < 0) { |
| 623 | + LOG_ERR("NVM low latency request has failed (%d)", event_handle); |
| 624 | + } |
| 625 | + |
| 626 | + m_nvm_low_latency_event_handle = event_handle; |
| 627 | +#endif /* IS_ENABLED(CONFIG_NRF_SYS_EVENT_IRQ_LATENCY) && \ |
| 628 | + !IS_ENABLED(CONFIG_TRUSTED_EXECUTION_NONSECURE) */ |
| 629 | +} |
| 630 | + |
| 631 | +void mpsl_nvm_low_latency_release_callback(void) |
| 632 | +{ |
| 633 | +#if IS_ENABLED(CONFIG_NRF_SYS_EVENT_IRQ_LATENCY) && !IS_ENABLED(CONFIG_TRUSTED_EXECUTION_NONSECURE) |
| 634 | + |
| 635 | + int ret = nrf_sys_event_unregister(m_nvm_low_latency_event_handle, false); |
| 636 | + if (ret != 0) { |
| 637 | + LOG_ERR("NVM low latency release has failed (%d)", ret); |
| 638 | + } |
| 639 | + |
| 640 | + m_nvm_low_latency_event_handle = -1; |
| 641 | +#endif /* IS_ENABLED(CONFIG_NRF_SYS_EVENT_IRQ_LATENCY) && \ |
| 642 | + !IS_ENABLED(CONFIG_TRUSTED_EXECUTION_NONSECURE) */ |
| 643 | +} |
| 644 | + |
606 | 645 | #endif /* defined(CONFIG_SOC_COMPATIBLE_NRF54LX) */ |
607 | 646 |
|
608 | 647 | #if defined(CONFIG_MPSL_USE_EXTERNAL_CLOCK_CONTROL) |
|
0 commit comments