coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
wdt.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 #ifndef SOC_MEDIATEK_COMMON_WDT_H
4 #define SOC_MEDIATEK_COMMON_WDT_H
5 
6 #include <stdint.h>
7 #include <soc/addressmap.h>
8 
9 struct mtk_wdt_regs {
21 };
22 
23 /* WDT_MODE */
24 enum {
25  MTK_WDT_MODE_KEY = 0x22000000,
27  MTK_WDT_MODE_IRQ = 1 << 3,
30  MTK_WDT_MODE_ENABLE = 1 << 0
31 };
32 
33 /* WDT_RESET */
34 enum {
37  MTK_WDT_STA_SW_RST = 1 << 30,
38  MTK_WDT_STA_HW_RST = 1 << 31
39 };
40 
41 static struct mtk_wdt_regs *const mtk_wdt = (void *)RGU_BASE;
42 
43 void mtk_wdt_preinit(void);
44 int mtk_wdt_init(void);
45 void mtk_wdt_clr_status(void);
46 
47 #endif /* SOC_MEDIATEK_COMMON_WDT_H */
@ RGU_BASE
Definition: addressmap.h:20
uint32_t u32
Definition: stdint.h:51
u32 wdt_mode
Definition: wdt.h:10
u32 wdt_length
Definition: wdt.h:11
u32 wdt_debug_ctrl
Definition: wdt.h:20
u32 wdt_req_mode
Definition: wdt.h:18
u32 reserved0[5]
Definition: wdt.h:17
u32 wdt_restart
Definition: wdt.h:12
u32 wdt_swsysrst
Definition: wdt.h:16
u32 wdt_swrst
Definition: wdt.h:15
u32 wdt_status
Definition: wdt.h:13
u32 reserved1[3]
Definition: wdt.h:19
u32 wdt_interval
Definition: wdt.h:14
@ MTK_WDT_STA_SW_RST
Definition: wdt.h:37
@ MTK_WDT_STA_HW_RST
Definition: wdt.h:38
@ MTK_WDT_STA_SPM_RST
Definition: wdt.h:36
@ MTK_WDT_SWRST_KEY
Definition: wdt.h:35
int mtk_wdt_init(void)
Definition: wdt.c:31
void mtk_wdt_clr_status(void)
Definition: wdt.c:10
void mtk_wdt_preinit(void)
Definition: wdt.c:19
static struct mtk_wdt_regs *const mtk_wdt
Definition: wdt.h:41
@ MTK_WDT_MODE_ENABLE
Definition: wdt.h:30
@ MTK_WDT_MODE_IRQ
Definition: wdt.h:27
@ MTK_WDT_MODE_KEY
Definition: wdt.h:25
@ MTK_WDT_MODE_EXT_POL
Definition: wdt.h:29
@ MTK_WDT_MODE_DUAL_MODE
Definition: wdt.h:26
@ MTK_WDT_MODE_EXTEN
Definition: wdt.h:28