Skip to content

dts: nordic: add auxpll bindings #90401

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
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
19 changes: 18 additions & 1 deletion drivers/clock_control/clock_control_nrf_auxpll.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,16 @@
#include <zephyr/toolchain.h>

#include <hal/nrf_auxpll.h>
#include <zephyr/dt-bindings/clock/nrf-auxpll.h>

/* Check dt-bindings match MDK frequency division definitions*/
BUILD_ASSERT( \

Check warning on line 23 in drivers/clock_control/clock_control_nrf_auxpll.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

LINE_CONTINUATIONS

drivers/clock_control/clock_control_nrf_auxpll.c:23 Avoid unnecessary line continuations
NRF_AUXPLL_FREQ_DIV_MIN == NRF_AUXPLL_FREQUENCY_DIV_MIN && \

Check warning on line 24 in drivers/clock_control/clock_control_nrf_auxpll.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

SPACE_BEFORE_TAB

drivers/clock_control/clock_control_nrf_auxpll.c:24 please, no space before tabs
NRF_AUXPLL_FREQ_DIV_AUDIO_44K1 == NRF_AUXPLL_FREQUENCY_AUDIO_44K1 && \

Check warning on line 25 in drivers/clock_control/clock_control_nrf_auxpll.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

SPACE_BEFORE_TAB

drivers/clock_control/clock_control_nrf_auxpll.c:25 please, no space before tabs
NRF_AUXPLL_FREQ_DIV_USB24M == NRF_AUXPLL_FREQUENCY_USB_24M && \

Check warning on line 26 in drivers/clock_control/clock_control_nrf_auxpll.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

SPACE_BEFORE_TAB

drivers/clock_control/clock_control_nrf_auxpll.c:26 please, no space before tabs
NRF_AUXPLL_FREQ_DIV_AUDIO_48K == NRF_AUXPLL_FREQUENCY_AUDIO_48K && \

Check warning on line 27 in drivers/clock_control/clock_control_nrf_auxpll.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

SPACE_BEFORE_TAB

drivers/clock_control/clock_control_nrf_auxpll.c:27 please, no space before tabs
NRF_AUXPLL_FREQ_DIV_MAX == NRF_AUXPLL_FREQUENCY_DIV_MAX, \
"Different AUXPLL frequency definitions in MDK and devicetree bindings");

/* maximum lock time in ms, >10x time observed experimentally */
#define AUXPLL_LOCK_TIME_MAX_MS 20
Expand All @@ -28,7 +38,7 @@
uint32_t ref_clk_hz;
uint32_t ficr_ctune;
nrf_auxpll_config_t cfg;
uint16_t frequency;
nrf_auxpll_freq_div_ratio_t frequency;
nrf_auxpll_ctrl_outsel_t out_div;
};

Expand Down Expand Up @@ -124,6 +134,13 @@
}

#define CLOCK_CONTROL_NRF_AUXPLL_DEFINE(n) \
BUILD_ASSERT( \
DT_INST_PROP(n, nordic_frequency) == NRF_AUXPLL_FREQUENCY_DIV_MIN || \
DT_INST_PROP(n, nordic_frequency) == NRF_AUXPLL_FREQUENCY_AUDIO_44K1|| \

Check failure on line 139 in drivers/clock_control/clock_control_nrf_auxpll.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

SPACING

drivers/clock_control/clock_control_nrf_auxpll.c:139 spaces required around that '||' (ctx:VxE)
DT_INST_PROP(n, nordic_frequency) == NRF_AUXPLL_FREQUENCY_USB_24M || \
DT_INST_PROP(n, nordic_frequency) == NRF_AUXPLL_FREQUENCY_AUDIO_48K || \
DT_INST_PROP(n, nordic_frequency) == NRF_AUXPLL_FREQUENCY_DIV_MAX, \
"Invalid nordic,frequency value in DeviceTree for AUXPLL instance " #n); \
static const struct clock_control_nrf_auxpll_config config##n = { \
.auxpll = (NRF_AUXPLL_Type *)DT_INST_REG_ADDR(n), \
.ref_clk_hz = DT_PROP(DT_INST_CLOCKS_CTLR(n), clock_frequency), \
Expand Down
2 changes: 1 addition & 1 deletion dts/bindings/clock/nordic,nrf-auxpll.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ properties:
required: true
description: |
Value used to set the fractional PLL divider ratio (can be set between
divider ratios 4 to 5). Valid values range from 0 to 65535.
divider ratios 4 to 5). Valid values shown in dt-bindings/clock/nrf-auxpll.h.

nordic,out-div:
type: int
Expand Down
3 changes: 2 additions & 1 deletion dts/vendor/nordic/nrf54h20.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

#include <zephyr/dt-bindings/adc/nrf-saadc-haltium.h>
#include <zephyr/dt-bindings/clock/nrfs-audiopll.h>
#include <zephyr/dt-bindings/clock/nrf-auxpll.h>
#include <zephyr/dt-bindings/misc/nordic-nrf-ficr-nrf54h20.h>
#include <zephyr/dt-bindings/misc/nordic-domain-id-nrf54h20.h>
#include <zephyr/dt-bindings/misc/nordic-owner-id-nrf54h20.h>
Expand Down Expand Up @@ -558,7 +559,7 @@
clocks = <&hfxo>;
#clock-cells = <0>;
nordic,ficrs = <&ficr NRF_FICR_TRIM_GLOBAL_CANPLL_TRIM_CTUNE>;
nordic,frequency = <0>;
nordic,frequency = <NRF_AUXPLL_FREQ_MIN>;
nordic,out-div = <2>;
nordic,out-drive = <0>;
nordic,current-tune = <6>;
Expand Down
16 changes: 16 additions & 0 deletions include/zephyr/dt-bindings/clock/nrf-auxpll.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/*
* Copyright (c) 2025 Nordic Semiconductor ASA
* SPDX-License-Identifier: Apache-2.0
*/


#ifndef ZEPHYR_INCLUDE_DT_BINDINGS_CLOCK_NRF_AUXPLL_H_
#define ZEPHYR_INCLUDE_DT_BINDINGS_CLOCK_NRF_AUXPLL_H_

#define NRF_AUXPLL_FREQ_DIV_MIN 0
#define NRF_AUXPLL_FREQ_DIV_AUDIO_44K1 15309
#define NRF_AUXPLL_FREQ_DIV_USB24M 32768
#define NRF_AUXPLL_FREQ_DIV_AUDIO_48K 39845
#define NRF_AUXPLL_FREQ_DIV_MAX 65535

#endif /* #define ZEPHYR_INCLUDE_DT_BINDINGS_CLOCK_NRF_AUXPLL_H_ */
Loading