Port-sparc64 archive

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

Re: Sun Fire V240 RTC



Hi Frank,

> this is not really important, but I'm curious:
> Does the V240 really have two RTCs? And why doesn't it save my time? :)
> 
> I have run ntpdate multiple times, but on every boot I get:
> WARNING: preposterous TOD clock time
> WARNING: using filesystem time
> WARNING: CHECK AND RESET THE DATE!
> 
> Could it be that the RTC's NVRAM contains illegal values and has to be reset
> in some way? (I replaced the battery.) How?

I'm fairly sure that if the battery is low for long enough, then the stored
date/time will be lost.  I guess that it now has some random value, so you
will need to run `date ....` (as root) which will then write to the TOD.

> And which one is the correct RTC? I noticed there is one on ebus and another
> one on I2C. The first one is enabled in the generic kernel:
> rtc0 at ebus0 addr 70-71: mc146818 compatible time-of-day clock: m5819p
> 
> But there is also this one (Dallas 1307):
> rscrtc (i2c-ds1307) at iic0 addr 0x68 not configured

This additional RTC in the V240 seems to be used directly by the ALOM.
From Martin's experience a while back, the DS1307 is used at reset time
to set the M5819p.  So, you would need to correct the time via the ALOM
for it to stay correct.  It would be interesting to use `date` to set
the M5819p and double check that the date/time is wrong on the next
boot.

> For a test, I configured it in my own kernel, but it is not used, of course:
> dsrtc0 at iic0 addr 0x68: DS1307 Real-time Clock/NVRAM
> todr_attach: TOD already configured

Right.  We currently only support a single TOD.  All others are ignored.
For sparc64, this means a number of machines with ALOM or multiple boards
won't synchronise all the hardware TOD's.  For the V240, you could try
this patch:

  http://ftp.netbsd.org/pub/NetBSD/misc/jdc/todr.diff

which will allow multiple system TOD's.  It still might need some updates
to handle preferred clocks or some way to configure which is the main
TOD, as outside of a few heuristics the first TOD in probe order is used
as the main TOD.

With the patch, all TOD's are written you run the `date` command (i.e. you
wouldn't need to use the ALOM to set the correct date).

Regards,

Julian

-- 


Home | Main Index | Thread Index | Old Index