Port-sparc64 archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Sun Fire V240 RTC



Julian Coleman wrote:
So we know that the DS1307 clock on your machine is set correctly and stays
that way.

I'm not so sure anymore. See below.


[...]  So,
if you run `date` or shutdown, then the system time is saved to the
configured RTC(s).

Yes. Confirmed. See below.


BTW, was an scadm-like tool ever considered for NetBSD?
[...] However, for ALOM, I think that the information for the commands is in
the Solaris kernel driver and the userland binary doesn't communicate with
the ALOM (serial port) directly.  That makes it harder to write an scadm
for ALOM :-(  We'd probably need to write a kernel module based on the
OpenSolaris code.

Ok. Had a quick look. Looks like scadm is using librsc, which communicates via the rcmadm device (/devices/pseudo/rmcadm@0:rmcadm). Not sure where the devices source is in OpenSolaris. Maybe I have a deeper look later. But if the source is there then this might be a little project for somebody.


This puzzles me.  I'm almost certain that we do write to all the RTC's with
the patch when we run the date command, but maybe we need printf's in
src/sys/dev/ic/mc146818.c mc146818_gettime_ymdhms and mc146818_settime_ymdhms
to check that they are being called correctly (and src/sys/dev/i2c/ds1307.c
dsrtc_gettime_ymdhms, dsrtc_settime_ymdhms, dsrtc_gettime_timeval and
dsrtc_settime_timeval if we want to check that too).

I added some printf's this morning, and I can confirm that both RTCs are updated. During shutdown and also when setting the time with 'date'.

Boot:
[    13.850020] root file system type: ffs
[    13.895108] kern.module.path=/stand/sparc64/11.1/modules
[    13.950019] mc146818_gettime_ymdhms
[    14.000019]         20.11.56
[    14.020019]         getcent: 2056
[    14.050019]         year0: 2056
[    14.080019]         final: 2056
[    14.110019] WARNING: clock gained 10958 days
[    14.110019] dsrtc_gettime_ymdhms
[    14.220019] WARNING:  clock gained 946771200 seconds
[    15.840028] entropy: ready

Note, that both RTCs seem to have a problem and are off by 30 years, if we assume that the second warning belongs to the DS1307.

date:
[    36.231195] mc146818_settime_ymdhms
[    36.270819]         20.11.2026
[    36.270819]         -year0: 2026
[    36.270819]         -setcent: 26
[    36.270819]         final: 26
[    36.390400] dsrtc_settime_ymdhms

Shutdown:
[   293.359862] mc146818_settime_ymdhms
[   293.399467]         20.11.2026
[   293.399467]         -year0: 2026
[   293.399467]         -setcent: 26
[   293.399467]         final: 26
[   293.519048] dsrtc_settime_ymdhms
[   327.830012] syncing disks... done

The year written in the driver (at least mc146818, where I printed details) seems ok. But after reboot it always gains 30 years.

--
Frank Wille



Home | Main Index | Thread Index | Old Index