Re: RTC Bug on Indy?
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:
###########################
/*
* 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.
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?
Thanks!
Edwin
Reply to: