Skip to content

Commit 3b35ead

Browse files
bjarki-andreasenjfischer-no
authored andcommitted
[nrf fromlist] drivers: clock_control: nrf fll16 remove closed loop impl
Remove the closed loop mode implementation for the fll16m clock. Closed loop causes a hardware bug resulting in increased current consumption if SoC experiences high, but within spec, temperatures. Upstream PR #: 86339 Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no> (cherry picked from commit 7e1ff38)
1 parent e7c02bf commit 3b35ead

File tree

3 files changed

+1
-34
lines changed

3 files changed

+1
-34
lines changed

drivers/clock_control/clock_control_nrf2_fll16m.c

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,14 @@ BUILD_ASSERT(DT_NUM_INST_STATUS_OKAY(DT_DRV_COMPAT) == 1,
2121
#define FLAG_HFXO_STARTED BIT(FLAGS_COMMON_BITS)
2222

2323
#define FLL16M_MODE_OPEN_LOOP 0
24-
#define FLL16M_MODE_CLOSED_LOOP 1
24+
#define FLL16M_MODE_CLOSED_LOOP 1 /* <-- DO NOT IMPLEMENT, CAN CAUSE HARDWARE BUG */
2525
#define FLL16M_MODE_BYPASS 2
2626
#define FLL16M_MODE_DEFAULT FLL16M_MODE_OPEN_LOOP
2727

2828
#define FLL16M_HFXO_NODE DT_INST_PHANDLE_BY_NAME(0, clocks, hfxo)
2929

3030
#define FLL16M_HFXO_ACCURACY DT_PROP(FLL16M_HFXO_NODE, accuracy_ppm)
3131
#define FLL16M_OPEN_LOOP_ACCURACY DT_INST_PROP(0, open_loop_accuracy_ppm)
32-
#define FLL16M_CLOSED_LOOP_BASE_ACCURACY DT_INST_PROP(0, closed_loop_base_accuracy_ppm)
3332
#define FLL16M_MAX_ACCURACY FLL16M_HFXO_ACCURACY
3433

3534
#define BICR (NRF_BICR_Type *)DT_REG_ADDR(DT_NODELABEL(bicr))
@@ -43,9 +42,6 @@ static struct clock_options {
4342
.accuracy = FLL16M_OPEN_LOOP_ACCURACY,
4443
.mode = FLL16M_MODE_OPEN_LOOP,
4544
},
46-
{
47-
.mode = FLL16M_MODE_CLOSED_LOOP,
48-
},
4945
{
5046
/* Bypass mode uses HFXO */
5147
.accuracy = FLL16M_HFXO_ACCURACY,
@@ -225,27 +221,6 @@ static int api_get_rate_fll16m(const struct device *dev,
225221
static int fll16m_init(const struct device *dev)
226222
{
227223
struct fll16m_dev_data *dev_data = dev->data;
228-
nrf_bicr_lfosc_mode_t lfosc_mode;
229-
230-
clock_options[1].accuracy = FLL16M_CLOSED_LOOP_BASE_ACCURACY;
231-
232-
/* Closed-loop mode uses LFXO as source if present, HFXO otherwise */
233-
lfosc_mode = nrf_bicr_lfosc_mode_get(BICR);
234-
235-
if (lfosc_mode != NRF_BICR_LFOSC_MODE_UNCONFIGURED &&
236-
lfosc_mode != NRF_BICR_LFOSC_MODE_DISABLED) {
237-
int ret;
238-
uint16_t accuracy;
239-
240-
ret = lfosc_get_accuracy(&accuracy);
241-
if (ret < 0) {
242-
return ret;
243-
}
244-
245-
clock_options[1].accuracy += accuracy;
246-
} else {
247-
clock_options[1].accuracy += FLL16M_HFXO_ACCURACY;
248-
}
249224

250225
return clock_config_init(&dev_data->clk_cfg,
251226
ARRAY_SIZE(dev_data->clk_cfg.onoff),

dts/bindings/clock/nordic,nrf-fll16m.yaml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ description: |
1818
1919
fll16m {
2020
open-loop-accuracy-ppm = <20000>;
21-
closed-loop-base-accuracy-ppm = <5000>;
2221
clocks = <&hfxo>, <&lfxo>;
2322
clock-names = "hfxo", "lfxo";
2423
};
@@ -34,9 +33,3 @@ properties:
3433
open-loop-accuracy-ppm:
3534
type: int
3635
description: Clock accuracy in parts per million if open-loop clock source is used.
37-
38-
closed-loop-base-accuracy-ppm:
39-
type: int
40-
description: |
41-
Base clock accuracy in parts per million if closed-loop clock source is used.
42-
The actual accuracy is this property plus the accuracy of the HFXO or LFXO.

dts/common/nordic/nrf54h20.dtsi

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,6 @@
177177
#clock-cells = <0>;
178178
clock-frequency = <DT_FREQ_M(16)>;
179179
open-loop-accuracy-ppm = <20000>;
180-
closed-loop-base-accuracy-ppm = <5000>;
181180
clocks = <&hfxo>, <&lfxo>;
182181
clock-names = "hfxo", "lfxo";
183182
};

0 commit comments

Comments
 (0)