Skip to content

Commit 888d5e7

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 72b10b3 commit 888d5e7

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

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

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,36 @@ 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 // defined(NRF54LM20A_ENGA_XXAA)
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+
#else
4970
struct onoff_manager *mgr =
5071
z_nrf_clock_control_get_onoff(CLOCK_CONTROL_NRF_SUBSYS_HF);
5172

5273
__ASSERT_NO_MSG(mgr != NULL);
5374

5475
sys_notify_init_callback(&hfclk_cli.notify, hfclk_on_callback);
55-
76+
#endif // defined(NRF54LM20A_ENGA_XXAA)
5677
/*
5778
* todo: replace constlat request with PM policy API when
5879
* controlling the event latency becomes possible.
@@ -61,9 +82,11 @@ void nrf_802154_clock_hfclk_start(void)
6182
nrf_sys_event_request_global_constlat();
6283
}
6384

85+
#if !defined(NRF54LM20A_ENGA_XXAA)
6486
int ret = onoff_request(mgr, &hfclk_cli);
6587
__ASSERT_NO_MSG(ret >= 0);
6688
(void)ret;
89+
#endif
6790
}
6891

6992
void nrf_802154_clock_hfclk_stop(void)

0 commit comments

Comments
 (0)