Re: RTC Bug on Indy?
Hi Guido and Ladis,
This bug occurs in at least two functions:
1. indy_rtc_get_time in arch/mips/sgi-ip22/ip22-time.c
2. ds1286_get_time in drivers/sgi/char/ds1286.c
My problem only went away after I patched
"ds1286_get_time()". Perhaps "indy_rtc_get_time()" is never
used on the Indy. I only used a Hex editor to change the
image file. I don't want to dig into building the kernel at
this time.
Since Ladis is going to fix it, I will leave it up
to him to write the bug report. My Indy is not yet connected
to the Internet.
Thanks!
Ladislav Michl wrote:
>
> On Thu, Sep 18, 2003 at 04:29:37PM -0700, Edwin Kwan wrote:
> > Hi guys,
> >
> > I think I found the problem.
> >
> > Take a look at:
> > http://www.linux-mips.org/cvsweb/linux/arch/mips/sgi-ip22/ip22-time.c
> >
> > Even at version 1.26 at the top, there is this code:
>
> code bellow is from 2.6 kernel.
>
> > ###########################
> > /*
> > * note that mktime uses month from 1 to 12 while to_tm
> > * uses 0 to 11.
> > */
> > static unsigned long indy_rtc_get_time(void)
> > {
> > unsigned int yrs, mon, day, hrs, min, sec;
> > unsigned int save_control;
> >
> > save_control = hpc3c0->rtcregs[RTC_CMD] & 0xff;
> > hpc3c0->rtcregs[RTC_CMD] = save_control | RTC_TE;
> >
> > sec = BCD2BIN(hpc3c0->rtcregs[RTC_SECONDS] & 0xff);
> > min = BCD2BIN(hpc3c0->rtcregs[RTC_MINUTES] & 0xff);
> > hrs = BCD2BIN(hpc3c0->rtcregs[RTC_HOURS] & 0x1f);
> > day = BCD2BIN(hpc3c0->rtcregs[RTC_DATE] & 0xff);
> > mon = BCD2BIN(hpc3c0->rtcregs[RTC_MONTH] & 0x1f);
> > yrs = BCD2BIN(hpc3c0->rtcregs[RTC_YEAR] & 0xff);
> >
> > hpc3c0->rtcregs[RTC_CMD] = save_control;
> > ###########################
> >
> > If the hour is in BCD, the mask should be 0x3f instead
> > of 0x1f.
>
> take a look at page 8 of http://pdfserv.maxim-ic.com/en/ds/DS1386-DS1386P.pdf
>
> > If I have to learn to build the kernel, it is going
> > to take a while. I would be just as happy if any of you could
> > fix it and give me a binary (r5k-ip22). :)
> >
> > Should I file a bug report? Against which repository and
> > how?
>
> no, it seems that there's a bug since ages. I'll fix it next week in case there
> won't be anyone faster :)
>
> ladis
Reply to: