Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 /*
0003  * Machine dependent access functions for RTC registers.
0004  */
0005 #ifndef __ASM_SPARC64_MC146818RTC_H
0006 #define __ASM_SPARC64_MC146818RTC_H
0007 
0008 #include <asm/io.h>
0009 
0010 #ifndef RTC_PORT
0011 extern unsigned long cmos_regs;
0012 #define RTC_PORT(x) (cmos_regs + (x))
0013 #define RTC_ALWAYS_BCD  0
0014 #endif
0015 
0016 /*
0017  * The yet supported machines all access the RTC index register via
0018  * an ISA port access but the way to access the date register differs ...
0019  */
0020 #define CMOS_READ(addr) ({ \
0021 outb_p((addr),RTC_PORT(0)); \
0022 inb_p(RTC_PORT(1)); \
0023 })
0024 #define CMOS_WRITE(val, addr) ({ \
0025 outb_p((addr),RTC_PORT(0)); \
0026 outb_p((val),RTC_PORT(1)); \
0027 })
0028 
0029 #endif /* __ASM_SPARC64_MC146818RTC_H */