X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=include%2Fasm-mips%2Fmach-atlas%2Fmc146818rtc.h;h=a73a5698420c1cde3486c42adbd4f5db6d349988;hb=refs%2Fheads%2Fvserver;hp=8799f921af9601752d608032eea5d8027fe7228e;hpb=5273a3df6485dc2ad6aa7ddd441b9a21970f003b;p=linux-2.6.git diff --git a/include/asm-mips/mach-atlas/mc146818rtc.h b/include/asm-mips/mach-atlas/mc146818rtc.h index 8799f921a..a73a56984 100644 --- a/include/asm-mips/mach-atlas/mc146818rtc.h +++ b/include/asm-mips/mach-atlas/mc146818rtc.h @@ -1,7 +1,9 @@ /* - * Carsten Langgaard, carstenl@mips.com - * Copyright (C) 1999,2000 MIPS Technologies, Inc. All rights reserved. - * Copyright (C) 2003 by Ralf Baechle + * Copyright (C) 1999, 2000, 2005 MIPS Technologies, Inc. + * All rights reserved. + * Authors: Carsten Langgaard + * Maciej W. Rozycki + * Copyright (C) 2003, 05 Ralf Baechle (ralf@linux-mips.org) * * This program is free software; you can distribute it and/or modify it * under the terms of the GNU General Public License (Version 2) as @@ -19,33 +21,36 @@ #ifndef __ASM_MACH_ATLAS_MC146818RTC_H #define __ASM_MACH_ATLAS_MC146818RTC_H -#include +#include + +#include + #include #include +#define ARCH_RTC_LOCATION -#define RTC_PORT(x) (ATLAS_RTC_ADR_REG + (x)*8) -#define RTC_IOMAPPED 1 -#define RTC_EXTENT 16 -#define RTC_IRQ ATLASINT_RTC - -#if CONFIG_CPU_LITTLE_ENDIAN -#define ATLAS_RTC_PORT(x) (RTC_PORT(x) + 0) -#else -#define ATLAS_RTC_PORT(x) (RTC_PORT(x) + 3) -#endif +#define RTC_PORT(x) (ATLAS_RTC_ADR_REG + (x) * 8) +#define RTC_IO_EXTENT 0x100 +#define RTC_IOMAPPED 0 +#define RTC_IRQ ATLAS_INT_RTC static inline unsigned char CMOS_READ(unsigned long addr) { - outb(addr, ATLAS_RTC_PORT(0)); + volatile u32 *ireg = (void *)CKSEG1ADDR(RTC_PORT(0)); + volatile u32 *dreg = (void *)CKSEG1ADDR(RTC_PORT(1)); - return inb(ATLAS_RTC_PORT(1)); + *ireg = addr; + return *dreg; } static inline void CMOS_WRITE(unsigned char data, unsigned long addr) { - outb(addr, ATLAS_RTC_PORT(0)); - outb(data, ATLAS_RTC_PORT(1)); + volatile u32 *ireg = (void *)CKSEG1ADDR(RTC_PORT(0)); + volatile u32 *dreg = (void *)CKSEG1ADDR(RTC_PORT(1)); + + *ireg = addr; + *dreg = data; } #define RTC_ALWAYS_BCD 0