From: Ralf Baechle <ralf@linux-mips.org>
To: "Maciej W. Rozycki" <macro@linux-mips.org>
Cc: James Hogan <james.hogan@imgtec.com>,
Paul Burton <paul.burton@imgtec.com>,
linux-mips@linux-mips.org
Subject: Re: [PATCH 1/2] MIPS: malta-time: Don't switch RTC to BCD mode
Date: Fri, 15 May 2015 20:03:51 +0200 [thread overview]
Message-ID: <20150515180351.GE2322@linux-mips.org> (raw)
In-Reply-To: <alpine.LFD.2.11.1505141122380.19904@eddie.linux-mips.org>
On Thu, May 14, 2015 at 11:53:22AM +0100, Maciej W. Rozycki wrote:
> > > The reason for init_rtc was touched upon in the commit message for
> > > a87ea88d8f6c (MIPS: Malta: initialise the RTC at boot) but could perhaps
> > > have been clearer. Straight out of reset the RTC may not be running at
> > > all, but the code in estimate_frequencies (note: not the RTC driver)
> > > relies upon the RTC having been started. This was an issue when using
> > > earlier builds of U-boot which didn't touch the RTC at all, and is still
> > > an issue if you do something like load the kernel via a JTAG probe
> > > rather than using U-boot or YAMON. If the kernel doesn't ensure the RTC
> > > is started then it'll just hang in estimate_frequencies waiting for the
> > > UIP bit to change even though it never will. YAMON isn't the only way to
> > > boot on Malta, and dependencies such as this between the kernel & the
> > > bootloader should really be minimised.
>
> You do need to take reverse dependencies into account though, such as
> this one where YAMON relies upon a certain state of hardware (that it
> does initialise) to function correctly. Granted, this RTC issue is
> probably the only one as other hardware on the Malta board does not
> carry initialised state over reset I believe.
>
> > > ...and since it seems the U-boot & YAMON RTC drivers use it in different
> > > modes, I'd consider this patch reasonable. Feel free to have my:
> > >
> > > Reviewed-by: Paul Burton <paul.burton@imgtec.com>
> >
> > Thanks Paul,
> >
> > Assuming Maciej is satisfied I'll rewrite the commit message, add a
> > stable tag, and resend.
>
> I'd prefer RTC state not to be touched at all if its state is sane.
> That is read Register B, check for the only valid divider setting
> (32kHz), and if so then exit right away, and otherwise initialise the
> chip from scratch. Consistency with YAMON might be a good idea in that
> initialisation, but I have no strong feeling towards that. If you think
> there's value in having the chip set to the BCD mode, then feel free to
> keep that option.
>
> Note that any inhibition of the RTC previously initialised by
> temporarily setting the SET bit in Register B during bootstrap will
> disturb timekeeping that the system may carry over reset using
> adjtimex(8).
So you're instead suggesting to revoke a87ea88d8f6c ?
If YAMON and U-Boot are differing in RTC handling then I suggest to
treat that as a U-Boot bug. YAMON was there first. However these
Malta kernels are also frequently booted without firmware in Qemu.
No idea how Qemu initializes the RTC.
Ralf
next prev parent reply other threads:[~2015-05-15 18:03 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-13 12:17 [PATCH 0/2] MIPS: malta-time: Take seconds into account James Hogan
2015-05-13 12:17 ` James Hogan
2015-05-13 12:17 ` [PATCH 1/2] MIPS: malta-time: Don't switch RTC to BCD mode James Hogan
2015-05-13 12:17 ` James Hogan
2015-05-13 18:03 ` Maciej W. Rozycki
2015-05-13 22:19 ` James Hogan
2015-05-13 22:19 ` James Hogan
2015-05-14 8:44 ` Paul Burton
2015-05-14 8:44 ` Paul Burton
2015-05-14 10:00 ` James Hogan
2015-05-14 10:00 ` James Hogan
2015-05-14 10:53 ` Maciej W. Rozycki
2015-05-15 18:03 ` Ralf Baechle [this message]
2015-05-15 18:14 ` Paul Burton
2015-05-15 18:14 ` Paul Burton
2015-05-15 21:13 ` Maciej W. Rozycki
2015-05-16 8:49 ` Joshua Kinard
2015-05-13 12:17 ` [PATCH 2/2] MIPS: malta-time: Take seconds into account James Hogan
2015-05-13 12:17 ` James Hogan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150515180351.GE2322@linux-mips.org \
--to=ralf@linux-mips.org \
--cc=james.hogan@imgtec.com \
--cc=linux-mips@linux-mips.org \
--cc=macro@linux-mips.org \
--cc=paul.burton@imgtec.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.