From 9d780b0b81243c4f51f06db51f1e59bea2906cdb Mon Sep 17 00:00:00 2001 From: David Jewsbury Date: Mon, 1 Dec 2025 16:47:04 +0000 Subject: [PATCH 1/3] [nrf fromtree] dts: nrf9280: Update canpll to use frequency dts binding CANPLL was not using the frequency binding defined in nrf-auxpll.h Signed-off-by: David Jewsbury (cherry picked from commit 0e00299dcff841532c779cd443a718f0618fb2b0) --- dts/vendor/nordic/nrf9280.dtsi | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dts/vendor/nordic/nrf9280.dtsi b/dts/vendor/nordic/nrf9280.dtsi index 435e0db9d20d..da97b234a70a 100644 --- a/dts/vendor/nordic/nrf9280.dtsi +++ b/dts/vendor/nordic/nrf9280.dtsi @@ -11,6 +11,7 @@ #include #include #include +#include /delete-node/ &sw_pwm; @@ -443,7 +444,7 @@ clocks = <&hfxo>; #clock-cells = <0>; nordic,ficrs = <&ficr NRF_FICR_TRIM_GLOBAL_CANPLL_TRIM_CTUNE>; - nordic,frequency = <0>; + nordic,frequency = ; nordic,out-div = <2>; nordic,out-drive = <0>; nordic,current-tune = <6>; From 7257839024ea910c72e08a8d02b44ecffbf04240 Mon Sep 17 00:00:00 2001 From: David Jewsbury Date: Mon, 3 Nov 2025 11:47:43 +0000 Subject: [PATCH 2/3] [nrf fromtree] dts: bindings: clock: nrf-auxpll: add out-div binding It was previously possible to set output division setting to an invalid number. These bindings ensure a valid number is set of 0-8. Signed-off-by: David Jewsbury (cherry picked from commit 2a395ba0b9ec53e997666e9e7125391827d4cf06) --- dts/bindings/clock/nordic,nrf-auxpll.yaml | 18 +++++++++--------- dts/vendor/nordic/nrf54h20.dtsi | 2 +- dts/vendor/nordic/nrf9280.dtsi | 2 +- include/zephyr/dt-bindings/clock/nrf-auxpll.h | 10 ++++++++++ 4 files changed, 21 insertions(+), 11 deletions(-) diff --git a/dts/bindings/clock/nordic,nrf-auxpll.yaml b/dts/bindings/clock/nordic,nrf-auxpll.yaml index 9555995f0b4d..c9e4bf1c2379 100644 --- a/dts/bindings/clock/nordic,nrf-auxpll.yaml +++ b/dts/bindings/clock/nordic,nrf-auxpll.yaml @@ -48,15 +48,15 @@ properties: nordic,out-div: type: int enum: - - 1 - - 2 - - 3 - - 4 - - 6 - - 8 - - 12 - - 16 - description: PLL output divider. + - 1 # Division of 1 + - 2 # Division of 2 + - 3 # Division of 3 + - 4 # Division of 4 + - 5 # Division of 6 + - 6 # Division of 8 + - 7 # Division of 12 + - 8 # Division of 16 + description: PLL output divider. Valid values shown in dt-bindings/clock/nrf-auxpll.h. nordic,out-drive: type: int diff --git a/dts/vendor/nordic/nrf54h20.dtsi b/dts/vendor/nordic/nrf54h20.dtsi index 5998f6da0a0e..0bbe422c601b 100644 --- a/dts/vendor/nordic/nrf54h20.dtsi +++ b/dts/vendor/nordic/nrf54h20.dtsi @@ -686,7 +686,7 @@ #clock-cells = <0>; nordic,ficrs = <&ficr NRF_FICR_TRIM_GLOBAL_CANPLL_TRIM_CTUNE>; nordic,frequency = ; - nordic,out-div = <2>; + nordic,out-div = ; nordic,out-drive = <0>; nordic,current-tune = <6>; nordic,sdm-disable; diff --git a/dts/vendor/nordic/nrf9280.dtsi b/dts/vendor/nordic/nrf9280.dtsi index da97b234a70a..0d7f97290f3b 100644 --- a/dts/vendor/nordic/nrf9280.dtsi +++ b/dts/vendor/nordic/nrf9280.dtsi @@ -445,7 +445,7 @@ #clock-cells = <0>; nordic,ficrs = <&ficr NRF_FICR_TRIM_GLOBAL_CANPLL_TRIM_CTUNE>; nordic,frequency = ; - nordic,out-div = <2>; + nordic,out-div = ; nordic,out-drive = <0>; nordic,current-tune = <6>; nordic,sdm-disable; diff --git a/include/zephyr/dt-bindings/clock/nrf-auxpll.h b/include/zephyr/dt-bindings/clock/nrf-auxpll.h index a07c96997597..d40940b6a62f 100644 --- a/include/zephyr/dt-bindings/clock/nrf-auxpll.h +++ b/include/zephyr/dt-bindings/clock/nrf-auxpll.h @@ -13,4 +13,14 @@ #define NRF_AUXPLL_FREQ_DIV_AUDIO_48K 39845 #define NRF_AUXPLL_FREQ_DIV_MAX 65535 +#define NRF_AUXPLL_OUT_DIV_DISABLED 0 +#define NRF_AUXPLL_OUT_DIV_1 1 +#define NRF_AUXPLL_OUT_DIV_2 2 +#define NRF_AUXPLL_OUT_DIV_3 3 +#define NRF_AUXPLL_OUT_DIV_4 4 +#define NRF_AUXPLL_OUT_DIV_6 5 +#define NRF_AUXPLL_OUT_DIV_8 6 +#define NRF_AUXPLL_OUT_DIV_12 7 +#define NRF_AUXPLL_OUT_DIV_16 8 + #endif /* #define ZEPHYR_INCLUDE_DT_BINDINGS_CLOCK_NRF_AUXPLL_H_ */ From acdf67e3b28a85a09e9d7738ab7933b15c09e436 Mon Sep 17 00:00:00 2001 From: David Jewsbury Date: Mon, 1 Dec 2025 16:40:10 +0000 Subject: [PATCH 3/3] [nrf fromtree] drivers: nrf_auxpll: Add CHECK_DTS_BINDING_VS_MDK macro Macro added to compare the devicetree bindings against values in the MDK to clean up code and check out-div bindings. Signed-off-by: David Jewsbury (cherry picked from commit 6450eaab48757f2a9a43ce8b4b6dd740e3c84032) --- .../clock_control/clock_control_nrf_auxpll.c | 28 ++++++++++++------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/drivers/clock_control/clock_control_nrf_auxpll.c b/drivers/clock_control/clock_control_nrf_auxpll.c index d048f4ed1c7e..0aa4c059d964 100644 --- a/drivers/clock_control/clock_control_nrf_auxpll.c +++ b/drivers/clock_control/clock_control_nrf_auxpll.c @@ -20,16 +20,24 @@ /* Check dt-bindings match MDK frequency division definitions*/ -BUILD_ASSERT(NRF_AUXPLL_FREQ_DIV_MIN == NRF_AUXPLL_FREQUENCY_DIV_MIN, - "Different AUXPLL_FREQ_DIV_MIN definition in MDK and devicetree binding"); -BUILD_ASSERT(NRF_AUXPLL_FREQ_DIV_AUDIO_44K1 == NRF_AUXPLL_FREQUENCY_AUDIO_44K1, - "Different AUXPLL_FREQ_DIV_AUDIO_44K1 definition in MDK and devicetree binding"); -BUILD_ASSERT(NRF_AUXPLL_FREQ_DIV_USB24M == NRF_AUXPLL_FREQUENCY_USB_24M, - "Different AUXPLL_FREQ_DIV_USB24M definition in MDK and devicetree binding"); -BUILD_ASSERT(NRF_AUXPLL_FREQ_DIV_AUDIO_48K == NRF_AUXPLL_FREQUENCY_AUDIO_48K, - "Different AUXPLL_FREQ_DIV_AUDIO_48K definition in MDK and devicetree binding"); -BUILD_ASSERT(NRF_AUXPLL_FREQ_DIV_MAX == NRF_AUXPLL_FREQUENCY_DIV_MAX, - "Different AUXPLL_FREQ_DIV_MAX definition in MDK and devicetree binding"); +#define CHECK_DTS_BINDING_VS_MDK(dt, mdk) \ + BUILD_ASSERT((mdk) == (dt), \ + "Different " #mdk " definition in MDK and devicetree binding") + +CHECK_DTS_BINDING_VS_MDK(NRF_AUXPLL_FREQ_DIV_MIN, NRF_AUXPLL_FREQUENCY_DIV_MIN); +CHECK_DTS_BINDING_VS_MDK(NRF_AUXPLL_FREQ_DIV_AUDIO_44K1, NRF_AUXPLL_FREQUENCY_AUDIO_44K1); +CHECK_DTS_BINDING_VS_MDK(NRF_AUXPLL_FREQ_DIV_USB24M, NRF_AUXPLL_FREQUENCY_USB_24M); +CHECK_DTS_BINDING_VS_MDK(NRF_AUXPLL_FREQ_DIV_AUDIO_48K, NRF_AUXPLL_FREQUENCY_AUDIO_48K); +CHECK_DTS_BINDING_VS_MDK(NRF_AUXPLL_FREQ_DIV_MAX, NRF_AUXPLL_FREQUENCY_DIV_MAX); + +CHECK_DTS_BINDING_VS_MDK(NRF_AUXPLL_OUT_DIV_1, NRF_AUXPLL_CTRL_OUTSEL_DIV_1); +CHECK_DTS_BINDING_VS_MDK(NRF_AUXPLL_OUT_DIV_2, NRF_AUXPLL_CTRL_OUTSEL_DIV_2); +CHECK_DTS_BINDING_VS_MDK(NRF_AUXPLL_OUT_DIV_3, NRF_AUXPLL_CTRL_OUTSEL_DIV_3); +CHECK_DTS_BINDING_VS_MDK(NRF_AUXPLL_OUT_DIV_4, NRF_AUXPLL_CTRL_OUTSEL_DIV_4); +CHECK_DTS_BINDING_VS_MDK(NRF_AUXPLL_OUT_DIV_6, NRF_AUXPLL_CTRL_OUTSEL_DIV_6); +CHECK_DTS_BINDING_VS_MDK(NRF_AUXPLL_OUT_DIV_8, NRF_AUXPLL_CTRL_OUTSEL_DIV_8); +CHECK_DTS_BINDING_VS_MDK(NRF_AUXPLL_OUT_DIV_12, NRF_AUXPLL_CTRL_OUTSEL_DIV_12); +CHECK_DTS_BINDING_VS_MDK(NRF_AUXPLL_OUT_DIV_16, NRF_AUXPLL_CTRL_OUTSEL_DIV_16); /* maximum lock time in us, >10x time observed experimentally */ #define AUXPLL_LOCK_TIME_MAX_US 20000