2 * Machine dependent access functions for RTC registers.
4 #ifndef _ASM_MC146818RTC_H
5 #define _ASM_MC146818RTC_H
7 #include <linux/config.h>
8 #include <asm/atarihw.h>
11 /* RTC in Atari machines */
13 #include <asm/atarihw.h>
14 #include <asm/atariints.h>
16 #define RTC_HAS_IRQ (ATARIHW_PRESENT(TT_MFP))
17 #define RTC_IRQ IRQ_TT_MFP_RTC
18 #define RTC_IRQ_FLAGS IRQ_TYPE_FAST
19 #define RTC_PORT(x) (TT_RTC_BAS + 2*(x))
20 #define RTC_ALWAYS_BCD 0 /* TOS uses binary mode, Linux should be able
21 * to deal with both modes */
23 #define RTC_CHECK_DRIVER_INIT() (MACH_IS_ATARI && ATARIHW_PRESENT(TT_CLK))
24 #define RTC_MACH_INIT() \
26 epoch = atari_rtc_year_offset + 1900; \
28 /* select RTC int on H->L edge */ \
29 tt_mfp.active_edge &= ~0x40; \
31 #define RTC_MACH_EXIT()
33 /* On Atari, the year was stored with base 1970 in old TOS versions (before
34 * 3.06). Later, Atari recognized that this broke leap year recognition, and
35 * changed the base to 1968. Medusa and Hades always use the new version. */
36 #define RTC_CENTURY_SWITCH -1 /* no century switch */
37 #define RTC_MINYEAR epoch
39 #define CMOS_READ(addr) ({ \
40 atari_outb_p((addr),RTC_PORT(0)); \
41 atari_inb_p(RTC_PORT(1)); \
43 #define CMOS_WRITE(val, addr) ({ \
44 atari_outb_p((addr),RTC_PORT(0)); \
45 atari_outb_p((val),RTC_PORT(1)); \
47 #endif /* CONFIG_ATARI */
49 #endif /* _ASM_MC146818RTC_H */