patch-2.4.22 linux-2.4.22/include/asm-arm/mc146818rtc.h

Next file: linux-2.4.22/include/asm-arm/memory.h
Previous file: linux-2.4.22/include/asm-arm/mach/serial_sa1100.h
Back to the patch index
Back to the overall index

diff -urN linux-2.4.21/include/asm-arm/mc146818rtc.h linux-2.4.22/include/asm-arm/mc146818rtc.h
@@ -16,13 +16,36 @@
  * The yet supported machines all access the RTC index register via
  * an ISA port access but the way to access the date register differs ...
  */
+
+
+#define CMOS_READ(addr) ({ \
+outb_p((addr),RTC_PORT(0)); \
+inb_p(RTC_PORT(1)); \
+})
+#define CMOS_WRITE(val, addr) ({ \
+outb_p((addr),RTC_PORT(0)); \
+outb_p((val),RTC_PORT(1)); \
+})
+
+#ifdef CONFIG_ARCH_RISCSTATION
+
+/* RiscStation hardware has a lock to ensure random read/writes can't
+ * do anything nasty to it
+*/
+
+#undef CMOS_READ
+#undef CMOS_WRITE
+
 #define CMOS_READ(addr) ({ \
 outb_p((addr),RTC_PORT(0)); \
+outb_p((addr),RTC_PORT(3)); \
 inb_p(RTC_PORT(1)); \
 })
 #define CMOS_WRITE(val, addr) ({ \
 outb_p((addr),RTC_PORT(0)); \
+outb_p((addr),RTC_PORT(3)); \
 outb_p((val),RTC_PORT(1)); \
 })
+#endif /* CONFIG_ARCH_RISCSTATION */
 
 #endif /* _ASM_MC146818RTC_H */

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)