watchdog.h 833 B

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