change source file mode to 0644 instead of 0755
[profile/mobile/platform/kernel/u-boot-tm1.git] / arch / arm / cpu / armv7 / sc8825 / watchdog.c
1 #include <config.h>
2 #include <asm/io.h>
3 #include <asm/arch/chip_drv_config_extern.h>
4 #include <asm/arch/bits.h>
5 #include <linux/types.h>
6
7 void start_watchdog(uint32_t init_time_ms)
8 {
9     //WDG_TimerStart(init_time_ms);
10     WDG_ClockOn();
11     WDG_ResetMCU();
12 }
13
14 void stop_watchdog(void)
15 {
16     WDG_TimerStop();
17         
18 }
19
20 void init_watchdog(void)
21 {
22     WDG_TimerInit();
23 }
24
25 void feed_watchdog(void)
26 {
27 }
28
29 void load_watchdog(uint32_t time_ms)
30 {
31     WDG_TimerLoad(time_ms);
32 }
33 void hw_watchdog_reset(void)
34 {
35    // WDG_ResetMCU();
36    //load_watchdog(CONFIG_WDG_INIT_VALUE);
37 }
38
39 int hw_watchdog_rst_pending(void)
40 {
41     WDG_ClockOn();
42         return WDG_PHY_RST_INT_ON();
43 }
44
45 /* the last word is used as a flag of weather dump memory after fatal error 
46  * such as kernel panic, hw watchdog fire
47  * */
48 int fatal_dump_enabled(void)
49 {
50         if(REG32(0x20900218) & 0x1) /* get remap status */
51                 return REG32(0x7ffc);
52         else
53                 return REG32(0x27ffc);
54 }