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