Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /*
0003  * Carsten Langgaard, carstenl@mips.com
0004  * Copyright (C) 1999,2000 MIPS Technologies, Inc.  All rights reserved.
0005  * Copyright (C) 2003 by Ralf Baechle
0006  *
0007  * RTC routines for Malta style attached PIIX4 device, which contains a
0008  * Motorola MC146818A-compatible Real Time Clock.
0009  */
0010 #ifndef __ASM_MACH_MALTA_MC146818RTC_H
0011 #define __ASM_MACH_MALTA_MC146818RTC_H
0012 
0013 #include <asm/io.h>
0014 #include <asm/mips-boards/generic.h>
0015 #include <asm/mips-boards/malta.h>
0016 
0017 #define RTC_PORT(x) (0x70 + (x))
0018 #define RTC_IRQ     8
0019 
0020 static inline unsigned char CMOS_READ(unsigned long addr)
0021 {
0022     outb(addr, MALTA_RTC_ADR_REG);
0023     return inb(MALTA_RTC_DAT_REG);
0024 }
0025 
0026 static inline void CMOS_WRITE(unsigned char data, unsigned long addr)
0027 {
0028     outb(addr, MALTA_RTC_ADR_REG);
0029     outb(data, MALTA_RTC_DAT_REG);
0030 }
0031 
0032 #define RTC_ALWAYS_BCD  0
0033 
0034 #define mc146818_decode_year(year) ((year) < 70 ? (year) + 2000 : (year) + 1900)
0035 
0036 #endif /* __ASM_MACH_MALTA_MC146818RTC_H */