Skip to content

Commit d91558a

Browse files
committed
[nrf fromtree] dts: common: nordic: nrf54l: Add clocks to cpu
Add clocks property to CPUs. nRF54Lx series is using hfpll as clock source for CPU (and fast peripherals). CPU clock frequency can be derived from frequency of the source clock so clock-frequency property is removed from cpu as it is redundant. nrfx/MDK expects that NRF_CONFIG_CPU_FREQ_MHZ define is set to correct CPU frequency. Modified nrfx CMakeLists.txt to use clock frequency of hfpll instead of CPU clock-frequency property. Signed-off-by: Krzysztof Chruściński <[email protected]> (cherry picked from commit 43f442b)
1 parent e9d74f6 commit d91558a

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

dts/common/nordic/nrf54l09.dtsi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
compatible = "arm,cortex-m33f";
2828
reg = <0>;
2929
device_type = "cpu";
30-
clock-frequency = <DT_FREQ_M(64)>;
30+
clocks = <&hfpll>;
3131
#address-cells = <1>;
3232
#size-cells = <1>;
3333
itm: itm@e0000000 {

dts/common/nordic/nrf54l20.dtsi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
compatible = "arm,cortex-m33f";
2424
reg = <0>;
2525
device_type = "cpu";
26-
clock-frequency = <DT_FREQ_M(128)>;
26+
clocks = <&hfpll>;
2727
#address-cells = <1>;
2828
#size-cells = <1>;
2929
itm: itm@e0000000 {

dts/common/nordic/nrf54l_05_10_15.dtsi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
compatible = "arm,cortex-m33f";
2828
reg = <0>;
2929
device_type = "cpu";
30-
clock-frequency = <DT_FREQ_M(128)>;
30+
clocks = <&hfpll>;
3131
#address-cells = <1>;
3232
#size-cells = <1>;
3333
itm: itm@e0000000 {
@@ -41,7 +41,7 @@
4141
compatible = "nordic,vpr";
4242
reg = <1>;
4343
device_type = "cpu";
44-
clock-frequency = <DT_FREQ_M(128)>;
44+
clocks = <&hfpll>;
4545
riscv,isa = "rv32emc";
4646
nordic,bus-width = <32>;
4747
};

modules/hal_nordic/nrfx/CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,10 @@ if(DEFINED uicr_path)
183183
endif()
184184

185185
if(CONFIG_SOC_NRF54L_CPUAPP_COMMON)
186-
dt_prop(clock_frequency PATH "/cpus/cpu@0" PROPERTY "clock-frequency")
186+
# Ideally, hfpll should taken as a phandle from clocks property from cpu but it
187+
# seems that there is no such option in DT cmake functions. Assuming that nrf54l
188+
# is using hfpll as CPU clock source (true for all existing devices).
189+
dt_prop(clock_frequency PATH "/clocks/hfpll" PROPERTY "clock-frequency")
187190
math(EXPR clock_frequency_mhz "${clock_frequency} / 1000000")
188191
zephyr_compile_definitions("NRF_CONFIG_CPU_FREQ_MHZ=${clock_frequency_mhz}")
189192
endif()

0 commit comments

Comments
 (0)