blob: 571b1780d39dc38741ccf65640d3ea5719d79697 [file] [log] [blame]
yu.dongc33b3072024-08-21 23:14:49 -07001/*****************************************************************************
2* Copyright Statement:
3* --------------------
4* This software is protected by Copyright and the information contained
5* herein is confidential. The software may not be copied and the information
6* contained herein may not be used or disclosed except with the written
7* permission of MediaTek Inc. (C) 2005
8*
9* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
10* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
11* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
12* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
13* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
14* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
15* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
16* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
17* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
18* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
19* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
20* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
21*
22* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
23* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
24* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
25* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
26* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
27*
28* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
29* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
30* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
31* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
32* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
33*
34*****************************************************************************/
35
36/*****************************************************************************
37 *
38 * Filename:
39 * ---------
40 * wdt_sw.h
41 *
42 * Project:
43 * --------
44 * Maui_Software
45 *
46 * Description:
47 * ------------
48 * This file is intends for WDT driver.
49 *
50 * Author:
51 * -------
52 * -------
53 *
54 *============================================================================
55 * HISTORY
56 * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
57 *------------------------------------------------------------------------------
58 * removed!
59 * removed!
60 * removed!
61 *
62 * removed!
63 * removed!
64 * removed!
65 *
66 * removed!
67 * removed!
68 * removed!
69 *
70 * removed!
71 * removed!
72 * removed!
73 *
74 * removed!
75 * removed!
76 * removed!
77 *
78 * removed!
79 * removed!
80 * removed!
81 *
82 * removed!
83 * removed!
84 * removed!
85 *
86 * removed!
87 * removed!
88 * removed!
89 *
90 * removed!
91 * removed!
92 * removed!
93 *
94 * removed!
95 * removed!
96 * removed!
97 *
98 * removed!
99 * removed!
100 * removed!
101 *
102 * removed!
103 * removed!
104 * removed!
105 * removed!
106 * removed!
107 * removed!
108 * removed!
109 * removed!
110 * removed!
111 * removed!
112 * removed!
113 * removed!
114 * removed!
115 * removed!
116 * removed!
117 * removed!
118 * removed!
119 * removed!
120 * removed!
121 * removed!
122 * removed!
123 * removed!
124 * removed!
125 * removed!
126 * removed!
127 * removed!
128 * removed!
129 * removed!
130 * removed!
131 *------------------------------------------------------------------------------
132 * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
133 *============================================================================
134 ****************************************************************************/
135#ifndef WDT_SW_H
136#define WDT_SW_H
137
138#include "drv_features_wdt.h"
139#include "drv_comm.h"
140#include "wdt_hw.h"
141//#include "wdt_hw.h"
142//#include "kal_non_specific_general_types.h"
143
144/*Must include "drv_comm.h*/
145#define WDT_RSTINTERVAL_VALUE 0xffa
146#define WDT_Restart() DRV_WriteReg(WDT_RESTART,WDT_RESTART_KEY)
147void WDT_SetValue(kal_uint16 value);
148void WDT_Enable(kal_bool en);
149void WDT_EnableInterrupt(kal_bool enable);
150void WDT_SetExtpol(IO_level extpol);
151void WDT_SetExten(kal_bool en);
152void WDT_Config(IO_level extpol, kal_bool exten);
153void WDT_Enable_Debug_Mode(kal_bool en);
154void WDT_init(void);
155void DRV_RESET(void);
156void DRV_ABN_RESET(void);
157void WDT_Restart2(void);
158
159#if defined(DRV_WDT_RETN_REG)
160void WDT_Write_RETN_FLAG(kal_uint8 flag);
161void WDT_SET_RETN_FLAG(kal_uint8 flag);
162void WDT_CLR_RETN_FLAG(kal_uint8 flag);
163kal_uint8 WDT_Read_RETN_FLAG(void);
164void WDT_Write_RETN_DAT0(kal_uint32 value);
165kal_uint32 WDT_Read_RETN_DAT0(void);
166#endif
167
168
169
170#if !defined(DRV_WDT_OFF)
171#if defined(__DRV_COMM_REG_DBG__) && defined(__DRV_WDT_REG_DBG__)
172#define DRV_WDT_WriteReg(addr,data) DRV_DBG_WriteReg(addr,data)
173#define DRV_WDT_Reg(addr) DRV_DBG_Reg(addr)
174#define DRV_WDT_WriteReg32(addr,data) DRV_DBG_WriteReg32(addr,data)
175#define DRV_WDT_Reg32(addr) DRV_DBG_Reg32(addr)
176#define DRV_WDT_WriteReg8(addr,data) DRV_DBG_WriteReg8(addr,data)
177#define DRV_WDT_Reg8(addr) DRV_DBG_Reg8(addr)
178#define DRV_WDT_ClearBits(addr,data) DRV_DBG_ClearBits(addr,data)
179#define DRV_WDT_SetBits(addr,data) DRV_DBG_SetBits(addr,data)
180#define DRV_WDT_SetData(addr, bitmask, value) DRV_DBG_SetData(addr, bitmask, value)
181#define DRV_WDT_ClearBits32(addr,data) DRV_DBG_ClearBits32(addr,data)
182#define DRV_WDT_SetBits32(addr,data) DRV_DBG_SetBits32(addr,data)
183#define DRV_WDT_SetData32(addr, bitmask, value) DRV_DBG_SetData32(addr, bitmask, value)
184#define DRV_WDT_ClearBits8(addr,data) DRV_DBG_ClearBits8(addr,data)
185#define DRV_WDT_SetBits8(addr,data) DRV_DBG_SetBits8(addr,data)
186#define DRV_WDT_SetData8(addr, bitmask, value) DRV_DBG_SetData8(addr, bitmask, value)
187#else
188#define DRV_WDT_WriteReg(addr,data) DRV_WriteReg(addr,data)
189#define DRV_WDT_Reg(addr) DRV_Reg(addr)
190#define DRV_WDT_WriteReg32(addr,data) DRV_WriteReg32(addr,data)
191#define DRV_WDT_Reg32(addr) DRV_Reg32(addr)
192#define DRV_WDT_WriteReg8(addr,data) DRV_WriteReg8(addr,data)
193#define DRV_WDT_Reg8(addr) DRV_Reg8(addr)
194#define DRV_WDT_ClearBits(addr,data) DRV_ClearBits(addr,data)
195#define DRV_WDT_SetBits(addr,data) DRV_SetBits(addr,data)
196#define DRV_WDT_SetData(addr, bitmask, value) DRV_SetData(addr, bitmask, value)
197#define DRV_WDT_ClearBits32(addr,data) DRV_ClearBits32(addr,data)
198#define DRV_WDT_SetBits32(addr,data) DRV_SetBits32(addr,data)
199#define DRV_WDT_SetData32(addr, bitmask, value) DRV_SetData32(addr, bitmask, value)
200#define DRV_WDT_ClearBits8(addr,data) DRV_ClearBits8(addr,data)
201#define DRV_WDT_SetBits8(addr,data) DRV_SetBits8(addr,data)
202#define DRV_WDT_SetData8(addr, bitmask, value) DRV_SetData8(addr, bitmask, value)
203#endif //#if defined(__DRV_COMM_REG_DBG__) && defined(__DRV_WDT_REG_DBG__)
204
205#else // !defined(DRV_WDT_OFF)
206
207#define DRV_WDT_WriteReg(addr,data)
208#define DRV_WDT_Reg(addr) drv_dummy_return()
209#define DRV_WDT_WriteReg32(addr,data)
210#define DRV_WDT_Reg32(addr) drv_dummy_return()
211#define DRV_WDT_WriteReg8(addr,data)
212#define DRV_WDT_Reg8(addr) drv_dummy_return()
213#define DRV_WDT_ClearBits(addr,data)
214#define DRV_WDT_SetBits(addr,data)
215#define DRV_WDT_SetData(addr, bitmask, value)
216#define DRV_WDT_ClearBits32(addr,data)
217#define DRV_WDT_SetBits32(addr,data)
218#define DRV_WDT_SetData32(addr, bitmask, value)
219#define DRV_WDT_ClearBits8(addr,data)
220#define DRV_WDT_SetBits8(addr,data)
221#define DRV_WDT_SetData8(addr, bitmask, value)
222
223#endif //!defined(DRV_WDT_OFF)
224#endif
225