Linux 3.15-rc1
[linux/fpc-iii.git] / arch / mips / include / asm / mach-malta / mc146818rtc.h
blobea612f37f61484c7b0c0f29371086027c7ffb24e
1 /*
2 * Carsten Langgaard, carstenl@mips.com
3 * Copyright (C) 1999,2000 MIPS Technologies, Inc. All rights reserved.
4 * Copyright (C) 2003 by Ralf Baechle
6 * This program is free software; you can distribute it and/or modify it
7 * under the terms of the GNU General Public License (Version 2) as
8 * published by the Free Software Foundation.
10 * This program is distributed in the hope it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 * for more details.
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
19 * RTC routines for Malta style attached PIIX4 device, which contains a
20 * Motorola MC146818A-compatible Real Time Clock.
22 #ifndef __ASM_MACH_MALTA_MC146818RTC_H
23 #define __ASM_MACH_MALTA_MC146818RTC_H
25 #include <asm/io.h>
26 #include <asm/mips-boards/generic.h>
27 #include <asm/mips-boards/malta.h>
29 #define RTC_PORT(x) (0x70 + (x))
30 #define RTC_IRQ 8
32 static inline unsigned char CMOS_READ(unsigned long addr)
34 outb(addr, MALTA_RTC_ADR_REG);
35 return inb(MALTA_RTC_DAT_REG);
38 static inline void CMOS_WRITE(unsigned char data, unsigned long addr)
40 outb(addr, MALTA_RTC_ADR_REG);
41 outb(data, MALTA_RTC_DAT_REG);
44 #define RTC_ALWAYS_BCD 0
46 #define mc146818_decode_year(year) ((year) < 70 ? (year) + 2000 : (year) + 1900)
48 #endif /* __ASM_MACH_MALTA_MC146818RTC_H */