Skip to content

Commit f94c6f2

Browse files
bjarki-andreasenfabiobaltieri
authored andcommitted
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. Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
1 parent 53e751d commit f94c6f2

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,7 +21,7 @@ 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
#define FLL16M_MODE_LOOP_MASK BIT(0)
@@ -33,7 +33,6 @@ BUILD_ASSERT(FLL16M_MODE_CLOSED_LOOP == NRF_LRCCONF_CLK_SRC_CLOSED_LOOP);
3333

3434
#define FLL16M_HFXO_ACCURACY DT_PROP(FLL16M_HFXO_NODE, accuracy_ppm)
3535
#define FLL16M_OPEN_LOOP_ACCURACY DT_INST_PROP(0, open_loop_accuracy_ppm)
36-
#define FLL16M_CLOSED_LOOP_BASE_ACCURACY DT_INST_PROP(0, closed_loop_base_accuracy_ppm)
3736
#define FLL16M_MAX_ACCURACY FLL16M_HFXO_ACCURACY
3837

3938
#define BICR (NRF_BICR_Type *)DT_REG_ADDR(DT_NODELABEL(bicr))
@@ -47,9 +46,6 @@ static struct clock_options {
4746
.accuracy = FLL16M_OPEN_LOOP_ACCURACY,
4847
.mode = FLL16M_MODE_OPEN_LOOP,
4948
},
50-
{
51-
.mode = FLL16M_MODE_CLOSED_LOOP,
52-
},
5349
{
5450
/* Bypass mode uses HFXO */
5551
.accuracy = FLL16M_HFXO_ACCURACY,
@@ -229,27 +225,6 @@ static int api_get_rate_fll16m(const struct device *dev,
229225
static int fll16m_init(const struct device *dev)
230226
{
231227
struct fll16m_dev_data *dev_data = dev->data;
232-
nrf_bicr_lfosc_mode_t lfosc_mode;
233-
234-
clock_options[1].accuracy = FLL16M_CLOSED_LOOP_BASE_ACCURACY;
235-
236-
/* Closed-loop mode uses LFXO as source if present, HFXO otherwise */
237-
lfosc_mode = nrf_bicr_lfosc_mode_get(BICR);
238-
239-
if (lfosc_mode != NRF_BICR_LFOSC_MODE_UNCONFIGURED &&
240-
lfosc_mode != NRF_BICR_LFOSC_MODE_DISABLED) {
241-
int ret;
242-
uint16_t accuracy;
243-
244-
ret = lfosc_get_accuracy(&accuracy);
245-
if (ret < 0) {
246-
return ret;
247-
}
248-
249-
clock_options[1].accuracy += accuracy;
250-
} else {
251-
clock_options[1].accuracy += FLL16M_HFXO_ACCURACY;
252-
}
253228

254229
return clock_config_init(&dev_data->clk_cfg,
255230
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/vendor/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)