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