m48t35.h 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /*
  2. * Registers for the SGS-Thomson M48T35 Timekeeper RAM chip
  3. * and
  4. * Registers for the SGS-Thomson M48T37 Timekeeper RAM chip
  5. * The 37 is the 35 plus alarm and century thus the offsets
  6. * are shifted by the extra registers.
  7. */
  8. #ifndef __PPC_M48T35_H
  9. #define __PPC_M48T35_H
  10. /* RTC offsets */
  11. #define M48T35_RTC_FLAGS (-8) /* the negative regs are really T37 only */
  12. #define M48T35_RTC_CENTURY (-7)
  13. #define M48T35_RTC_AL_SEC (-6)
  14. #define M48T35_RTC_AL_MIN (-5)
  15. #define M48T35_RTC_AL_HRS (-4)
  16. #define M48T35_RTC_AL_DOM (-3)
  17. #define M48T35_RTC_INTERRUPT (-2)
  18. #define M48T35_RTC_WATCHDOG (-1)
  19. #define M48T35_RTC_CONTROL 0 /* T35 starts here */
  20. #define M48T35_RTC_SECONDS 1
  21. #define M48T35_RTC_MINUTES 2
  22. #define M48T35_RTC_HOURS 3
  23. #define M48T35_RTC_DAY 4
  24. #define M48T35_RTC_DOM 5
  25. #define M48T35_RTC_MONTH 6
  26. #define M48T35_RTC_YEAR 7
  27. /* this way help us know which bits go with which regs */
  28. #define M48T35_RTC_FLAGS_BL 0x10
  29. #define M48T35_RTC_FLAGS_AF 0x40
  30. #define M48T35_RTC_FLAGS_WDF 0x80
  31. #define M48T35_RTC_INTERRUPT_AFE 0x80
  32. #define M48T35_RTC_INTERRUPT_ABE 0x20
  33. #define M48T35_RTC_INTERRUPT_ALL (M48T35_RTC_INTERRUPT_AFE|M48T35_RTC_INTERRUPT_ABE)
  34. #define M48T35_RTC_WATCHDOG_RB 0x03
  35. #define M48T35_RTC_WATCHDOG_BMB 0x7c
  36. #define M48T35_RTC_WATCHDOG_WDS 0x80
  37. #define M48T35_RTC_WATCHDOG_ALL (M48T35_RTC_WATCHDOG_RB|M48T35_RTC_WATCHDOG_BMB|M48T35_RTC_W
  38. #define M48T35_RTC_CONTROL_WRITE 0x80
  39. #define M48T35_RTC_CONTROL_READ 0x40
  40. #define M48T35_RTC_CONTROL_CAL_SIGN 0x20
  41. #define M48T35_RTC_CONTROL_CAL_VALUE 0x1f
  42. #define M48T35_RTC_CONTROL_LOCKED (M48T35_RTC_WRITE|M48T35_RTC_READ)
  43. #define M48T35_RTC_CONTROL_CALIBRATION (M48T35_RTC_CONTROL_CAL_SIGN|M48T35_RTC_CONTROL_CAL_VALUE)
  44. #define M48T35_RTC_SECONDS_SEC_1 0x0f
  45. #define M48T35_RTC_SECONDS_SEC_10 0x70
  46. #define M48T35_RTC_SECONDS_ST 0x80
  47. #define M48T35_RTC_SECONDS_SEC_ALL (M48T35_RTC_SECONDS_SEC_1|M48T35_RTC_SECONDS_SEC_10)
  48. #define M48T35_RTC_MINUTES_MIN_1 0x0f
  49. #define M48T35_RTC_MINUTES_MIN_10 0x70
  50. #define M48T35_RTC_MINUTES_MIN_ALL (M48T35_RTC_MINUTES_MIN_1|M48T35_RTC_MINUTES_MIN_10)
  51. #define M48T35_RTC_HOURS_HRS_1 0x0f
  52. #define M48T35_RTC_HOURS_HRS_10 0x30
  53. #define M48T35_RTC_HOURS_HRS_ALL (M48T35_RTC_HOURS_HRS_1|M48T35_RTC_HOURS_HRS_10)
  54. #define M48T35_RTC_DAY_DAY_1 0x03
  55. #define M48T35_RTC_DAY_FT 0x40
  56. #define M48T35_RTC_ALARM_OFF 0x00
  57. #define M48T35_RTC_WATCHDOG_OFF 0x00
  58. /* legacy */
  59. #define M48T35_RTC_SET 0x80
  60. #define M48T35_RTC_STOPPED 0x80
  61. #define M48T35_RTC_READ 0x40
  62. #endif