Azure Sphere MT3620 M4 API Reference Manual
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
mhal_wdt.h
1 /*
2  * (C) 2005-2020 MediaTek Inc. All rights reserved.
3  *
4  * Copyright Statement:
5  *
6  * This MT3620 driver software/firmware and related documentation
7  * ("MediaTek Software") are protected under relevant copyright laws.
8  * The information contained herein is confidential and proprietary to
9  * MediaTek Inc. ("MediaTek"). You may only use, reproduce, modify, or
10  * distribute (as applicable) MediaTek Software if you have agreed to and been
11  * bound by this Statement and the applicable license agreement with MediaTek
12  * ("License Agreement") and been granted explicit permission to do so within
13  * the License Agreement ("Permitted User"). If you are not a Permitted User,
14  * please cease any access or use of MediaTek Software immediately.
15  *
16  * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
17  * THAT MEDIATEK SOFTWARE RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE
18  * PROVIDED TO RECEIVER ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS
19  * ANY AND ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
20  * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
21  * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH
22  * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
23  * INCORPORATED IN, OR SUPPLIED WITH MEDIATEK SOFTWARE, AND RECEIVER AGREES TO
24  * LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
25  * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
26  * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK
27  * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE
28  * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
29  * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S
30  * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO MEDIATEK SOFTWARE RELEASED
31  * HEREUNDER WILL BE ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY
32  * RECEIVER TO MEDIATEK DURING THE PRECEDING TWELVE (12) MONTHS FOR SUCH
33  * MEDIATEK SOFTWARE AT ISSUE.
34  */
35 
36 #ifndef __MHAL_WDT_H__
37 #define __MHAL_WDT_H__
38 
39 #include <mhal_osai.h>
40 
112 #define WDT_EPTR 1
113 
114 #define WDT_EINVAL 2
115 
116 #define WDT_EFAULT 3
117 
132 struct hal_wdt_dev {
134  void __iomem *cm4_wdt_base;
135 };
136 
148 #ifdef __cplusplus
149 extern "C" {
150 #endif
151 
161 int mtk_mhal_wdt_enable(struct hal_wdt_dev *wdt_dev,
162  u32 en);
163 
173 int mtk_mhal_wdt_config(struct hal_wdt_dev *wdt_dev,
174  u8 irq);
175 
186 int mtk_mhal_wdt_set_timeout(struct hal_wdt_dev *wdt_dev,
187  u32 sec);
188 
197 int mtk_mhal_wdt_restart(struct hal_wdt_dev *wdt_dev);
198 
208 int mtk_mhal_wdt_hwrst(struct hal_wdt_dev *wdt_dev);
209 
219 int mtk_mhal_wdt_swrst(struct hal_wdt_dev *wdt_dev);
220 
234 int mtk_mhal_wdt_get_status(struct hal_wdt_dev *wdt_dev,
235  unsigned int *rst_sta);
236 
237 #ifdef __cplusplus
238 }
239 #endif
240 
250 #endif /* __MHAL_WDT_H__ */
int mtk_mhal_wdt_config(struct hal_wdt_dev *wdt_dev, u8 irq)
This function is used to configure WDT mode.
int mtk_mhal_wdt_get_status(struct hal_wdt_dev *wdt_dev, unsigned int *rst_sta)
This function is used to get WDT reset status.
int mtk_mhal_wdt_hwrst(struct hal_wdt_dev *wdt_dev)
This function is used to reset immediately by WDT HW-RST.
int mtk_mhal_wdt_enable(struct hal_wdt_dev *wdt_dev, u32 en)
This function is used to enable or disable WDT.
int mtk_mhal_wdt_set_timeout(struct hal_wdt_dev *wdt_dev, u32 sec)
This function is used to set WDT timeout value.
void __iomem * cm4_wdt_base
Register base address of WDT.
Definition: mhal_wdt.h:134
The interface to WDT device.
Definition: mhal_wdt.h:132
int mtk_mhal_wdt_restart(struct hal_wdt_dev *wdt_dev)
This function is used to restart WDT counter.
int mtk_mhal_wdt_swrst(struct hal_wdt_dev *wdt_dev)
This function is used to reset immediately by WDT SW-RST.