Back to home page

OSCL-LXR

 
 

    


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