mc146818rtc.h 647 B

12345678910111213141516171819202122232425262728
  1. /*
  2. * Machine dependent access functions for RTC registers.
  3. */
  4. #ifndef _ASM_MC146818RTC_H
  5. #define _ASM_MC146818RTC_H
  6. #include <asm/arch/irqs.h>
  7. #include <asm/io.h>
  8. #ifndef RTC_PORT
  9. #define RTC_PORT(x) (0x70 + (x))
  10. #define RTC_ALWAYS_BCD 1 /* RTC operates in binary mode */
  11. #endif
  12. /*
  13. * The yet supported machines all access the RTC index register via
  14. * an ISA port access but the way to access the date register differs ...
  15. */
  16. #define CMOS_READ(addr) ({ \
  17. outb_p((addr),RTC_PORT(0)); \
  18. inb_p(RTC_PORT(1)); \
  19. })
  20. #define CMOS_WRITE(val, addr) ({ \
  21. outb_p((addr),RTC_PORT(0)); \
  22. outb_p((val),RTC_PORT(1)); \
  23. })
  24. #endif /* _ASM_MC146818RTC_H */