diff options
Diffstat (limited to 'firmware/target/arm/imx31/gigabeat-s/system-imx31.c')
-rw-r--r-- | firmware/target/arm/imx31/gigabeat-s/system-imx31.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/firmware/target/arm/imx31/gigabeat-s/system-imx31.c b/firmware/target/arm/imx31/gigabeat-s/system-imx31.c index 6d4797e9df..7d778fb8fd 100644 --- a/firmware/target/arm/imx31/gigabeat-s/system-imx31.c +++ b/firmware/target/arm/imx31/gigabeat-s/system-imx31.c | |||
@@ -32,6 +32,31 @@ | |||
32 | #include "clkctl-imx31.h" | 32 | #include "clkctl-imx31.h" |
33 | #include "mc13783.h" | 33 | #include "mc13783.h" |
34 | 34 | ||
35 | /* Initialize the watchdog timer */ | ||
36 | void watchdog_init(unsigned int half_seconds) | ||
37 | { | ||
38 | uint16_t wcr = WDOG_WCR_WTw(half_seconds) | /* Timeout */ | ||
39 | WDOG_WCR_WOE | /* WDOG output enabled */ | ||
40 | WDOG_WCR_WDA | /* WDOG assertion - no effect */ | ||
41 | WDOG_WCR_SRS | /* System reset - no effect */ | ||
42 | WDOG_WCR_WRE; /* Generate a WDOG signal */ | ||
43 | |||
44 | imx31_clkctl_module_clock_gating(CG_WDOG, CGM_ON_RUN_WAIT); | ||
45 | |||
46 | WDOG_WCR = wcr; | ||
47 | WDOG_WSR = 0x5555; | ||
48 | WDOG_WCR = wcr | WDOG_WCR_WDE; /* Enable timer - hardware does | ||
49 | not allow a disable now */ | ||
50 | WDOG_WSR = 0xaaaa; | ||
51 | } | ||
52 | |||
53 | /* Service the watchdog timer */ | ||
54 | void watchdog_service(void) | ||
55 | { | ||
56 | WDOG_WSR = 0x5555; | ||
57 | WDOG_WSR = 0xaaaa; | ||
58 | } | ||
59 | |||
35 | int system_memory_guard(int newmode) | 60 | int system_memory_guard(int newmode) |
36 | { | 61 | { |
37 | (void)newmode; | 62 | (void)newmode; |