Minkyu Kang | 047ece7 | 2012-01-18 15:55:05 +0900 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2011 Samsung Electronics |
| 3 | * Heungjun Kim <riverful.kim@samsung.com> |
| 4 | * Minkyu Kang <mk7.kang@samsung.com> |
| 5 | * |
Wolfgang Denk | d79de1d | 2013-07-08 09:37:19 +0200 | [diff] [blame] | 6 | * SPDX-License-Identifier: GPL-2.0+ |
Minkyu Kang | 047ece7 | 2012-01-18 15:55:05 +0900 | [diff] [blame] | 7 | */ |
| 8 | |
| 9 | #ifndef __ASM_ARM_ARCH_WATCHDOG_H_ |
| 10 | #define __ASM_ARM_ARCH_WATCHDOG_H_ |
| 11 | |
| 12 | #define WTCON_RESET_OFFSET 0 |
| 13 | #define WTCON_INTEN_OFFSET 2 |
| 14 | #define WTCON_CLKSEL_OFFSET 3 |
| 15 | #define WTCON_EN_OFFSET 5 |
| 16 | #define WTCON_PRE_OFFSET 8 |
| 17 | |
| 18 | #define WTCON_CLK_16 0x0 |
| 19 | #define WTCON_CLK_32 0x1 |
| 20 | #define WTCON_CLK_64 0x2 |
| 21 | #define WTCON_CLK_128 0x3 |
| 22 | |
| 23 | #define WTCON_CLK(x) ((x & 0x3) << WTCON_CLKSEL_OFFSET) |
| 24 | #define WTCON_PRESCALER(x) ((x) << WTCON_PRE_OFFSET) |
| 25 | #define WTCON_EN (0x1 << WTCON_EN_OFFSET) |
| 26 | #define WTCON_RESET (0x1 << WTCON_RESET_OFFSET) |
| 27 | #define WTCON_INT (0x1 << WTCON_INTEN_OFFSET) |
| 28 | |
| 29 | #ifndef __ASSEMBLY__ |
| 30 | struct s5p_watchdog { |
| 31 | unsigned int wtcon; |
| 32 | unsigned int wtdat; |
| 33 | unsigned int wtcnt; |
| 34 | unsigned int wtclrint; |
| 35 | }; |
| 36 | |
| 37 | /* functions */ |
| 38 | void wdt_stop(void); |
| 39 | void wdt_start(unsigned int timeout); |
| 40 | #endif /* __ASSEMBLY__ */ |
| 41 | |
| 42 | #endif |