Commit graph zephyr/drivers/counter/Kconfig
Author SHA1 Message Date
Mike J. Chen
f4a209c7ea drivers: counter: add support for ARM CRSAS-MA2
This adds support for ARM Corstone System Architecture Specification Ma2
(ARM CRSAS-MA2) System Counter and System Timer.

The HW consists of one 64-byt System Counter, and any number
of System Timers that have match registers to generate interrupts
based on the value of the System Counter.

The timers don't have any counter/timer of their own, meaning that
System Counter can't be started or stopped independently if there is an
enabled System Timer.

Add the crsas-ma2 timer to the test for counters.

Signed-off-by: Mike J. Chen <mjchen@google.com>
Signed-off-by: Krystian Hebel <khebel@antmicro.com>
2026-08-05 18:38:18 +01:00
Soumya Tripathy
3e731cd14e drivers: counter: revert init priority increase
Commit bbda65a ("drivers: counter: increase COUNTER_INIT_PRIORITY")
raised COUNTER_INIT_PRIORITY from KERNEL_INIT_PRIORITY_DEVICE (50) to
60 to guarantee counter devices initialize before bus-dependent devices
sharing the same default priority.

Revert to KERNEL_INIT_PRIORITY_DEVICE and remove the BUILD_ASSERT in
the RTC counter driver that enforced RTC_INIT_PRIORITY >
COUNTER_INIT_PRIORITY, as both now default to the same value with
ordering guaranteed by DT sub-priority.

Signed-off-by: Soumya Tripathy <s-tripathy@ti.com>
2026-07-27 11:37:43 -07:00
Satya Sri
cf7886b903 drivers: counter: Add TTC (Triple Timer Counter) driver
The TTC provides three independent hardware counters supporting
free-running and interval modes, accessed via MMIO registers.

This driver implements the Zephyr counter API, including start/stop,
read, alarm, and top value configuration. Alarm events are delivered
using match interrupts.

Dynamic IRQ connection is used to support platforms where multiple
TTC counter instances share the same interrupt line. Each IRQ is
registered only once at runtime, and the ISR dispatches pending
events to all TTC instances mapped to that interrupt, ensuring correct
handling for both shared and dedicated interrupt configurations.

Signed-off-by: Satya Sri <satyasri.katru@amd.com>
2026-07-15 19:01:27 -04:00
Holt Sun
b25b70cec7 drivers: counter: add NXP TSTMR counter driver
Add a counter driver for the NXP Time Stamp Timer (TSTMR), a 56-bit
free-running, read-only up-counter. The driver exposes it through the
Zephyr counter API (get_value/get_value_64 and get_freq); start/stop,
alarm, and top-value operations are unsupported as the hardware is
free-running with no compare or interrupt capability.

The frequency is SoC-specific and taken from the clock-frequency
devicetree property. A coherent 56-bit read is obtained by sampling the
low/high registers twice under an IRQ lock and handling low-word
rollover.

Add the binding, Kconfig, and build glue.

Signed-off-by: Holt Sun <holt.sun@nxp.com>
2026-07-01 05:35:57 -04:00
minyuan xue
0f66ecd398 drivers: counter: add ameba counter driver
Add realtek ameba counter driver.

Signed-off-by: minyuan xue <minyuan_xue@realsil.com.cn>
2026-07-01 05:21:51 -04:00
Benjamin Cabé
6c09c97555 drivers: counter: remove legacy DS3231 driver
Remove the deprecated counter-based Maxim DS3231 driver and its
dedicated API, binding, sample, and test coverage.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-06-25 10:28:27 -07:00
Harini T
e77c781620 drivers: counter: add Xilinx ZynqMP RTC driver
Add a counter driver for the Xilinx Zynq Ultrascale+ MPSoC Real Time
Clock. The hardware provides a 32-bit seconds counter driven by an
external crystal oscillator, one alarm channel, and a calibration
register with integer and fractional tick adjustment.

The driver implements the Zephyr counter API and is intended to be used
with the rtc_counter wrapper to expose the standard RTC API.

The RTC oscillator runs continuously so start() and stop() return
-ENOTSUP. Calibration support is gated by CONFIG_COUNTER_CALIBRATION.

Signed-off-by: Harini T <harini.t@amd.com>
2026-06-24 13:55:01 -04:00
Harini T
ff3a0697b3 drivers: counter: add calibration API
Add optional set_calibration/get_calibration operations to the counter
driver API. Calibration is specified in parts per billion (ppb). The
operations are gated behind CONFIG_COUNTER_CALIBRATION and return
-ENOSYS if not implemented by the driver.

Signed-off-by: Harini T <harini.t@amd.com>
2026-06-24 13:55:01 -04:00
Zhaoxiang Jin
5364f764c4 drivers: counter: add irtc counter driver
add irtc counter driver

Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
2026-06-23 08:36:08 +02:00
Holt Sun
40d4cc9180 drivers: counter: add MCUX wake timer driver
Add a counter driver for the MCUX wake timer. The hardware is a
one-shot down-counter with one load/count register, so the driver
uses the register either for periodic top handling or for relative
single-shot alarms.

Absolute alarms are reported as unsupported because programming an
alarm reloads the hardware counter and changes the value space that
an absolute target would be measured against. Clear stale pending IRQ
state around start, stop, cancel, and alarm setup.

Built and ran tests/drivers/counter/counter_basic_api on frdm_mcxa153
with CONFIG_COUNTER_MCUX_WAKE_TIMER_ALARM=y.

Signed-off-by: Holt Sun <holt.sun@nxp.com>
2026-06-15 10:22:32 +02:00
Sunil Hegde
7481269d3c drivers: counter: k3_rtc: Add TI RTC driver for K3
This commit adds the counter RTC driver used in TI k3
devices.

Signed-off-by: Sunil Hegde <s-hegde3@ti.com>
2026-05-18 15:15:48 +01:00
Felix Wang
3e24271ad5 drivers: counter: add NXP MCUX SYS_CTR driver
Add a Zephyr counter driver for the NXP MCUXpresso System Counter
(SYS_CTR). The driver supports:
- 56-bit free-running up-counter
- Selectable clock source: 24 MHz base clock or 32 kHz slow clock
- Two compare frames (alarm channels) with a shared interrupt
- Standard Zephyr counter alarm API

Signed-off-by: Felix Wang <fei.wang_3@nxp.com>
2026-05-14 15:13:33 +02:00
Ryan McClelland
1bc5f0543c drivers: counter: introduce counter capture api
This introduces APIs for input capture.

A use case for this would be time stamping a rising and/or falling edge
where precision and lack of jitter is important. The only way to currently
do this in zephyr is to set up a GPIO interrupt and then read the counter
or kernel time... but this can have limitations of software such as the
processor may have a lot going on and can be subject to interrupt
latencies. Having a hardware 'latch' done of the rising and/or falling
edge with respect to a timer can eliminate these imprecisions.

How this is to be used, is that an application is to call
`capture_callback_set` with the configuration of the channel number, flags
(such as falling, rising, or both edges), and then a callback function.
Then the `capture_enable` function is to be called to enable this. The
callback has the timestamp of the edge in ticks and the edge that it
captured (rising or falling).

This also adds a 64 bit tick version for the capture callback.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2026-05-07 18:02:21 -05:00
Yuzhuo Liu
07ea4c7f5e drivers: counter: rtc: add Realtek Bee series support
Add counter RTC driver support for Realtek Bee series SoCs,
including RTL87x2G and RTL8752H.

This driver supports:
- Basic counter operations
- Alarm configuration and callbacks

Signed-off-by: Yuzhuo Liu <yuzhuo_liu@realsil.com.cn>
2026-04-16 11:38:00 -05:00
Yuzhuo Liu
66feaaf25f drivers: counter: add Realtek Bee series driver
Add counter timer driver support for Realtek Bee series SoCs,
including RTL87x2G and RTL8752H.

This driver is based on the hardware timer and supports:
- Relative alarm configuration
- Top value configuration

Signed-off-by: Yuzhuo Liu <yuzhuo_liu@realsil.com.cn>
2026-03-18 18:22:17 +09:00
William Markezana
6c2b586f2f drivers: counter: add Bouffalo Lab timer and rtc drivers
Add counter drivers for Bouffalo Lab SoCs:
- GP timer driver with 2 alarm channels, configurable clock source,
  and software cycle tracking for SoCs without hardware counter clear
- RTC counter driver exposing the always-on 32 kHz HBN RTC

Signed-off-by: William Markezana <william.markezana@gmail.com>
2026-03-16 08:59:13 +01:00
Shontal Biton
4f66943327 drivers: counter: Add counter driver for BURTC in Silabs s2 and s3
Add support for using BURTC as regular counter,
without overriding the sleeptimer.

Signed-off-by: Shontal Biton <shontal1005@gmail.com>
2026-02-23 11:32:26 +00:00
Ryan McClelland
7fc848153c drivers: counter: add kconfig for enabling 64b tick api
Add a kconfig to be used as a flag for indicating if it supports 64b
ticks and another flag which will enable the 64b api. The kconfig
indicating that it supports 64b is a dependency of the kconfig that
will enable the api.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2026-01-27 10:49:43 +00:00
Ryan McClelland
779383e769 drivers: counter: add 64bit apis
Add apis for 64 bits.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2026-01-27 10:49:43 +00:00
Ryan McClelland
fd72085d9b drivers: counter: add kconfig for enabling 64b frequencies
Some counters, such as those that use fractional adders, tick at
resolutions greater than 4294967295Hz. This changes the freq in the common
info to a uint64_t. This adds a KConfig that can be selected by a driver.

This also has the counter ticks to sec (and vice versa) helper functions
call the get frequency for 64 bits if the kconfig is selected.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2026-01-27 10:49:43 +00:00
Jan Behrens
2f654b6e14 drivers: counter: Added RPI Pico PIT counter driver
Added a counter driver for the RPI Pico/RP2040 that implements
programmable interval timer (PIT) functionality using the PWM HAL.

Signed-off-by: Jan Behrens <jan.behrens@navimatix.de>
2026-01-05 11:38:13 +01:00
Muhammed Asif
f58e1a3098 drivers: counter: microchip: Add TCC G1 driver
- Adds support for g1 counter driver with tcc peripheral

Signed-off-by: Muhammed Asif <muhammed.asif@microchip.com>
2026-01-02 09:57:06 +00:00
CHEN Xing
14b2a1dfa2 drivers: counter: add support for sama7g54 PIT64B
Add driver for sama7g54 PIT64B
Use PIT64B as a zephyr counter device

Signed-off-by: CHEN Xing <xing.chen@microchip.com>
2025-12-15 07:30:40 -05:00
Sreeram Tatapudi
5ecf248ba3 drivers: infineon: Drop cat1 from the files names
Drop cat1 from the file names to enable reuse by other
category devices as well

Signed-off-by: Sreeram Tatapudi <sreeram.praveen@infineon.com>
2025-12-07 21:19:38 -05:00
Stoyan Bogdanov
5028aa4036 drivers: counter: rv3032c7: Add rv3032 counter driver
Expose timer functionality from rv-3032-c7 via counter api.
I2C communication and IRQs are arbitrated via MFD parent driver
for rtc, sensor and counter at once.

Signed-off-by: Stoyan Bogdanov <sbogdanov@baylibre.com>
2025-12-02 15:20:56 -05:00
Josuah Demangeon
30950b888d style: drivers: sort Kconfig and CMake includes
Use the "zephyr-keep-sorted-start/stop" comment to have CI check
the alphabetical order of includes, to help reducing the chance
of conflicts while contributing drivers.

Signed-off-by: Josuah Demangeon <me@josuah.net>
2025-11-17 13:48:03 -05:00
Tom Chang
1a8e7f3005 drivers: counter: npcx: add support for lct counter driver
This commit enables configuration and integration of LCT counter by
including relevant source and kconfig files.

Signed-off-by: Jun Lin <CHLin56@nuvoton.com>
Signed-off-by: Tom Chang <CHChang19@nuvoton.com>
2025-11-13 20:45:41 -05:00
Holt Sun
87f8264c65 drivers: counter: add counter driver for NXP E31B.
add counter rtc jdp driver for MCXE31B.

Signed-off-by: Holt Sun <holt.sun@nxp.com>
2025-11-13 20:41:39 -05:00
Felix Wang
3621caaca6 drivers: Counter: STM Support on Zephyr
1.Add nxp,stm.yaml dts bindings
  2.Provide counter driver based on FTM driver from mcux-sdk-ng.

Signed-off-by: Felix Wang <fei.wang_3@nxp.com>
2025-10-25 10:47:09 +03:00
Yurii Lozynskyi
c15920613d drivers: counter: add PSC3M5 counter driver
- Add a new counter driver implementation based on the PDL for
  Infineon CAT1B devices. This enables support for hardware
  counters on the PSC3M5 platform.
- Add IFX_TCPWM_Counter_DeInit and IFX_TCPWM_Counter_Init
  macros to include/zephyr/drivers/timer/ifx_tcpwm.h
  and sort all of the macros in that file

Signed-off-by: Yurii Lozynskyi <yurii.lozynskyi@infineon.com>
2025-09-22 17:50:00 -04:00
Felix Wang
193e9170bb drivers: Counter: FTM Support on Zephyr
1.Update dts bindings to move clock-source properties from
nxp,ftm-pwm.yaml to nxp,ftm.yaml.
2.Provide counter driver based on FTM driver from NXP mcux-sdk-ng

Signed-off-by: Felix Wang <fei.wang_3@nxp.com>
2025-09-04 08:10:20 +02:00
Felix Wang
a717fac593 drivers: Counter: LPIT Support on Zephyr
1.Add dts bindings nxp,lpit-channel.yaml and nxp,lpit.yaml
2.Provide counter driver based on lpit driver from NXP mcux-sdk-ng

Signed-off-by: Felix Wang <fei.wang_3@nxp.com>
2025-08-08 10:44:24 -05:00
Saravanan Sekar
7a3f79ef86 drivers: counter: Add a support for TI MSPM0 Timer counter
TI MSPM0 SoC series has General Purpose Timer and Advanced control timers
with Counting module, Capture block (measure input signal period/time) and
Compare block (to generate time expiry, output waveform like PWM).

Add a support for counter driver with alarm and counter top functions.

Signed-off-by: Saravanan Sekar <saravanan@linumiz.com>
2025-06-10 10:25:10 -04:00
Ruibin Chang
47d1e38043 drivers/counter: implement it51xxx counter driver
Implement counter driver for ITE it51xxx series chip.

Signed-off-by: Ruibin Chang <Ruibin.Chang@ite.com.tw>
2025-06-05 12:33:29 +02:00
Stoyan Bogdanov
cfe7a58a28 drivers: counter: Add support for cc23x0 LGPT
Add support for LGPT0, LGPT1, LGPT2 and LGPT3 to cc23x0 SoC.

Signed-off-by: Stoyan Bogdanov <sbogdanov@baylibre.com>
2025-05-23 11:03:24 +02:00
Stoyan Bogdanov
dddbfcce76 drivers: counter: Add support for cc23x0 RTC counter
Add support for cc23x0 RTC driver in counter.
RTC is always ON after device boot. Timer is restared only
on POR, and is active during STANDBY and ACTIVE power states.

Signed-off-by: Stoyan Bogdanov <sbogdanov@baylibre.com>
2025-05-21 17:34:16 +02:00
Tahsin Mutlugun
ab43ceb1eb drivers: counter: Add MAX32 Wake-Up Timer driver
MAX32 Wake-Up Timer is a 32-bit timer that can wakeup the device from
low-power modes.

Signed-off-by: Tahsin Mutlugun <Tahsin.Mutlugun@analog.com>
2025-05-15 17:53:31 +02:00
Henrik Brix Andersen
2e8a08a165 drivers: counter: add NEORV32 GPTMR driver
Add counter driver for the NEORV32 General Purpose Timer (GPTMR).

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2025-05-05 12:20:50 +02:00
Titan Chen
2bca8d4e59 drivers: counter: rts5912: add support timer32 counter driver
Port rts5912 timer32 counter driver on Zephyr

Signed-off-by: Titan Chen <titan.chen@realtek.com>
2025-04-22 14:02:27 +02:00
Yunshao Chiang
c6fe84caf2 drivers: counter: add ite it8xxx2 timer driver
The IT8xxx2 timer driver uses timer 7 and timer 8 to implement the alarm
timer and the top timer, respectively.

Signed-off-by: Yunshao Chiang <Yunshao.Chiang@ite.com.tw>
2025-04-08 16:12:11 +02:00
Titan Chen
5a94a1ca66 drivers: counter: rts5912: add support slow timer counter driver
Port rts5912 slow timer counter driver on Zephyr

Signed-off-by: Titan Chen <titan.chen@realtek.com>
2025-04-07 21:13:10 +02:00
Alberto Escolar Piedras
ab7a6de5bb drivers/counter/counter_native_sim: Rename from counter_native_posix
Including renaming the DTS binding and kconfig options
deprecating the old one.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2025-03-10 06:52:37 +01:00
Hieu Nguyen
bf6c665d73 drivers: counter: Initial support for RZ/G3S
Add Counter driver support for Renesas RZ/G3S

Signed-off-by: Hieu Nguyen <hieu.nguyen.ym@bp.renesas.com>
Signed-off-by: Nhut Nguyen <nhut.nguyen.kc@renesas.com>
2025-02-04 09:16:34 +01:00
Sadik Ozer
5e38168f0c drivers: counter: Add MAX32xxx counter RTC driver
Common RTC counter driver for MAX32xxx MCUs.
Time of day alarm is used to generate interrupt.
The resolution of time of day interrupt is 1Hz.
Subsecond alarm interrupt not works it does not meet
zephyr counter driver requirement, so that not used.

To use as wakeup source wakeup-source parameter shall be
defined as below

&rtc_counter {
    status = "okay";
    wakeup-source;
};

Co-authored-by: Okan Sahin <okan.sahin@analog.com>
Signed-off-by: Sadik Ozer <sadik.ozer@analog.com>
2024-11-16 15:08:43 -05:00
Thao Luong
a61484f7ad drivers: counter: Add AGT counter driver support for Renesas RA8
- boards: renesas: Add support for agt.
- drivers: counter: Add support for counter driver use agt
- dts: arm: Add support for agt.
- dts: bindings: Add support for agt counter driver.
- soc: renesas: Add support for agt counter driver.
- samples: drivers: counter: alarm: Add support for RA8

This is initial support with only basic functionality for counter
operation on Zephyr using AGT hardware, current support for
count source is limited to LOCO and PCLKB, other count source
like underflow signal external pin or AGTIO from another AGT
channel will be added in later support

Signed-off-by: Ha Nguyen <ha.nguyen.fz@bp.renesas.com>
Signed-off-by: Thao Luong <thao.luong.uw@renesas.com>
Signed-off-by: Duy Phuong Hoang. Nguyen <duy.nguyen.xa@renesas.com>
Signed-off-by: Khoa Nguyen <khoa.nguyen.xh@renesas.com>
2024-10-21 12:41:00 +02:00
Sadik Ozer
bfb21ced8d drivers: counter: Add MAX32xxx counter driver
Common counter driver based on timer for MAX32xxx MCUs
To use as wakeup source wakeup-source parameter shall be
defined as below

&lptimer0 {
	status = "okay";
	clock-source = <ADI_MAX32_PRPH_CLK_SRC_ERTCO>;
	wakeup-source;
	counter {
		status = "okay";
	};
};

Signed-off-by: Sadik Ozer <sadik.ozer@analog.com>
2024-09-11 20:18:33 -04:00
Marouen Ghodhbane
3fb0e784ff drivers: counter: mcux: add support for TPM
Add TPM native Zephyr driver. It's mainly inspired from the GPT
counter implementation.

Signed-off-by: Marouen Ghodhbane <marouen.ghodhbane@nxp.com>
Signed-off-by: Jiafei Pan <Jiafei.Pan@nxp.com>
2024-04-30 08:53:59 +02:00
Emilio Benavente
04b240c830 dts: bindings: renamed binding used for pit
Renamed pit binding from nxp,kinetis-pit
to nxp,pit

Signed-off-by: Emilio Benavente <emilio.benavente@nxp.com>
2024-03-07 13:23:58 -06:00
Declan Snyder
31722446aa drivers: counter: Add NXP MRT driver
Add driver for NXP Multirate Timer

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2023-11-10 10:40:54 +01:00
TOKITA Hiroshi
cf242016b4 drivers: counter: Add support for rpi_pico timer
Adds support for rpi_pico timer

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@fujitsu.com>
2023-09-13 16:18:44 +02:00