Port-sparc64 archive

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

Re: Sun Fire V240 RTC



Hi Frank,

> > It is very strange though.  I assumed from earlier that the M5819p was
> > being set by the firmware, because on Martin's machine, we saw the wrong
> > time being restored on each restart and I assumed that the wrong time was
> > coming from the DS1307.
> 
> Indeed. Booting with only DS1307 configured did prove now that it is not
> happening.

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

> But something (most likely ALOM) must change the M5819p on reboot, if we
> assume its NetBSD driver is running correctly and should also reset invalid
> values after a battery change.

I assume that it is, because we're using it on the other machines.  So,
if you run `date` or shutdown, then the system time is saved to the
configured RTC(s).

> > Or, does it only get changed through the ALOM's date command,
> > which sets both?
> 
> Unfortunately I cannot test that, because I never got the ALOM password with
> this used hardware. Not sure if I want to install Solaris now, to reset
> it... ;)

I remember netbooting the Solaris installer but I can't remember if scadm
is available without having to install somewhere.

> BTW, was an scadm-like tool ever considered for NetBSD?

That is annoying.  I briefly looked at this.  I booted Solaris on some
older machines (E250, 280R) and there the RSC is a serial port and it's
possible to trace the commands sent by the userland binary.  I have notes
for this somewhere, and we should be able to write a tool to drive RSC's.
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.

> The multi-RTC approach is certainly better, but otherwise we could also
> check the machine name for V240/245 on boot and remove the ebus-RTC entry
> from the OFW-tree or similar?

We could do that, but I'd prefer to get the multi-RTC approach working.

> > I guess that with the kernel patch to handle multiple RTC's, then running
> > the date command will solve the problem.
> 
> But I already tested that with limited success.

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).

If printf's show that we are getting and setting the time from/to both
RTC's, then I'm really confused that the M5819p consistently shows the
wrong time on reboot.  Just to double check, did you try running the date
comand when the multi-RTC kernel was running?

> > [...] I have been talking to Dave Tyson, who sent in some patches for
> > PCF8583 clock modes (PR 60700) and he is looking at using sysctl to read
> > the date from multiple RTC's.  It should be easy to add write support to
> > sysctl, which would be useful for testing.
> 
> Ok. If we can define by sysctl which RTC to use, and simply ignore the other
> one completely, then at least the warning is gone. :)

Hmm, it was more to display the current time for each RTC and maybe to write
a new time.  I had wondered about trying to set priorities for RTC's or to
choose the primary, but I thought that we needed to do it before the TODR
code runs, i.e. a kernel config time, so a boot parameter.

Regards,

Julian

-- 


Home | Main Index | Thread Index | Old Index