mc146818rtc.h 935 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /*
  3. * RTC definitions for DECstation style attached Dallas DS1287 chip.
  4. *
  5. * Copyright (C) 1998, 2001 by Ralf Baechle
  6. * Copyright (C) 1998 by Harald Koerfgen
  7. * Copyright (C) 2002, 2005 Maciej W. Rozycki
  8. */
  9. #ifndef __ASM_MIPS_DEC_RTC_DEC_H
  10. #define __ASM_MIPS_DEC_RTC_DEC_H
  11. #include <linux/types.h>
  12. #include <asm/addrspace.h>
  13. #include <asm/dec/system.h>
  14. extern volatile u8 *dec_rtc_base;
  15. #define ARCH_RTC_LOCATION
  16. #define RTC_PORT(x) CPHYSADDR((long)dec_rtc_base)
  17. #define RTC_IO_EXTENT dec_kn_slot_size
  18. #define RTC_IOMAPPED 0
  19. #undef RTC_IRQ
  20. #define RTC_DEC_YEAR 0x3f /* Where we store the real year on DECs. */
  21. static inline unsigned char CMOS_READ(unsigned long addr)
  22. {
  23. return dec_rtc_base[addr * 4];
  24. }
  25. static inline void CMOS_WRITE(unsigned char data, unsigned long addr)
  26. {
  27. dec_rtc_base[addr * 4] = data;
  28. }
  29. #define RTC_ALWAYS_BCD 0
  30. #endif /* __ASM_MIPS_DEC_RTC_DEC_H */