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) 15 16 #if defined(CONFIG_MACH_SUN4I) || \ 17 defined(CONFIG_MACH_SUN5I) || \ 18 defined(CONFIG_MACH_SUN7I) || \ 19 defined(CONFIG_MACH_SUN8I_R40) 20 21 #define WDT_MODE_EN (0x1 << 0) 22 #define WDT_MODE_RESET_EN (0x1 << 1) 23 24 struct sunxi_wdog { 25 u32 ctl; /* 0x00 */ 26 u32 mode; /* 0x04 */ 27 u32 res[2]; 28 }; 29 30 #else 31 32 #define WDT_CFG_RESET (0x1) 33 #define WDT_MODE_EN (0x1) 34 35 struct sunxi_wdog { 36 u32 irq_en; /* 0x00 */ 37 u32 irq_sta; /* 0x04 */ 38 u32 res1[2]; 39 u32 ctl; /* 0x10 */ 40 u32 cfg; /* 0x14 */ 41 u32 mode; /* 0x18 */ 42 u32 res2; 43 }; 44 45 #endif 46 47 #endif /* _SUNXI_WATCHDOG_H_ */ 48