Revert "kernel: retrieve system timer clock frequency at runtime or static"

This reverts commit 7c03e5de7f.

https://github.com/zephyrproject-rtos/zephyr/pull/69705
Introduced a regression in main in which
tests/subsys/logging/log_timestamp
started failing. (See
https://github.com/zephyrproject-rtos/zephyr/issues/72344
for more info).
Let's revert the PR. It can be submitted after with the issue
fixed.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
This commit is contained in:
Alberto Escolar Piedras 2024-05-06 10:57:02 +02:00 committed by Johan Hedberg
parent 33c253c813
commit 2f5e93938b
3 changed files with 5 additions and 6 deletions

View File

@ -146,9 +146,9 @@ typedef struct {
/** @endcond */
#if defined(CONFIG_SYS_CLOCK_EXISTS) && !defined(CONFIG_TIMER_READS_ITS_FREQUENCY_AT_RUNTIME)
BUILD_ASSERT(CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC != 0,
"SYS_CLOCK_HW_CYCLES_PER_SEC must be non-zero!");
#if defined(CONFIG_SYS_CLOCK_EXISTS) && \
(CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC == 0)
#error "SYS_CLOCK_HW_CYCLES_PER_SEC must be non-zero!"
#endif
@ -164,7 +164,7 @@ BUILD_ASSERT(CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC != 0,
* @{
*/
#if defined(CONFIG_SYS_CLOCK_EXISTS) && !defined(CONFIG_TIMER_READS_ITS_FREQUENCY_AT_RUNTIME)
#ifdef CONFIG_SYS_CLOCK_EXISTS
#if defined(CONFIG_TIMER_READS_ITS_FREQUENCY_AT_RUNTIME) || \
(MSEC_PER_SEC % CONFIG_SYS_CLOCK_TICKS_PER_SEC) || \

View File

@ -799,7 +799,6 @@ config SYS_CLOCK_TICKS_PER_SEC
config SYS_CLOCK_HW_CYCLES_PER_SEC
int "System clock's h/w timer frequency"
depends on !TIMER_READS_ITS_FREQUENCY_AT_RUNTIME
help
This option specifies the frequency of the hardware timer used for the
system clock (in Hz). This option is set by the SOC's or board's Kconfig file

View File

@ -25,7 +25,7 @@ static struct k_spinlock timeout_lock;
static int announce_remaining;
#if defined(CONFIG_TIMER_READS_ITS_FREQUENCY_AT_RUNTIME)
int z_clock_hw_cycles_per_sec;
int z_clock_hw_cycles_per_sec = CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC;
#ifdef CONFIG_USERSPACE
static inline int z_vrfy_sys_clock_hw_cycles_per_sec_runtime_get(void)