1
0

regs-rtc.h 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. /*
  2. * Freescale i.MX28 RTC Register Definitions
  3. *
  4. * Copyright (C) 2011 Marek Vasut <marek.vasut@gmail.com>
  5. * on behalf of DENX Software Engineering GmbH
  6. *
  7. * SPDX-License-Identifier: GPL-2.0+
  8. */
  9. #ifndef __MX28_REGS_RTC_H__
  10. #define __MX28_REGS_RTC_H__
  11. #include <asm/imx-common/regs-common.h>
  12. #ifndef __ASSEMBLY__
  13. struct mxs_rtc_regs {
  14. mxs_reg_32(hw_rtc_ctrl)
  15. mxs_reg_32(hw_rtc_stat)
  16. mxs_reg_32(hw_rtc_milliseconds)
  17. mxs_reg_32(hw_rtc_seconds)
  18. mxs_reg_32(hw_rtc_rtc_alarm)
  19. mxs_reg_32(hw_rtc_watchdog)
  20. mxs_reg_32(hw_rtc_persistent0)
  21. mxs_reg_32(hw_rtc_persistent1)
  22. mxs_reg_32(hw_rtc_persistent2)
  23. mxs_reg_32(hw_rtc_persistent3)
  24. mxs_reg_32(hw_rtc_persistent4)
  25. mxs_reg_32(hw_rtc_persistent5)
  26. mxs_reg_32(hw_rtc_debug)
  27. mxs_reg_32(hw_rtc_version)
  28. };
  29. #endif
  30. #define RTC_CTRL_SFTRST (1 << 31)
  31. #define RTC_CTRL_CLKGATE (1 << 30)
  32. #define RTC_CTRL_SUPPRESS_COPY2ANALOG (1 << 6)
  33. #define RTC_CTRL_FORCE_UPDATE (1 << 5)
  34. #define RTC_CTRL_WATCHDOGEN (1 << 4)
  35. #define RTC_CTRL_ONEMSEC_IRQ (1 << 3)
  36. #define RTC_CTRL_ALARM_IRQ (1 << 2)
  37. #define RTC_CTRL_ONEMSEC_IRQ_EN (1 << 1)
  38. #define RTC_CTRL_ALARM_IRQ_EN (1 << 0)
  39. #define RTC_STAT_RTC_PRESENT (1 << 31)
  40. #define RTC_STAT_ALARM_PRESENT (1 << 30)
  41. #define RTC_STAT_WATCHDOG_PRESENT (1 << 29)
  42. #define RTC_STAT_XTAL32000_PRESENT (1 << 28)
  43. #define RTC_STAT_XTAL32768_PRESENT (1 << 27)
  44. #define RTC_STAT_STALE_REGS_MASK (0xff << 16)
  45. #define RTC_STAT_STALE_REGS_OFFSET 16
  46. #define RTC_STAT_NEW_REGS_MASK (0xff << 8)
  47. #define RTC_STAT_NEW_REGS_OFFSET 8
  48. #define RTC_MILLISECONDS_COUNT_MASK 0xffffffff
  49. #define RTC_MILLISECONDS_COUNT_OFFSET 0
  50. #define RTC_SECONDS_COUNT_MASK 0xffffffff
  51. #define RTC_SECONDS_COUNT_OFFSET 0
  52. #define RTC_ALARM_VALUE_MASK 0xffffffff
  53. #define RTC_ALARM_VALUE_OFFSET 0
  54. #define RTC_WATCHDOG_COUNT_MASK 0xffffffff
  55. #define RTC_WATCHDOG_COUNT_OFFSET 0
  56. #define RTC_PERSISTENT0_ADJ_POSLIMITBUCK_MASK (0xf << 28)
  57. #define RTC_PERSISTENT0_ADJ_POSLIMITBUCK_OFFSET 28
  58. #define RTC_PERSISTENT0_ADJ_POSLIMITBUCK_2V83 (0x0 << 28)
  59. #define RTC_PERSISTENT0_ADJ_POSLIMITBUCK_2V78 (0x1 << 28)
  60. #define RTC_PERSISTENT0_ADJ_POSLIMITBUCK_2V73 (0x2 << 28)
  61. #define RTC_PERSISTENT0_ADJ_POSLIMITBUCK_2V68 (0x3 << 28)
  62. #define RTC_PERSISTENT0_ADJ_POSLIMITBUCK_2V62 (0x4 << 28)
  63. #define RTC_PERSISTENT0_ADJ_POSLIMITBUCK_2V57 (0x5 << 28)
  64. #define RTC_PERSISTENT0_ADJ_POSLIMITBUCK_2V52 (0x6 << 28)
  65. #define RTC_PERSISTENT0_ADJ_POSLIMITBUCK_2V48 (0x7 << 28)
  66. #define RTC_PERSISTENT0_EXTERNAL_RESET (1 << 21)
  67. #define RTC_PERSISTENT0_THERMAL_RESET (1 << 20)
  68. #define RTC_PERSISTENT0_ENABLE_LRADC_PWRUP (1 << 18)
  69. #define RTC_PERSISTENT0_AUTO_RESTART (1 << 17)
  70. #define RTC_PERSISTENT0_DISABLE_PSWITCH (1 << 16)
  71. #define RTC_PERSISTENT0_LOWERBIAS_MASK (0xf << 14)
  72. #define RTC_PERSISTENT0_LOWERBIAS_OFFSET 14
  73. #define RTC_PERSISTENT0_LOWERBIAS_NOMINAL (0x0 << 14)
  74. #define RTC_PERSISTENT0_LOWERBIAS_M25P (0x1 << 14)
  75. #define RTC_PERSISTENT0_LOWERBIAS_M50P (0x3 << 14)
  76. #define RTC_PERSISTENT0_DISABLE_XTALOK (1 << 13)
  77. #define RTC_PERSISTENT0_MSEC_RES_MASK (0x1f << 8)
  78. #define RTC_PERSISTENT0_MSEC_RES_OFFSET 8
  79. #define RTC_PERSISTENT0_MSEC_RES_1MS (0x01 << 8)
  80. #define RTC_PERSISTENT0_MSEC_RES_2MS (0x02 << 8)
  81. #define RTC_PERSISTENT0_MSEC_RES_4MS (0x04 << 8)
  82. #define RTC_PERSISTENT0_MSEC_RES_8MS (0x08 << 8)
  83. #define RTC_PERSISTENT0_MSEC_RES_16MS (0x10 << 8)
  84. #define RTC_PERSISTENT0_ALARM_WAKE (1 << 7)
  85. #define RTC_PERSISTENT0_XTAL32_FREQ (1 << 6)
  86. #define RTC_PERSISTENT0_XTAL32KHZ_PWRUP (1 << 5)
  87. #define RTC_PERSISTENT0_XTAL24KHZ_PWRUP (1 << 4)
  88. #define RTC_PERSISTENT0_LCK_SECS (1 << 3)
  89. #define RTC_PERSISTENT0_ALARM_EN (1 << 2)
  90. #define RTC_PERSISTENT0_ALARM_WAKE_EN (1 << 1)
  91. #define RTC_PERSISTENT0_CLOCKSOURCE (1 << 0)
  92. #define RTC_PERSISTENT1_GENERAL_MASK 0xffffffff
  93. #define RTC_PERSISTENT1_GENERAL_OFFSET 0
  94. #define RTC_PERSISTENT1_GENERAL_OTG_ALT_ROLE 0x0080
  95. #define RTC_PERSISTENT1_GENERAL_OTG_HNP 0x0100
  96. #define RTC_PERSISTENT1_GENERAL_USB_LPM 0x0200
  97. #define RTC_PERSISTENT1_GENERAL_SKIP_CHECKDISK 0x0400
  98. #define RTC_PERSISTENT1_GENERAL_USB_BOOT_PLAYER 0x0800
  99. #define RTC_PERSISTENT1_GENERAL_ENUM_500MA_2X 0x1000
  100. #define RTC_PERSISTENT2_GENERAL_MASK 0xffffffff
  101. #define RTC_PERSISTENT2_GENERAL_OFFSET 0
  102. #define RTC_PERSISTENT3_GENERAL_MASK 0xffffffff
  103. #define RTC_PERSISTENT3_GENERAL_OFFSET 0
  104. #define RTC_PERSISTENT4_GENERAL_MASK 0xffffffff
  105. #define RTC_PERSISTENT4_GENERAL_OFFSET 0
  106. #define RTC_PERSISTENT5_GENERAL_MASK 0xffffffff
  107. #define RTC_PERSISTENT5_GENERAL_OFFSET 0
  108. #define RTC_DEBUG_WATCHDOG_RESET_MASK (1 << 1)
  109. #define RTC_DEBUG_WATCHDOG_RESET (1 << 0)
  110. #define RTC_VERSION_MAJOR_MASK (0xff << 24)
  111. #define RTC_VERSION_MAJOR_OFFSET 24
  112. #define RTC_VERSION_MINOR_MASK (0xff << 16)
  113. #define RTC_VERSION_MINOR_OFFSET 16
  114. #define RTC_VERSION_STEP_MASK 0xffff
  115. #define RTC_VERSION_STEP_OFFSET 0
  116. #endif /* __MX28_REGS_RTC_H__ */