modules: hal_nordic: nrf_802154: enable constant latency

To ensure that the accesses to the radio peripheral are done with
predictable timings, the constant latency must be enabled.
The constant latency mode is enabled alongside the HFXO.

Signed-off-by: Rafał Kuźnia <rafal.kuznia@nordicsemi.no>
This commit is contained in:
Rafał Kuźnia 2025-02-14 12:30:17 +01:00 committed by Carles Cufí
commit 442d9383df
2 changed files with 21 additions and 0 deletions

View file

@ -36,6 +36,13 @@ menuconfig NRF_802154_RADIO_DRIVER
if NRF_802154_RADIO_DRIVER
config NRF_802154_CONSTLAT_CONTROL
def_bool y
depends on SOC_SERIES_NRF54LX && NRF_802154_SL_OPENSOURCE
select NRF_SYS_EVENT
help
Allows the nRF 802.15.4 radio driver to manage the constant latency state.
config NRF_802154_MULTIPROTOCOL_SUPPORT
bool
help

View file

@ -12,6 +12,7 @@
#include <compiler_abstraction.h>
#include <zephyr/kernel.h>
#include <zephyr/drivers/clock_control/nrf_clock_control.h>
#include <nrf_sys_event.h>
static bool hfclk_is_running;
@ -52,6 +53,14 @@ void nrf_802154_clock_hfclk_start(void)
sys_notify_init_callback(&hfclk_cli.notify, hfclk_on_callback);
/*
* todo: replace constlat request with PM policy API when
* controlling the event latency becomes possible.
*/
if (IS_ENABLED(CONFIG_NRF_802154_CONSTLAT_CONTROL)) {
nrf_sys_event_request_global_constlat();
}
int ret = onoff_request(mgr, &hfclk_cli);
__ASSERT_NO_MSG(ret >= 0);
(void)ret;
@ -67,6 +76,11 @@ void nrf_802154_clock_hfclk_stop(void)
int ret = onoff_cancel_or_release(mgr, &hfclk_cli);
__ASSERT_NO_MSG(ret >= 0);
(void)ret;
if (IS_ENABLED(CONFIG_NRF_802154_CONSTLAT_CONTROL)) {
nrf_sys_event_release_global_constlat();
}
hfclk_is_running = false;
}