Skip to content

Commit f57f171

Browse files
nordic-krchnordicjm
authored andcommitted
[nrf fromtree] drivers: clock_control: nrf: Add workaround for XO start anomaly
Add workaround to HFCLK start and stop in nrf54l. In future workaround will be in nrfx driver. Signed-off-by: Krzysztof Chruściński <[email protected]> (cherry picked from commit 2cb2cf2)
1 parent e72a650 commit f57f171

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

drivers/clock_control/clock_control_nrf.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,14 @@ LOG_MODULE_REGISTER(clock_control, CONFIG_CLOCK_CONTROL_LOG_LEVEL);
4848
#define INF(dev, subsys, ...) CLOCK_LOG(INF, dev, subsys, __VA_ARGS__)
4949
#define DBG(dev, subsys, ...) CLOCK_LOG(DBG, dev, subsys, __VA_ARGS__)
5050

51+
#if defined(NRF54L05_XXAA) || defined(NRF54L10_XXAA) || defined(NRF54L15_XXAA)
52+
#if NRFX_RELEASE_VER_AT_LEAST(3, 11, 0)
53+
#error "Remove workaround for XOSTART as it is already done in the nrfx clock"
54+
#endif
55+
56+
#define USE_WORKAROUND_FOR_CLOCK_XOSTART_ANOMALY 1
57+
#endif
58+
5159
/* Clock subsys structure */
5260
struct nrf_clock_control_sub_data {
5361
clock_control_cb_t cb;
@@ -235,6 +243,9 @@ static void hfclk_start(void)
235243
hf_start_tstamp = k_uptime_get();
236244
}
237245

246+
#ifdef USE_WORKAROUND_FOR_CLOCK_XOSTART_ANOMALY
247+
nrf_clock_task_trigger(NRF_CLOCK, NRF_CLOCK_TASK_PLLSTART);
248+
#endif
238249
nrfx_clock_hfclk_start();
239250
}
240251

@@ -245,6 +256,9 @@ static void hfclk_stop(void)
245256
}
246257

247258
nrfx_clock_hfclk_stop();
259+
#ifdef USE_WORKAROUND_FOR_CLOCK_XOSTART_ANOMALY
260+
nrf_clock_task_trigger(NRF_CLOCK, NRF_CLOCK_TASK_PLLSTOP);
261+
#endif
248262
}
249263

250264
#if NRF_CLOCK_HAS_HFCLK192M

0 commit comments

Comments
 (0)