blob: eb64109060067288b36a8baaf044d5513ea0745d [file] [log] [blame]
HeungJun, Kim2a907f92012-01-16 21:13:03 +00001/*
2 * Copyright (C) 2011 Samsung Electronics
3 * Heungjun Kim <riverful.kim@samsung.com>
4 *
Wolfgang Denkd79de1d2013-07-08 09:37:19 +02005 * SPDX-License-Identifier: GPL-2.0+
HeungJun, Kim2a907f92012-01-16 21:13:03 +00006 */
7
8#ifndef __ASM_ARM_ARCH_WATCHDOG_H_
9#define __ASM_ARM_ARCH_WATCHDOG_H_
10
11#define WTCON_RESET_OFFSET 0
12#define WTCON_INTEN_OFFSET 2
13#define WTCON_CLKSEL_OFFSET 3
14#define WTCON_EN_OFFSET 5
15#define WTCON_PRE_OFFSET 8
16
17#define WTCON_CLK_16 0x0
18#define WTCON_CLK_32 0x1
19#define WTCON_CLK_64 0x2
20#define WTCON_CLK_128 0x3
21
22#define WTCON_CLK(x) ((x & 0x3) << WTCON_CLKSEL_OFFSET)
23#define WTCON_PRESCALER(x) ((x) << WTCON_PRE_OFFSET)
24#define WTCON_EN (0x1 << WTCON_EN_OFFSET)
25#define WTCON_RESET (0x1 << WTCON_RESET_OFFSET)
26#define WTCON_INT (0x1 << WTCON_INTEN_OFFSET)
27
28#ifndef __ASSEMBLY__
Minkyu Kang047ece72012-01-18 15:55:05 +090029struct s5p_watchdog {
HeungJun, Kim2a907f92012-01-16 21:13:03 +000030 unsigned int wtcon;
31 unsigned int wtdat;
32 unsigned int wtcnt;
33 unsigned int wtclrint;
34};
Minkyu Kang047ece72012-01-18 15:55:05 +090035
36/* functions */
37void wdt_stop(void);
38void wdt_start(unsigned int timeout);
HeungJun, Kim2a907f92012-01-16 21:13:03 +000039#endif /* __ASSEMBLY__ */
40
41#endif