Skip to content

Commit

Permalink
[MIPS] SNI: Fix mc146818_decode_year
Browse files Browse the repository at this point in the history
Big endian RMs uses a different mc146818_decode_year than little endian RMs
Correct mc146818_decode_year for years before 2000

Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
  • Loading branch information
Thomas Bogendoerfer authored and Ralf Baechle committed Mar 4, 2007
1 parent 821d313 commit 49fa3c0
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion include/asm-mips/mach-atlas/mc146818rtc.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,6 @@ static inline void CMOS_WRITE(unsigned char data, unsigned long addr)

#define RTC_ALWAYS_BCD 0

#define mc146818_decode_year(year) ((year) < 70 ? (year) + 2000 : (year) + 1970)
#define mc146818_decode_year(year) ((year) < 70 ? (year) + 2000 : (year) + 1900)

#endif /* __ASM_MACH_ATLAS_MC146818RTC_H */
2 changes: 1 addition & 1 deletion include/asm-mips/mach-generic/mc146818rtc.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ static inline void CMOS_WRITE(unsigned char data, unsigned long addr)
#define RTC_ALWAYS_BCD 1

#ifndef mc146818_decode_year
#define mc146818_decode_year(year) ((year) < 70 ? (year) + 2000 : (year) + 1970)
#define mc146818_decode_year(year) ((year) < 70 ? (year) + 2000 : (year) + 1900)
#endif

#endif /* __ASM_MACH_GENERIC_MC146818RTC_H */
2 changes: 1 addition & 1 deletion include/asm-mips/mach-mips/mc146818rtc.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@ static inline void CMOS_WRITE(unsigned char data, unsigned long addr)

#define RTC_ALWAYS_BCD 0

#define mc146818_decode_year(year) ((year) < 70 ? (year) + 2000 : (year) + 1970)
#define mc146818_decode_year(year) ((year) < 70 ? (year) + 2000 : (year) + 1900)

#endif /* __ASM_MACH_MALTA_MC146818RTC_H */
10 changes: 7 additions & 3 deletions include/asm-mips/mach-rm/mc146818rtc.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,15 @@
*
* RTC routines for PC style attached Dallas chip with ARC epoch.
*/
#ifndef __ASM_MACH_RM200_MC146818RTC_H
#define __ASM_MACH_RM200_MC146818RTC_H
#ifndef __ASM_MACH_RM_MC146818RTC_H
#define __ASM_MACH_RM_MC146818RTC_H

#if CONFIG_CPU_BIG_ENDIAN
#define mc146818_decode_year(year) ((year) < 70 ? (year) + 2000 : (year) + 1900)
#else
#define mc146818_decode_year(year) ((year) + 1980)
#endif

#include_next <mc146818rtc.h>

#endif /* __ASM_MACH_RM200_MC146818RTC_H */
#endif /* __ASM_MACH_RM_MC146818RTC_H */

0 comments on commit 49fa3c0

Please sign in to comment.