summaryrefslogtreecommitdiffstats
path: root/include/asm-mips64/ds1286.h
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>1999-08-19 22:56:31 +0000
committerRalf Baechle <ralf@linux-mips.org>1999-08-19 22:56:31 +0000
commit8a1ae5514bf9f793282ea5a61254f7fbb3a5ec3e (patch)
tree317452d53b8f901052d08c7ebbce07e85839bb43 /include/asm-mips64/ds1286.h
parent794ff4dc959a8dfef4f704ef6a5bb7334e421623 (diff)
MIPS 64, day 2.
Diffstat (limited to 'include/asm-mips64/ds1286.h')
-rw-r--r--include/asm-mips64/ds1286.h71
1 files changed, 71 insertions, 0 deletions
diff --git a/include/asm-mips64/ds1286.h b/include/asm-mips64/ds1286.h
new file mode 100644
index 000000000..bf279ebcb
--- /dev/null
+++ b/include/asm-mips64/ds1286.h
@@ -0,0 +1,71 @@
+/* $Id$
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License. See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * mc146818rtc.h - register definitions for the Real-Time-Clock / CMOS RAM
+ * Copyright Torsten Duwe <duwe@informatik.uni-erlangen.de> 1993
+ * derived from Data Sheet, Copyright Motorola 1984 (!).
+ * It was written to be part of the Linux operating system.
+ *
+ * Copyright (C) 1998, 1999 Ralf Baechle
+ */
+#ifndef _ASM_DS1286_h
+#define _ASM_DS1286_h
+
+#include <asm/mc146818rtc.h>
+
+/**********************************************************************
+ * register summary
+ **********************************************************************/
+#define RTC_HUNDREDTH_SECOND 0
+#define RTC_SECONDS 1
+#define RTC_MINUTES 2
+#define RTC_MINUTES_ALARM 3
+#define RTC_HOURS 4
+#define RTC_HOURS_ALARM 5
+#define RTC_DAY 6
+#define RTC_DAY_ALARM 7
+#define RTC_DATE 8
+#define RTC_MONTH 9
+#define RTC_YEAR 10
+#define RTC_CMD 11
+#define RTC_WHSEC 12
+#define RTC_WSEC 13
+#define RTC_UNUSED 14
+
+/* RTC_*_alarm is always true if 2 MSBs are set */
+# define RTC_ALARM_DONT_CARE 0xC0
+
+
+/*
+ * Bits in the month register
+ */
+#define RTC_EOSC 0x80
+#define RTC_ESQW 0x40
+
+/*
+ * Bits in the Command register
+ */
+#define RTC_TDF 0x01
+#define RTC_WAF 0x02
+#define RTC_TDM 0x04
+#define RTC_WAM 0x08
+#define RTC_PU_LVL 0x10
+#define RTC_IBH_LO 0x20
+#define RTC_IPSW 0x40
+#define RTC_TE 0x80
+
+/*
+ * Conversion between binary and BCD.
+ */
+#ifndef BCD_TO_BIN
+#define BCD_TO_BIN(val) ((val)=((val)&15) + ((val)>>4)*10)
+#endif
+
+#ifndef BIN_TO_BCD
+#define BIN_TO_BCD(val) ((val)=(((val)/10)<<4) + (val)%10)
+#endif
+
+#endif /* _ASM_DS1286_h */