2 * linux/arch/m68k/sun3x/time.c
4 * Sun3x-specific time handling
7 #include <linux/types.h>
9 #include <linux/init.h>
10 #include <linux/sched.h>
11 #include <linux/kernel_stat.h>
12 #include <linux/interrupt.h>
13 #include <linux/rtc.h>
14 #include <linux/bcd.h>
18 #include <asm/machdep.h>
19 #include <asm/traps.h>
20 #include <asm/sun3x.h>
21 #include <asm/sun3ints.h>
25 #define M_CONTROL 0xf8
39 int sun3x_hwclk(int set, struct rtc_time *t)
41 volatile struct mostek_dt *h =
42 (struct mostek_dt *)(SUN3X_EEPROM+M_CONTROL);
45 local_irq_save(flags);
49 h->sec = bin2bcd(t->tm_sec);
50 h->min = bin2bcd(t->tm_min);
51 h->hour = bin2bcd(t->tm_hour);
52 h->wday = bin2bcd(t->tm_wday);
53 h->mday = bin2bcd(t->tm_mday);
54 h->month = bin2bcd(t->tm_mon);
55 h->year = bin2bcd(t->tm_year);
59 t->tm_sec = bcd2bin(h->sec);
60 t->tm_min = bcd2bin(h->min);
61 t->tm_hour = bcd2bin(h->hour);
62 t->tm_wday = bcd2bin(h->wday);
63 t->tm_mday = bcd2bin(h->mday);
64 t->tm_mon = bcd2bin(h->month);
65 t->tm_year = bcd2bin(h->year);
69 local_irq_restore(flags);
73 /* Not much we can do here */
74 u32 sun3x_gettimeoffset(void)
80 static void sun3x_timer_tick(int irq, void *dev_id, struct pt_regs *regs)
82 void (*vector)(int, void *, struct pt_regs *) = dev_id;
84 /* Clear the pending interrupt - pulse the enable line low */
88 vector(irq, NULL, regs);
92 void __init sun3x_sched_init(irq_handler_t vector)
95 sun3_disable_interrupts();
98 /* Pulse enable low to get the clock started */
101 sun3_enable_interrupts();