mc146818rtc.h 943 B

123456789101112131415161718192021222324252627282930313233343536
  1. #ifndef _ASM_POWERPC_MC146818RTC_H
  2. #define _ASM_POWERPC_MC146818RTC_H
  3. /*
  4. * Machine dependent access functions for RTC registers.
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public License
  8. * as published by the Free Software Foundation; either version
  9. * 2 of the License, or (at your option) any later version.
  10. */
  11. #ifdef __KERNEL__
  12. #include <asm/io.h>
  13. #ifndef RTC_PORT
  14. #define RTC_PORT(x) (0x70 + (x))
  15. #define RTC_ALWAYS_BCD 1 /* RTC operates in binary mode */
  16. #endif
  17. /*
  18. * The yet supported machines all access the RTC index register via
  19. * an ISA port access but the way to access the date register differs ...
  20. */
  21. #define CMOS_READ(addr) ({ \
  22. outb_p((addr),RTC_PORT(0)); \
  23. inb_p(RTC_PORT(1)); \
  24. })
  25. #define CMOS_WRITE(val, addr) ({ \
  26. outb_p((addr),RTC_PORT(0)); \
  27. outb_p((val),RTC_PORT(1)); \
  28. })
  29. #endif /* __KERNEL__ */
  30. #endif /* _ASM_POWERPC_MC146818RTC_H */