Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-or-later */
0002 /*
0003  * RTC definitions for DECstation style attached Dallas DS1287 chip.
0004  *
0005  * Copyright (C) 1998, 2001 by Ralf Baechle
0006  * Copyright (C) 1998 by Harald Koerfgen
0007  * Copyright (C) 2002, 2005  Maciej W. Rozycki
0008  */
0009 #ifndef __ASM_MIPS_DEC_RTC_DEC_H
0010 #define __ASM_MIPS_DEC_RTC_DEC_H
0011 
0012 #include <linux/types.h>
0013 #include <asm/addrspace.h>
0014 #include <asm/dec/system.h>
0015 
0016 extern volatile u8 *dec_rtc_base;
0017 
0018 #define ARCH_RTC_LOCATION
0019 
0020 #define RTC_PORT(x) CPHYSADDR((long)dec_rtc_base)
0021 #define RTC_IO_EXTENT   dec_kn_slot_size
0022 #define RTC_IOMAPPED    0
0023 #undef RTC_IRQ
0024 
0025 #define RTC_DEC_YEAR    0x3f    /* Where we store the real year on DECs.  */
0026 
0027 static inline unsigned char CMOS_READ(unsigned long addr)
0028 {
0029     return dec_rtc_base[addr * 4];
0030 }
0031 
0032 static inline void CMOS_WRITE(unsigned char data, unsigned long addr)
0033 {
0034     dec_rtc_base[addr * 4] = data;
0035 }
0036 
0037 #define RTC_ALWAYS_BCD  0
0038 
0039 #endif /* __ASM_MIPS_DEC_RTC_DEC_H */