mc146818rtc_64.h 730 B

12345678910111213141516171819202122232425262728293031323334
  1. /*
  2. * Machine dependent access functions for RTC registers.
  3. */
  4. #ifndef __ASM_SPARC64_MC146818RTC_H
  5. #define __ASM_SPARC64_MC146818RTC_H
  6. #include <asm/io.h>
  7. #ifndef RTC_PORT
  8. #ifdef CONFIG_PCI
  9. extern unsigned long ds1287_regs;
  10. #else
  11. #define ds1287_regs (0UL)
  12. #endif
  13. #define RTC_PORT(x) (ds1287_regs + (x))
  14. #define RTC_ALWAYS_BCD 0
  15. #endif
  16. /*
  17. * The yet supported machines all access the RTC index register via
  18. * an ISA port access but the way to access the date register differs ...
  19. */
  20. #define CMOS_READ(addr) ({ \
  21. outb_p((addr),RTC_PORT(0)); \
  22. inb_p(RTC_PORT(1)); \
  23. })
  24. #define CMOS_WRITE(val, addr) ({ \
  25. outb_p((addr),RTC_PORT(0)); \
  26. outb_p((val),RTC_PORT(1)); \
  27. })
  28. #define RTC_IRQ 8
  29. #endif /* __ASM_SPARC64_MC146818RTC_H */