return 0;
}
-inline int s3c2410wdt_set_emergency_reset(unsigned int timeout_cnt, int index)
+inline int s3c2410wdt_multistage_emergency_reset(unsigned int timeout_cnt)
{
- struct s3c2410_wdt *wdt = s3c_wdt[index];
unsigned int wtdat = 0;
unsigned int wtcnt = wtdat + timeout_cnt;
unsigned long wtcon;
+ int index;
- if (!wdt)
+ index = s3c2410wdt_get_multistage_index();
+
+ if (index < 0)
return -ENODEV;
/* emergency reset with wdt reset */
- wtcon = readl(wdt->reg_base + S3C2410_WTCON);
- wtcon |= S3C2410_WTCON_RSTEN | S3C2410_WTCON_ENABLE;
+ wtcon = readl(s3c_wdt[index]->reg_base + S3C2410_WTCON);
+ wtcon |= S3C2410_WTCON_INTEN | S3C2410_WTCON_ENABLE;
- writel(wtdat, wdt->reg_base + S3C2410_WTDAT);
- writel(wtcnt, wdt->reg_base + S3C2410_WTCNT);
- writel(wtcon, wdt->reg_base + S3C2410_WTCON);
+ writel(wtdat, s3c_wdt[index]->reg_base + S3C2410_WTDAT);
+ writel(wtcnt, s3c_wdt[index]->reg_base + S3C2410_WTCNT);
+ writel(wtcon, s3c_wdt[index]->reg_base + S3C2410_WTCON);
return 0;
}
+#endif
-inline int s3c2410wdt_multistage_emergency_reset(unsigned int timeout_cnt)
+inline int s3c2410wdt_set_emergency_reset(unsigned int timeout_cnt, int index)
{
+ struct s3c2410_wdt *wdt = s3c_wdt[index];
unsigned int wtdat = 0;
unsigned int wtcnt = wtdat + timeout_cnt;
unsigned long wtcon;
- int index;
-
- index = s3c2410wdt_get_multistage_index();
- if (index < 0)
+ if (!wdt)
return -ENODEV;
/* emergency reset with wdt reset */
- wtcon = readl(s3c_wdt[index]->reg_base + S3C2410_WTCON);
- wtcon |= S3C2410_WTCON_INTEN | S3C2410_WTCON_ENABLE;
+ wtcon = readl(wdt->reg_base + S3C2410_WTCON);
+ wtcon |= S3C2410_WTCON_RSTEN | S3C2410_WTCON_ENABLE;
- writel(wtdat, s3c_wdt[index]->reg_base + S3C2410_WTDAT);
- writel(wtcnt, s3c_wdt[index]->reg_base + S3C2410_WTCNT);
- writel(wtcon, s3c_wdt[index]->reg_base + S3C2410_WTCON);
+ writel(wtdat, wdt->reg_base + S3C2410_WTDAT);
+ writel(wtcnt, wdt->reg_base + S3C2410_WTCNT);
+ writel(wtcon, wdt->reg_base + S3C2410_WTCON);
return 0;
}
/* This function does not return. */
}
-#endif
#ifdef CONFIG_PM_SLEEP
static int s3c2410wdt_dev_suspend(struct device *dev)
#define exynos_ss_check_crash_key(a,b) do { } while(0)
#endif
-#ifdef CONFIG_S3C2410_WATCHDOG
-extern int s3c2410wdt_set_emergency_stop(int index);
-extern int s3c2410wdt_set_emergency_reset(unsigned int timeout, int index);
-extern int s3c2410wdt_keepalive_emergency(bool reset, int index);
-extern void s3c2410wdt_reset_confirm(unsigned long mtime, int index);
-#else
-
-static inline int s3c2410wdt_set_emergency_stop(int index)
-{
- return -1;
-}
-
-static inline int s3c2410wdt_set_emergency_reset(unsigned int timeout_cnt, int index)
-{
- return -1;
-}
-
-static inline int s3c2410wdt_keepalive_emergency(bool reset, int index)
-{
- return -1;
-}
-
-#define s3c2410wdt_reset_confirm(a, b) do { } while(0)
-#endif
-
#else
#define exynos_ss_acpm(a,b,c) do { } while(0)
#define exynos_ss_task(a,b) do { } while(0)
}
#endif /* CONFIG_EXYNOS_SNAPSHOT */
+#ifdef CONFIG_S3C2410_WATCHDOG
+extern int s3c2410wdt_set_emergency_stop(int index);
+extern int s3c2410wdt_set_emergency_reset(unsigned int timeout, int index);
+extern int s3c2410wdt_keepalive_emergency(bool reset, int index);
+extern void s3c2410wdt_reset_confirm(unsigned long mtime, int index);
+#else /* CONFIG_S3C2410_WATCHDOG */
+
+static inline int s3c2410wdt_set_emergency_stop(int index)
+{
+ return -1;
+}
+
+static inline int s3c2410wdt_set_emergency_reset(unsigned int timeout_cnt, int index)
+{
+ return -1;
+}
+
+static inline int s3c2410wdt_keepalive_emergency(bool reset, int index)
+{
+ return -1;
+}
+
+#define s3c2410wdt_reset_confirm(a, b) do { } while(0)
+#endif /* CONFIG_S3C2410_WATCHDOG */
+
static inline void exynos_ss_bug_func(void) {BUG();}
static inline void exynos_ss_spin_func(void) {do {wfi();} while(1);}