driver: timer: Add timer driver initial version of RTS5912.

Add timer driver for Realtek RTS5912.

Signed-off-by: Lin Yu-Cheng <lin_yu_cheng@realtek.com>
This commit is contained in:
Lin Yu-Cheng 2024-11-22 18:27:29 +08:00 committed by Benjamin Cabé
commit cfb2074a5e
8 changed files with 363 additions and 0 deletions

View file

@ -0,0 +1,31 @@
/*
* Copyright (c) 2023 Realtek, SIBG-SD7
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef ZEPHYR_SOC_REALTEK_RTS5912_REG_RTMR_H
#define ZEPHYR_SOC_REALTEK_RTS5912_REG_RTMR_H
/*
* @brief RTOS Timer Controller (RTMR)
*/
typedef struct {
volatile uint32_t LDCNT;
volatile uint32_t CNT;
volatile uint32_t CTRL;
volatile uint32_t INTSTS;
} RTOSTMR_Type;
/* CTRL */
#define RTOSTMR_CTRL_EN_Pos (0UL)
#define RTOSTMR_CTRL_EN_Msk BIT(RTOSTMR_CTRL_EN_Pos)
#define RTOSTMR_CTRL_MDSEL_Pos (1UL)
#define RTOSTMR_CTRL_MDSEL_Msk BIT(RTOSTMR_CTRL_MDSEL_Pos)
#define RTOSTMR_CTRL_INTEN_Pos (2UL)
#define RTOSTMR_CTRL_INTEN_Msk BIT(RTOSTMR_CTRL_INTEN_Pos)
/* INTSTS */
#define RTOSTMR_INTSTS_STS_Pos (0UL)
#define RTOSTMR_INTSTS_STS_Msk BIT(RTOSTMR_INTSTS_STS_Pos)
#endif /* ZEPHYR_SOC_REALTEK_RTS5912_REG_RTMR_H */