Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
| 2 | * RTC definitions for DECstation style attached Dallas DS1287 chip. |
| 3 | * |
| 4 | * Copyright (C) 1998, 2001 by Ralf Baechle |
| 5 | * Copyright (C) 1998 by Harald Koerfgen |
Maciej W. Rozycki | a5fc9c0 | 2005-07-01 16:10:40 +0000 | [diff] [blame] | 6 | * Copyright (C) 2002, 2005 Maciej W. Rozycki |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 7 | * |
| 8 | * This program is free software; you can redistribute it and/or |
| 9 | * modify it under the terms of the GNU General Public License |
| 10 | * as published by the Free Software Foundation; either version |
| 11 | * 2 of the License, or (at your option) any later version. |
| 12 | */ |
| 13 | #ifndef __ASM_MIPS_DEC_RTC_DEC_H |
| 14 | #define __ASM_MIPS_DEC_RTC_DEC_H |
| 15 | |
| 16 | #include <linux/types.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 17 | #include <asm/addrspace.h> |
Maciej W. Rozycki | a5fc9c0 | 2005-07-01 16:10:40 +0000 | [diff] [blame] | 18 | #include <asm/dec/system.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 19 | |
| 20 | extern volatile u8 *dec_rtc_base; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 21 | |
Maciej W. Rozycki | 38e0e8c | 2006-07-10 04:45:30 -0700 | [diff] [blame] | 22 | #define ARCH_RTC_LOCATION |
| 23 | |
Maciej W. Rozycki | a5fc9c0 | 2005-07-01 16:10:40 +0000 | [diff] [blame] | 24 | #define RTC_PORT(x) CPHYSADDR((long)dec_rtc_base) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 25 | #define RTC_IO_EXTENT dec_kn_slot_size |
| 26 | #define RTC_IOMAPPED 0 |
| 27 | #undef RTC_IRQ |
| 28 | |
| 29 | #define RTC_DEC_YEAR 0x3f /* Where we store the real year on DECs. */ |
| 30 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 31 | static inline unsigned char CMOS_READ(unsigned long addr) |
| 32 | { |
| 33 | return dec_rtc_base[addr * 4]; |
| 34 | } |
| 35 | |
| 36 | static inline void CMOS_WRITE(unsigned char data, unsigned long addr) |
| 37 | { |
| 38 | dec_rtc_base[addr * 4] = data; |
| 39 | } |
| 40 | |
| 41 | #define RTC_ALWAYS_BCD 0 |
| 42 | |
| 43 | #endif /* __ASM_MIPS_DEC_RTC_DEC_H */ |