Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions boards/nordic/nrf54l15dk/Kconfig.defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@
DT_CHOSEN_Z_CODE_PARTITION := zephyr,code-partition
DT_CHOSEN_Z_SRAM_PARTITION := zephyr,sram-secure-partition

# The 54L has a HFXO latency which is better than the default.
config MPSL_HFCLK_LATENCY
int
default 854 if MPSL

if BOARD_NRF54L15DK_NRF54L05_CPUAPP || BOARD_NRF54L15DK_NRF54L10_CPUAPP || \
BOARD_NRF54L15DK_NRF54L15_CPUAPP

Expand Down
4 changes: 4 additions & 0 deletions boards/nordic/nrf54l15dk/nrf54l15dk_common.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -99,5 +99,9 @@
pinctrl-names = "default", "sleep";
};

&hfxo {
startup-time-us = <854>;
};

/* Get a node label for wi-fi spi to use in shield files */
wifi_spi: &spi22 {};
3 changes: 1 addition & 2 deletions drivers/clock_control/Kconfig.nrf
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,7 @@ endif # CLOCK_CONTROL_NRF_K32SRC_RC_CALIBRATION

config CLOCK_CONTROL_NRF_HFINT_CALIBRATION
bool "HFINT clock calibration"
depends on SOC_NRF54L05 || SOC_NRF54L10 || SOC_NRF54L15
depends on DT_HAS_NORDIC_NRF_HFXO_ENABLED
depends on DT_HAS_NORDIC_NRF54L_HFXO_ENABLED
depends on !TRUSTED_EXECUTION_NONSECURE
select EXPERIMENTAL
help
Expand Down
7 changes: 7 additions & 0 deletions drivers/clock_control/clock_control_nrf.c
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,13 @@ void z_nrf_clock_bt_ctlr_hf_release(void)
irq_unlock(key);
}

#if DT_NODE_EXISTS(DT_NODELABEL(hfxo))
uint32_t z_nrf_clock_bt_ctlr_hf_get_startup_time_us(void)
{
return DT_PROP(DT_NODELABEL(hfxo), startup_time_us);
}
#endif

static int stop(const struct device *dev, clock_control_subsys_t subsys,
uint32_t ctx)
{
Expand Down
9 changes: 9 additions & 0 deletions dts/arm/nordic/nrf51822.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,15 @@
};
};

clocks {
hfxo: hfxo {
compatible = "nordic,nrf51-hfxo";
clock-frequency = <16000000>;
startup-time-us = <1400>;
#clock-cells = <0>;
};
};

soc {
ficr: ficr@10000000 {
compatible = "nordic,nrf-ficr";
Expand Down
9 changes: 9 additions & 0 deletions dts/arm/nordic/nrf52805.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,15 @@
};
};

clocks {
hfxo: hfxo {
compatible = "nordic,nrf52-hfxo";
clock-frequency = <64000000>;
startup-time-us = <1400>;
#clock-cells = <0>;
};
};

soc {
ficr: ficr@10000000 {
compatible = "nordic,nrf-ficr";
Expand Down
9 changes: 9 additions & 0 deletions dts/arm/nordic/nrf52810.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,15 @@
};
};

clocks {
hfxo: hfxo {
compatible = "nordic,nrf52-hfxo";
clock-frequency = <64000000>;
startup-time-us = <1400>;
#clock-cells = <0>;
};
};

soc {
ficr: ficr@10000000 {
compatible = "nordic,nrf-ficr";
Expand Down
9 changes: 9 additions & 0 deletions dts/arm/nordic/nrf52811.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,15 @@
};
};

clocks {
hfxo: hfxo {
compatible = "nordic,nrf52-hfxo";
clock-frequency = <64000000>;
startup-time-us = <1400>;
#clock-cells = <0>;
};
};

soc {
ficr: ficr@10000000 {
compatible = "nordic,nrf-ficr";
Expand Down
9 changes: 9 additions & 0 deletions dts/arm/nordic/nrf52820.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,15 @@
};
};

clocks {
hfxo: hfxo {
compatible = "nordic,nrf52-hfxo";
clock-frequency = <64000000>;
startup-time-us = <1400>;
#clock-cells = <0>;
};
};

soc {
ficr: ficr@10000000 {
compatible = "nordic,nrf-ficr";
Expand Down
9 changes: 9 additions & 0 deletions dts/arm/nordic/nrf52832.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,15 @@
};
};

clocks {
hfxo: hfxo {
compatible = "nordic,nrf52-hfxo";
clock-frequency = <64000000>;
startup-time-us = <1400>;
#clock-cells = <0>;
};
};

soc {
ficr: ficr@10000000 {
compatible = "nordic,nrf-ficr";
Expand Down
9 changes: 9 additions & 0 deletions dts/arm/nordic/nrf52833.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,15 @@
};
};

clocks {
hfxo: hfxo {
compatible = "nordic,nrf52-hfxo";
clock-frequency = <64000000>;
startup-time-us = <1400>;
#clock-cells = <0>;
};
};

soc {
ficr: ficr@10000000 {
compatible = "nordic,nrf-ficr";
Expand Down
9 changes: 9 additions & 0 deletions dts/arm/nordic/nrf52840.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,15 @@
};
};

clocks {
hfxo: hfxo {
compatible = "nordic,nrf52-hfxo";
clock-frequency = <64000000>;
startup-time-us = <1400>;
#clock-cells = <0>;
};
};

soc {
ficr: ficr@10000000 {
compatible = "nordic,nrf-ficr";
Expand Down
1 change: 1 addition & 0 deletions dts/arm/nordic/nrf5340_cpuapp_peripherals.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ oscillators: clock-controller@4000 {
compatible = "nordic,nrf53-hfxo";
#clock-cells = <0>;
clock-frequency = <DT_FREQ_M(32)>;
startup-time-us = <1400>;
};
};

Expand Down
26 changes: 26 additions & 0 deletions dts/bindings/clock/nordic,nrf51-hfxo.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Copyright (c) 2025 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0

description: Nordic nRF high-frequency crystal oscillator (nRF51 series)

compatible: "nordic,nrf51-hfxo"

include: fixed-clock.yaml

properties:
clock-frequency:
const: 16000000

startup-time-us:
type: int
required: true
description: |
Startup time in microseconds.

The value can be obtained by first measuring the time between
TASKS_HFCLKSTART and EVENTS_HFCLKSTARTED. Then multiply
the value by 2 to account for temperature and supply variations.

Note that the startup time will be longer usual on the first
power-up and as such should not be used to determine
startup-time-us.
25 changes: 25 additions & 0 deletions dts/bindings/clock/nordic,nrf52-hfxo.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Copyright (c) 2025 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0

description: Nordic nRF high-frequency crystal oscillator (nRF52 series)

compatible: "nordic,nrf52-hfxo"

include: fixed-clock.yaml

properties:
clock-frequency:
const: 64000000

startup-time-us:
type: int
description: |
Startup time in microseconds.

The value can be obtained by first measuring the time between
TASKS_HFCLKSTART and EVENTS_HFCLKSTARTED. Then multiply
the value by 2 to account for temperature and supply variations.

Note that the startup time will be longer usual on the first
power-up and as such should not be used to determine
startup-time-us.
14 changes: 14 additions & 0 deletions dts/bindings/clock/nordic,nrf53-hfxo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,20 @@ properties:
clock-frequency:
const: 32000000

startup-time-us:
type: int
required: true
description: |
Startup time in microseconds.

The value can be obtained by first measuring the time between
TASKS_HFCLKSTART and EVENTS_HFCLKSTARTED. Then multiply
the value by 2 to account for temperature and supply variations.

Note that the startup time will be longer usual on the first
power-up and as such should not be used to determine
startup-time-us.

load-capacitors:
type: string
enum:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,30 @@
# Copyright (c) 2024 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0

description: Nordic nRF high-frequency crystal oscillator
description: Nordic nRF high-frequency crystal oscillator (nRF54L series)

compatible: "nordic,nrf-hfxo"
compatible: "nordic,nrf54l-hfxo"

include: fixed-clock.yaml

properties:
clock-frequency:
const: 32000000

startup-time-us:
type: int
required: true
description: |
Startup time in microseconds.

The value can be obtained by first measuring the time between
TASKS_XOSTART and EVENTS_XOTUNED. Then multiply the value by 2 to
account for temperature and supply variations.

Note that the startup time will be longer usual on the first
power-up and as such should not be used to determine
startup-time-us.

load-capacitors:
type: string
enum:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Copyright (c) 2024 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0

description: Nordic nRF low-frequency crystal oscillator
description: Nordic nRF low-frequency crystal oscillator (nRF54L series)

compatible: "nordic,nrf-lfxo"
compatible: "nordic,nrf54l-lfxo"

include: fixed-clock.yaml

Expand Down
5 changes: 3 additions & 2 deletions dts/common/nordic/nrf54l09.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,16 @@
};

lfxo: lfxo {
compatible = "nordic,nrf-lfxo";
compatible = "nordic,nrf54l-lfxo";
#clock-cells = <0>;
clock-frequency = <32768>;
};

hfxo: hfxo {
compatible = "nordic,nrf-hfxo";
compatible = "nordic,nrf54l-hfxo";
#clock-cells = <0>;
clock-frequency = <DT_FREQ_M(32)>;
startup-time-us = <1650>;
};

hfpll: hfpll {
Expand Down
5 changes: 3 additions & 2 deletions dts/common/nordic/nrf54l20.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,16 @@
};

lfxo: lfxo {
compatible = "nordic,nrf-lfxo";
compatible = "nordic,nrf54l-lfxo";
#clock-cells = <0>;
clock-frequency = <32768>;
};

hfxo: hfxo {
compatible = "nordic,nrf-hfxo";
compatible = "nordic,nrf54l-hfxo";
#clock-cells = <0>;
clock-frequency = <DT_FREQ_M(32)>;
startup-time-us = <1650>;
};

hfpll: hfpll {
Expand Down
5 changes: 3 additions & 2 deletions dts/common/nordic/nrf54l_05_10_15.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,16 @@
};

lfxo: lfxo {
compatible = "nordic,nrf-lfxo";
compatible = "nordic,nrf54l-lfxo";
#clock-cells = <0>;
clock-frequency = <32768>;
};

hfxo: hfxo {
compatible = "nordic,nrf-hfxo";
compatible = "nordic,nrf54l-hfxo";
#clock-cells = <0>;
clock-frequency = <DT_FREQ_M(32)>;
startup-time-us = <1650>;
};

hfpll: hfpll {
Expand Down
7 changes: 7 additions & 0 deletions include/zephyr/drivers/clock_control/nrf_clock_control.h
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,13 @@ void z_nrf_clock_bt_ctlr_hf_request(void);
*/
void z_nrf_clock_bt_ctlr_hf_release(void);

/**
* @brief Get clock startup time
*
* @retval HFCLK startup time in microseconds
*/
uint32_t z_nrf_clock_bt_ctlr_hf_get_startup_time_us(void);

#endif /* defined(CONFIG_CLOCK_CONTROL_NRF) */


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ static bool hfclk_is_running;

void nrf_802154_clock_init(void)
{
/* Intentionally empty. */
#ifdef NRF54L_SERIES
uint32_t clock_latency_us = z_nrf_clock_bt_ctlr_hf_get_startup_time_us();

nrf_802154_clock_hfclk_latency_set(clock_latency_us);
#endif
}

void nrf_802154_clock_deinit(void)
Expand Down
Loading