// SPDX-License-Identifier: GPL-2.0 /* * linux/arch/m68k/sun3x/time.c * * Sun3x-specific time handling */ #include <linux/types.h> #include <linux/kd.h> #include <linux/init.h> #include <linux/sched.h> #include <linux/kernel_stat.h> #include <linux/interrupt.h> #include <linux/rtc.h> #include <linux/bcd.h> #include <asm/irq.h> #include <asm/io.h> #include <asm/machdep.h> #include <asm/traps.h> #include <asm/sun3x.h> #include <asm/sun3ints.h> #include "time.h" #define M_CONTROL 0xf8 #define M_SEC 0xf9 #define M_MIN 0xfa #define M_HOUR 0xfb #define M_DAY 0xfc #define M_DATE 0xfd #define M_MONTH 0xfe #define M_YEAR 0xff #define C_WRITE 0x80 #define C_READ 0x40 #define C_SIGN 0x20 #define C_CALIB 0x1f
int sun3x_hwclk(int set, struct rtc_time *t) { volatile struct mostek_dt *h = (struct mostek_dt *)(SUN3X_EEPROM+M_CONTROL); unsigned long flags; local_irq_save(flags); if(set) { h->csr |= C_WRITE; h->sec = bin2bcd(t->tm_sec); h->min = bin2bcd(t->tm_min); h->hour = bin2bcd(t->tm_hour); h->wday = bin2bcd(t->tm_wday); h->mday = bin2bcd(t->tm_mday); h->month = bin2bcd(t->tm_mon); h->year = bin2bcd(t->tm_year); h->csr &= ~C_WRITE; } else { h->csr |= C_READ; t->tm_sec = bcd2bin(h->sec); t->tm_min = bcd2bin(h->min); t->tm_hour = bcd2bin(h->hour); t->tm_wday = bcd2bin(h->wday); t->tm_mday = bcd2bin(h->mday); t->tm_mon = bcd2bin(h->month); t->tm_year = bcd2bin(h->year); h->csr &= ~C_READ; } local_irq_restore(flags); return 0; }Contributors
Person | Tokens | Prop | Commits | CommitProp |
Linus Torvalds | 203 | 86.02% | 1 | 25.00% |
Roman Zippel | 17 | 7.20% | 1 | 25.00% |
Adrian Bunk | 14 | 5.93% | 1 | 25.00% |
Geert Uytterhoeven | 2 | 0.85% | 1 | 25.00% |
Total | 236 | 100.00% | 4 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp |
Linus Torvalds (pre-git) | 9 | 90.00% | 1 | 50.00% |
Stephen Warren | 1 | 10.00% | 1 | 50.00% |
Total | 10 | 100.00% | 2 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp |
Linus Torvalds (pre-git) | 18 | 69.23% | 2 | 50.00% |
Linus Torvalds | 7 | 26.92% | 1 | 25.00% |
David Howells | 1 | 3.85% | 1 | 25.00% |
Total | 26 | 100.00% | 4 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp |
Linus Torvalds | 217 | 57.71% | 1 | 7.69% |
Linus Torvalds (pre-git) | 106 | 28.19% | 2 | 15.38% |
Roman Zippel | 20 | 5.32% | 1 | 7.69% |
Adrian Bunk | 14 | 3.72% | 1 | 7.69% |
Geert Uytterhoeven | 9 | 2.39% | 3 | 23.08% |
Arnd Bergmann | 4 | 1.06% | 1 | 7.69% |
Andrew Morton | 3 | 0.80% | 1 | 7.69% |
David Howells | 1 | 0.27% | 1 | 7.69% |
Stephen Warren | 1 | 0.27% | 1 | 7.69% |
Greg Kroah-Hartman | 1 | 0.27% | 1 | 7.69% |
Total | 376 | 100.00% | 13 | 100.00% |