Skip to content

Commit c1d55b9

Browse files
committed
[nrf fromlist] modules: hal_nordic: nrf_802154: use timer to emit hfclk_ready on nRF54LM20A
Right now, the power_clock_irq is not available on nRF54LM20A. Since the onoff mechanism relies on the irq, the timer is used to emit the hfclk_ready callback. Upstream PR #: 90080 Signed-off-by: Piotr Koziar <[email protected]>
1 parent 59275b9 commit c1d55b9

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

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

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,29 @@ static void hfclk_on_callback(struct onoff_manager *mgr,
4444
}
4545

4646
#if defined(CONFIG_CLOCK_CONTROL_NRF)
47+
48+
#if defined(NRF54LM20A_ENGA_XXAA)
49+
/* HF clock time to ramp-up. */
50+
#define MAX_HFXO_RAMP_UP_TIME_US 550
51+
52+
static void hfclk_started_timer_handler(struct k_timer *dummy)
53+
{
54+
hfclk_on_callback(NULL, NULL, 0, 0);
55+
}
56+
57+
K_TIMER_DEFINE(hfclk_started_timer, hfclk_started_timer_handler, NULL);
58+
#endif
59+
4760
void nrf_802154_clock_hfclk_start(void)
4861
{
62+
#if defined(NRF54LM20A_ENGA_XXAA)
63+
/*
64+
* Right now, the power_clock_irq is not available on nRF54LM20A.
65+
* Since the onoff mechanism relies on the irq, the timer is used
66+
* to emit the hfclk_ready callback.
67+
*/
68+
k_timer_start(&hfclk_started_timer, K_USEC(MAX_HFXO_RAMP_UP_TIME_US), K_NO_WAIT);
69+
#endif
4970
struct onoff_manager *mgr =
5071
z_nrf_clock_control_get_onoff(CLOCK_CONTROL_NRF_SUBSYS_HF);
5172

0 commit comments

Comments
 (0)