soc: arm: nxp: kinetis: ke1xf: determine hw clock cycles/sec from dts

Determine the default CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC from devicetree
when using the Arm SysTick hardware timer.

When the NXP KE1xF SoC series is using the Arm SysTick as hardware
timer, the cycles/second will always be equal to the CPU core clock
frequency.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
This commit is contained in:
Henrik Brix Andersen 2021-07-05 20:43:48 +02:00 committed by Anas Nashif
commit 5fcb13aea3
3 changed files with 8 additions and 2 deletions

View file

@ -122,6 +122,10 @@
};
};
&cpu0 {
clock-frequency = <120000000>;
};
&sim {
clkout-source = <1>;
clkout-divider = <0>;

View file

@ -10,7 +10,6 @@ CONFIG_UART_CONSOLE=y
CONFIG_UART_INTERRUPT_DRIVEN=y
CONFIG_PINMUX=y
CONFIG_GPIO=y
CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=120000000
# Enable MPU
CONFIG_ARM_MPU=y

View file

@ -1,6 +1,6 @@
# Kinetis KE1xF series configuration options
# Copyright (c) 2019 Vestas Wind Systems A/S
# Copyright (c) 2019-2021 Vestas Wind Systems A/S
# SPDX-License-Identifier: Apache-2.0
if SOC_SERIES_KINETIS_KE1XF
@ -8,6 +8,9 @@ if SOC_SERIES_KINETIS_KE1XF
config SOC_SERIES
default "ke1xf"
config SYS_CLOCK_HW_CYCLES_PER_SEC
default $(dt_node_int_prop_int,/cpus/cpu@0,clock-frequency) if CORTEX_M_SYSTICK
config NUM_IRQS
# must be >= the highest interrupt number used
default 91