mk48t59.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * (C) Copyright 2001 Sysgo Real-Time Solutions, GmbH <www.elinos.com>
  4. * Andreas Heppel <aheppel@sysgo.de>
  5. */
  6. /*
  7. * Date & Time support for the MK48T59 RTC
  8. */
  9. #if defined(CONFIG_RTC_MK48T59) && defined(CONFIG_CMD_DATE)
  10. #define RTC_PORT_ADDR0 CONFIG_SYS_ISA_IO + 0x70
  11. #define RTC_PORT_ADDR1 RTC_PORT_ADDR0 + 0x1
  12. #define RTC_PORT_DATA CONFIG_SYS_ISA_IO + 0x76
  13. /* RTC Offsets */
  14. #define RTC_SECONDS 0x1FF9
  15. #define RTC_MINUTES 0x1FFA
  16. #define RTC_HOURS 0x1FFB
  17. #define RTC_DAY_OF_WEEK 0x1FFC
  18. #define RTC_DAY_OF_MONTH 0x1FFD
  19. #define RTC_MONTH 0x1FFE
  20. #define RTC_YEAR 0x1FFF
  21. #define RTC_CONTROLA 0x1FF8
  22. #define RTC_CA_WRITE 0x80
  23. #define RTC_CA_READ 0x40
  24. #define RTC_CA_CALIB_SIGN 0x20
  25. #define RTC_CA_CALIB_MASK 0x1f
  26. #define RTC_CONTROLB 0x1FF9
  27. #define RTC_CB_STOP 0x80
  28. #define RTC_WATCHDOG 0x1FF7
  29. #define RTC_WDS 0x80
  30. #define RTC_WD_RB_16TH 0x0
  31. #define RTC_WD_RB_4TH 0x1
  32. #define RTC_WD_RB_1 0x2
  33. #define RTC_WD_RB_4 0x3
  34. void rtc_set_watchdog(short multi, short res);
  35. void *nvram_read(void *dest, const short src, size_t count);
  36. void nvram_write(short dest, const void *src, size_t count);
  37. #endif