mrst/vrtc: Avoid using cmos rtc ops

If we don't assign Moorestown specific wallclock init and ops function
the rtc/persisent clock code will use cmos rtc for access, this will
crash Moorestown in that the ioports are not present.

Also in vrtc driver, should avoid using cmos access to check UIP status.

[[email protected]: use set_fixmap_offset_nocache() to simplify code]
Signed-off-by: Jacob Pan <[email protected]>
Signed-off-by: Feng Tang <[email protected]>
Signed-off-by: Alan Cox <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
This commit is contained in:
Feng Tang 2011-02-15 00:13:32 +08:00 • committed by Thomas Gleixner
commit 168202c7bf
3 changed files with 18 additions and 13 deletions

View file

@ -62,6 +62,17 @@ static inline int is_intr(u8 rtc_intr)
return rtc_intr & RTC_IRQMASK;
}
static inline unsigned char vrtc_is_updating(void)
{
unsigned char uip;
unsigned long flags;
spin_lock_irqsave(&rtc_lock, flags);
uip = (vrtc_cmos_read(RTC_FREQ_SELECT) & RTC_UIP);
spin_unlock_irqrestore(&rtc_lock, flags);
return uip;
}
/*
* rtc_time's year contains the increment over 1900, but vRTC's YEAR
* register can't be programmed to value larger than 0x64, so vRTC
@ -76,7 +87,7 @@ static int mrst_read_time(struct device *dev, struct rtc_time *time)
{
unsigned long flags;
if (rtc_is_updating())
if (vrtc_is_updating())
mdelay(20);
spin_lock_irqsave(&rtc_lock, flags);