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>
This commit is contained in:
Titan Chen 2025-02-27 10:45:20 +08:00 committed by Benjamin Cabé
commit 5a94a1ca66
6 changed files with 388 additions and 1 deletions

View file

@ -0,0 +1,31 @@
/*
* Copyright (c) 2025 Realtek, SIBG-SD7
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef ZEPHYR_SOC_REALTEK_RTS5912_REG_SLWTMR_H
#define ZEPHYR_SOC_REALTEK_RTS5912_REG_SLWTMR_H
/**
* @brief SLOW Timer Controller (SLWTMR)
*/
struct slwtmr_type {
uint32_t ldcnt;
uint32_t cnt;
uint32_t ctrl;
uint32_t insts;
};
/* CTRL */
#define SLWTMR_CTRL_EN BIT(0)
#define SLWTMR_CTRL_MDSELS_ONESHOT 0
#define SLWTMR_CTRL_MDSELS_PERIOD BIT(1)
#define SLWTMR_CTRL_INTEN_EN BIT(2)
/* INTSTS */
#define SLWTMR_INTSTS_STS BIT(0)
#endif /* ZEPHYR_SOC_REALTEK_RTS5912_REG_SLWTMR_H */