Skip to content

Commit 0b58ccd

Browse files
e-rknordicjm
authored andcommitted
[nrf fromlist] 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. Upstream PR #: 85883 Signed-off-by: Rafał Kuźnia <[email protected]>
1 parent 65d9b7d commit 0b58ccd

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

modules/hal_nordic/Kconfig

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,13 @@ menuconfig NRF_802154_RADIO_DRIVER
3636

3737
if NRF_802154_RADIO_DRIVER
3838

39+
config NRF_802154_CONSTLAT_CONTROL
40+
def_bool y
41+
depends on SOC_SERIES_NRF54LX && NRF_802154_SL_OPENSOURCE
42+
select NRF_SYS_EVENT
43+
help
44+
Allows the nRF 802.15.4 radio driver to manage the constant latency state.
45+
3946
config NRF_802154_MULTIPROTOCOL_SUPPORT
4047
bool
4148
help

modules/hal_nordic/nrf_802154/sl_opensource/platform/nrf_802154_clock_zephyr.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include <compiler_abstraction.h>
1313
#include <zephyr/kernel.h>
1414
#include <zephyr/drivers/clock_control/nrf_clock_control.h>
15+
#include <nrf_sys_event.h>
1516

1617
static bool hfclk_is_running;
1718

@@ -52,6 +53,14 @@ void nrf_802154_clock_hfclk_start(void)
5253

5354
sys_notify_init_callback(&hfclk_cli.notify, hfclk_on_callback);
5455

56+
/*
57+
* todo: replace constlat request with PM policy API when
58+
* controlling the event latency becomes possible.
59+
*/
60+
if (IS_ENABLED(CONFIG_NRF_802154_CONSTLAT_CONTROL)) {
61+
nrf_sys_event_request_global_constlat();
62+
}
63+
5564
int ret = onoff_request(mgr, &hfclk_cli);
5665
__ASSERT_NO_MSG(ret >= 0);
5766
(void)ret;
@@ -67,6 +76,11 @@ void nrf_802154_clock_hfclk_stop(void)
6776
int ret = onoff_cancel_or_release(mgr, &hfclk_cli);
6877
__ASSERT_NO_MSG(ret >= 0);
6978
(void)ret;
79+
80+
if (IS_ENABLED(CONFIG_NRF_802154_CONSTLAT_CONTROL)) {
81+
nrf_sys_event_release_global_constlat();
82+
}
83+
7084
hfclk_is_running = false;
7185
}
7286

0 commit comments

Comments
 (0)