blob: ce6d6648560980a1d30bacbd23a4440888974c74 [file] [log] [blame]
Chen-Yu Tsai0d152762014-10-04 20:37:26 +08001/*
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 Tsai1275c482014-10-04 20:37:28 +080015
Chen-Yu Tsai84f3bb42016-11-30 16:27:14 +080016#if defined(CONFIG_MACH_SUN4I) || \
17 defined(CONFIG_MACH_SUN5I) || \
18 defined(CONFIG_MACH_SUN7I) || \
19 defined(CONFIG_MACH_SUN8I_R40)
Chen-Yu Tsai1275c482014-10-04 20:37:28 +080020
Chen-Yu Tsai0d152762014-10-04 20:37:26 +080021#define WDT_MODE_EN (0x1 << 0)
22#define WDT_MODE_RESET_EN (0x1 << 1)
23
24struct sunxi_wdog {
25 u32 ctl; /* 0x00 */
26 u32 mode; /* 0x04 */
27 u32 res[2];
28};
29
Chen-Yu Tsai1275c482014-10-04 20:37:28 +080030#else
31
32#define WDT_CFG_RESET (0x1)
33#define WDT_MODE_EN (0x1)
34
35struct 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
Chen-Yu Tsai0d152762014-10-04 20:37:26 +080047#endif /* _SUNXI_WATCHDOG_H_ */