soc: nxp: s32k1: obtain system clock freq from dt

In S32K1 devices, Arm Systick clock frequency is equal to the
CPU core clock frequency, and its value can be obtained from
devicetree.

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
This commit is contained in:
Manuel Argüelles 2024-07-22 17:43:12 +07:00 committed by Anas Nashif
commit a8ebb05506
4 changed files with 6 additions and 5 deletions

View file

@ -98,6 +98,10 @@
}; };
}; };
&cpu0 {
clock-frequency = <80000000>;
};
&gpioa { &gpioa {
status = "okay"; status = "okay";
}; };

View file

@ -3,9 +3,6 @@
CONFIG_BUILD_OUTPUT_HEX=y CONFIG_BUILD_OUTPUT_HEX=y
# Use Systick as system clock
CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=80000000
# Run from internal program flash # Run from internal program flash
CONFIG_XIP=y CONFIG_XIP=y

View file

@ -17,7 +17,7 @@
#address-cells = <1>; #address-cells = <1>;
#size-cells = <0>; #size-cells = <0>;
cpu@0 { cpu0: cpu@0 {
device_type = "cpu"; device_type = "cpu";
reg = <0>; reg = <0>;
}; };

View file

@ -6,7 +6,7 @@
if SOC_SERIES_S32K1 if SOC_SERIES_S32K1
config SYS_CLOCK_HW_CYCLES_PER_SEC config SYS_CLOCK_HW_CYCLES_PER_SEC
default 80000000 default $(dt_node_int_prop_int,/cpus/cpu@0,clock-frequency) if CORTEX_M_SYSTICK
config NUM_IRQS config NUM_IRQS
default 239 if CPU_CORTEX_M4 default 239 if CPU_CORTEX_M4