summaryrefslogtreecommitdiffstats
path: root/kernel/arch/m68k/sun3/intersil.c
diff options
context:
space:
mode:
authorYunhong Jiang <yunhong.jiang@intel.com>2015-08-04 12:17:53 -0700
committerYunhong Jiang <yunhong.jiang@intel.com>2015-08-04 15:44:42 -0700
commit9ca8dbcc65cfc63d6f5ef3312a33184e1d726e00 (patch)
tree1c9cafbcd35f783a87880a10f85d1a060db1a563 /kernel/arch/m68k/sun3/intersil.c
parent98260f3884f4a202f9ca5eabed40b1354c489b29 (diff)
Add the rt linux 4.1.3-rt3 as base
Import the rt linux 4.1.3-rt3 as OPNFV kvm base. It's from git://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-rt-devel.git linux-4.1.y-rt and the base is: commit 0917f823c59692d751951bf5ea699a2d1e2f26a2 Author: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Sat Jul 25 12:13:34 2015 +0200 Prepare v4.1.3-rt3 Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> We lose all the git history this way and it's not good. We should apply another opnfv project repo in future. Change-Id: I87543d81c9df70d99c5001fbdf646b202c19f423 Signed-off-by: Yunhong Jiang <yunhong.jiang@intel.com>
Diffstat (limited to 'kernel/arch/m68k/sun3/intersil.c')
-rw-r--r--kernel/arch/m68k/sun3/intersil.c74
1 files changed, 74 insertions, 0 deletions
diff --git a/kernel/arch/m68k/sun3/intersil.c b/kernel/arch/m68k/sun3/intersil.c
new file mode 100644
index 000000000..889829e11
--- /dev/null
+++ b/kernel/arch/m68k/sun3/intersil.c
@@ -0,0 +1,74 @@
+/*
+ * arch/m68k/sun3/intersil.c
+ *
+ * basic routines for accessing the intersil clock within the sun3 machines
+ *
+ * started 11/12/1999 Sam Creasey
+ *
+ * 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.
+ */
+
+#include <linux/kernel.h>
+#include <linux/rtc.h>
+
+#include <asm/errno.h>
+#include <asm/rtc.h>
+#include <asm/intersil.h>
+
+
+/* bits to set for start/run of the intersil */
+#define STOP_VAL (INTERSIL_STOP | INTERSIL_INT_ENABLE | INTERSIL_24H_MODE)
+#define START_VAL (INTERSIL_RUN | INTERSIL_INT_ENABLE | INTERSIL_24H_MODE)
+
+/* does this need to be implemented? */
+u32 sun3_gettimeoffset(void)
+{
+ return 1000;
+}
+
+
+/* get/set hwclock */
+
+int sun3_hwclk(int set, struct rtc_time *t)
+{
+ volatile struct intersil_dt *todintersil;
+ unsigned long flags;
+
+ todintersil = (struct intersil_dt *) &intersil_clock->counter;
+
+ local_irq_save(flags);
+
+ intersil_clock->cmd_reg = STOP_VAL;
+
+ /* set or read the clock */
+ if(set) {
+ todintersil->csec = 0;
+ todintersil->hour = t->tm_hour;
+ todintersil->minute = t->tm_min;
+ todintersil->second = t->tm_sec;
+ todintersil->month = t->tm_mon;
+ todintersil->day = t->tm_mday;
+ todintersil->year = t->tm_year - 68;
+ todintersil->weekday = t->tm_wday;
+ } else {
+ /* read clock */
+ t->tm_sec = todintersil->csec;
+ t->tm_hour = todintersil->hour;
+ t->tm_min = todintersil->minute;
+ t->tm_sec = todintersil->second;
+ t->tm_mon = todintersil->month;
+ t->tm_mday = todintersil->day;
+ t->tm_year = todintersil->year + 68;
+ t->tm_wday = todintersil->weekday;
+ }
+
+ intersil_clock->cmd_reg = START_VAL;
+
+ local_irq_restore(flags);
+
+ return 0;
+
+}
+