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/system.h>
19 #include <asm/traps.h>
20 #include <asm/sun3x.h>
21 #include <asm/sun3ints.h>
26 #define M_CONTROL 0xf8
40 int sun3x_hwclk(int set
, struct rtc_time
*t
)
42 volatile struct mostek_dt
*h
=
43 (struct mostek_dt
*)(SUN3X_EEPROM
+M_CONTROL
);
46 local_irq_save(flags
);
50 h
->sec
= BIN2BCD(t
->tm_sec
);
51 h
->min
= BIN2BCD(t
->tm_min
);
52 h
->hour
= BIN2BCD(t
->tm_hour
);
53 h
->wday
= BIN2BCD(t
->tm_wday
);
54 h
->mday
= BIN2BCD(t
->tm_mday
);
55 h
->month
= BIN2BCD(t
->tm_mon
);
56 h
->year
= BIN2BCD(t
->tm_year
);
60 t
->tm_sec
= BCD2BIN(h
->sec
);
61 t
->tm_min
= BCD2BIN(h
->min
);
62 t
->tm_hour
= BCD2BIN(h
->hour
);
63 t
->tm_wday
= BCD2BIN(h
->wday
);
64 t
->tm_mday
= BCD2BIN(h
->mday
);
65 t
->tm_mon
= BCD2BIN(h
->month
);
66 t
->tm_year
= BCD2BIN(h
->year
);
70 local_irq_restore(flags
);
74 /* Not much we can do here */
75 unsigned long sun3x_gettimeoffset (void)
81 static void sun3x_timer_tick(int irq
, void *dev_id
, struct pt_regs
*regs
)
83 void (*vector
)(int, void *, struct pt_regs
*) = dev_id
;
85 /* Clear the pending interrupt - pulse the enable line low */
89 vector(irq
, NULL
, regs
);
93 void __init
sun3x_sched_init(irqreturn_t (*vector
)(int, void *, struct pt_regs
*))
96 sun3_disable_interrupts();
99 /* Pulse enable low to get the clock started */
102 sun3_enable_interrupts();