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 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 435e0db9d20d..0d7f97290f3b 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,8 +444,8 @@ clocks = <&hfxo>; #clock-cells = <0>; nordic,ficrs = <&ficr NRF_FICR_TRIM_GLOBAL_CANPLL_TRIM_CTUNE>; - nordic,frequency = <0>; - nordic,out-div = <2>; + nordic,frequency = ; + 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_ */