Port-sparc64 archive

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

Re: Sun Fire V240 RTC



Hi Frank,

> > Yes, that should work for 11. Changing the system time should change the
> > ALOM time too.
> 
> I tried that after your new patch from below, and the result is that
> using the DS1307 alone makes all warnings disappear. Then the time is
> correctly saved to the chip and can be used after a reboot.

Which all sounds as expected.

> So for what did we exactly need the M5819p? :)

Good question :-)  Why did the hardware designers keep this RTC as well?
I guess that because it's part of the bridge chip, the easiest path was
to leave it configured and use software to set it.  But see also at the
end of the mail.

> I changed todr_dev to cookie and todr_base_time to base_time, to make
> it compile in the 11-branch.
> 
> The patched kernel definitely has an effect. The original warnings
> are gone after a reboot, but now I have this warning instead:
> 
> WARNING:  clock gained 946771200 seconds
> 
> I would guess that this warning is caused by the M5819p. It is still
> the same after I set the time with a DS1307-only kernel and then
> switched to the patched kernel again.

One reason why the patch needs todr_dev is so that it can print out which
clock has the bad setting.  (The other is to add sysctl support, but that
will be later.)  Otherwise, we don't know which clock is out of sync, but
I guess that it's the M5819p as well.

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.  However, this doesn't seem to be happening on
your machine.  I wonder if there is a difference in firmware versions,
or if the firmware won't change the M5819p time by more than a certain
amount.  Or, does it only get changed through the ALOM's date command,
which sets both?

> Is the mc146818.c driver known to be working in other hardware?

Yes, definitely.  It is present in the ALi chipset on quite a few machines
and works fine.  For example (I have dmesg's handy):

SB2000
  rtc0 at ebus0 addr 300070-300071 ipl 24: mc146818 compatible time-of-day clock: ds1287

SB2500s
  rtc0 at ebus0 addr 70-71: mc146818 compatible time-of-day clock: m5823

V245
  rtc0 at ebus0 addr 70-73: mc146818 compatible time-of-day clock: m5823

The different models have a few extra features, but they all have the same
MC146818-compatible registers, which are the only ones that we are using
in our driver.

Now we're back a few messages ago and trying to work out which of the
multiple RTC's on the machine is the system/correct one when they are
not synchronised :-)  For sparc64, we have rtc at ebus in the kernel
config because there are desktop machines (SB2000, SB2500, etc.) which
use it as their only RTC.  However, there are also servers (V240, V245,
etc.) that have the OFW entry for it but also have the other RTC used
by the ALOM.  V245 also has, like V240:

  dsrtc0 at iic0 addr 0x68: DS1307 Real-time Clock/NVRAM
  dsrtc0: secondary clock

Because the kernel TODR code doesn't support more than 1 RTC, we don't
have the dsrtc at iic config entries.  It certainly seems on the V240
that we need handle it though.  Possibly every time the backup battery
is changed?

I guess that with the kernel patch to handle multiple RTC's, then running
the date command will solve the problem.  It will also make it harder to
test again in future, but maybe that doesn't matter for now.  Related to
that, 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.  However, I don't think that
we'll get that done for a few weeks (mainly because I'm away from my
machines at the moment).

Regards,

Julian

-- 


Home | Main Index | Thread Index | Old Index