This commit add a system timer driver for Renesas RX using the CMT peripheral. The driver supports both system ticks and high-resolution cycle counting - Configures CMT0 as the system tick timer - Configures CMT1 as a free-running cycle timer for precise time tracking - Handles timer overflows to maintain a continuous cycle count. - Implements sys_clock_cycle_get_32() and sys_clock_cycle_get_64() for high-resolution timing - Supports Zephyr tickless kernel mode by tracking elapsed cycles - Enables interrupt-based tick announcement using CMT0 Signed-off-by: Duy Nguyen <duy.nguyen.xa@renesas.com> Signed-off-by: Yuichi Nakada <yuichi.nakada.sx@renesas.com>
20 lines
539 B
Text
20 lines
539 B
Text
# Copyright (c) 2024 Renesas Electronics Corporation
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
if SOC_SERIES_RX62N
|
|
|
|
DT_CMT_PATH := $(dt_nodelabel_path,cmt)
|
|
|
|
config SYS_CLOCK_HW_CYCLES_PER_SEC
|
|
default $(dt_node_int_prop_int,$(DT_CMT_PATH),clock-frequency)
|
|
|
|
# SYS_CLOCK_TICKS_PER_SEC is set to 100 if PCLKB is 48MHz or less.
|
|
# (PCLKB = SYS_CLOCK_HW_CYCLES_PER_SEC * 8)
|
|
config SYS_CLOCK_TICKS_PER_SEC
|
|
default 100 if SYS_CLOCK_HW_CYCLES_PER_SEC <= 6000000
|
|
default 10000
|
|
|
|
config INITIALIZATION_STACK_SIZE
|
|
default 512
|
|
|
|
endif # SOC_SERIES_RX62N
|