Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
Chen-Yu Tsai | 0d15276 | 2014-10-04 20:37:26 +0800 | [diff] [blame] | 2 | /* |
| 3 | * (C) Copyright 2014 |
| 4 | * Chen-Yu Tsai <wens@csie.org> |
| 5 | * |
| 6 | * Watchdog register definitions |
Chen-Yu Tsai | 0d15276 | 2014-10-04 20:37:26 +0800 | [diff] [blame] | 7 | */ |
| 8 | |
| 9 | #ifndef _SUNXI_WATCHDOG_H_ |
| 10 | #define _SUNXI_WATCHDOG_H_ |
| 11 | |
| 12 | #define WDT_CTRL_RESTART (0x1 << 0) |
| 13 | #define WDT_CTRL_KEY (0x0a57 << 1) |
Chen-Yu Tsai | 1275c48 | 2014-10-04 20:37:28 +0800 | [diff] [blame] | 14 | |
Chen-Yu Tsai | 84f3bb4 | 2016-11-30 16:27:14 +0800 | [diff] [blame] | 15 | #if defined(CONFIG_MACH_SUN4I) || \ |
| 16 | defined(CONFIG_MACH_SUN5I) || \ |
| 17 | defined(CONFIG_MACH_SUN7I) || \ |
| 18 | defined(CONFIG_MACH_SUN8I_R40) |
Chen-Yu Tsai | 1275c48 | 2014-10-04 20:37:28 +0800 | [diff] [blame] | 19 | |
Chen-Yu Tsai | 0d15276 | 2014-10-04 20:37:26 +0800 | [diff] [blame] | 20 | #define WDT_MODE_EN (0x1 << 0) |
| 21 | #define WDT_MODE_RESET_EN (0x1 << 1) |
| 22 | |
| 23 | struct sunxi_wdog { |
| 24 | u32 ctl; /* 0x00 */ |
| 25 | u32 mode; /* 0x04 */ |
| 26 | u32 res[2]; |
| 27 | }; |
| 28 | |
Chen-Yu Tsai | 1275c48 | 2014-10-04 20:37:28 +0800 | [diff] [blame] | 29 | #else |
| 30 | |
| 31 | #define WDT_CFG_RESET (0x1) |
| 32 | #define WDT_MODE_EN (0x1) |
| 33 | |
| 34 | struct sunxi_wdog { |
| 35 | u32 irq_en; /* 0x00 */ |
| 36 | u32 irq_sta; /* 0x04 */ |
| 37 | u32 res1[2]; |
| 38 | u32 ctl; /* 0x10 */ |
| 39 | u32 cfg; /* 0x14 */ |
| 40 | u32 mode; /* 0x18 */ |
| 41 | u32 res2; |
| 42 | }; |
| 43 | |
| 44 | #endif |
| 45 | |
Chen-Yu Tsai | 0d15276 | 2014-10-04 20:37:26 +0800 | [diff] [blame] | 46 | #endif /* _SUNXI_WATCHDOG_H_ */ |