Skip to content

Commit ca954a6

Browse files
nordic-krchjukkar
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) (cherry picked from commit f57f171)
1 parent 7736d44 commit ca954a6

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;
@@ -220,6 +228,9 @@ static void hfclk_start(void)
220228
hf_start_tstamp = k_uptime_get();
221229
}
222230

231+
#ifdef USE_WORKAROUND_FOR_CLOCK_XOSTART_ANOMALY
232+
nrf_clock_task_trigger(NRF_CLOCK, NRF_CLOCK_TASK_PLLSTART);
233+
#endif
223234
nrfx_clock_hfclk_start();
224235
}
225236

@@ -230,6 +241,9 @@ static void hfclk_stop(void)
230241
}
231242

232243
nrfx_clock_hfclk_stop();
244+
#ifdef USE_WORKAROUND_FOR_CLOCK_XOSTART_ANOMALY
245+
nrf_clock_task_trigger(NRF_CLOCK, NRF_CLOCK_TASK_PLLSTOP);
246+
#endif
233247
}
234248

235249
#if NRF_CLOCK_HAS_HFCLK192M

0 commit comments

Comments
 (0)