From: Alexandre Belloni <alexandre.belloni@free-electrons.com>
To: Rabeeh Khoury <rabeeh@solid-run.com>
Cc: Gregory CLEMENT <gregory.clement@free-electrons.com>,
Baruch Siach <baruch@tkos.co.il>,
Thomas Petazzoni <thomas.petazzoni@free-electrons.com>,
linux-rtc@vger.kernel.org,
"nadavh@marvell.com" <nadavh@marvell.com>
Subject: Re: Armada RTC power up reset
Date: Mon, 11 Dec 2017 17:08:35 +0100 [thread overview]
Message-ID: <20171211160835.GC32306@piout.net> (raw)
In-Reply-To: <CA+j0ot=PqFYwN=+zUc5F1uyXQoB9dX1gmwxTbXP-QdzQU+zspQ@mail.gmail.com>
On 11/12/2017 at 14:46:41 +0200, Rabeeh Khoury wrote:
> On Fri, Dec 1, 2017 at 7:10 PM, Gregory CLEMENT <
> gregory.clement@free-electrons.com> wrote:
>
> > Hi Baruch,
> >
> > On jeu., nov. 30 2017, Baruch Siach <baruch@tkos.co.il> wrote:
> >
> > > Hi Thomas,
> > >
> > > As you know, the Armada 38x/8k RTC needs a reset sequence to be
> > operational
> > > when first powered up. This reset code is currently in the vendor
> > provided
> > > U-Boot RTC driver. But having to run 'date reset' from the U-Boot prompt
> > every
> > > first boot (happens quite a lot when dealing with SOMs) is not nice. An
> > > automatic reset in the kernel driver would be much better.
> > >
> > > Rabeeh has mentioned to me that you had an idea how to detect at run
> > time that
> > > the RTC is in first power up state. Do you recall the details?
> >
> > Actually it was me who worked on the RTC but I didn't remember having a
> > way to detect that the RTC is in first power up state. I dig in the
> > datasheet, errata sheet and alos on varisou branches of the vendor tree
> > and didn't find anything.
> >
> > Maybe a solution could be to reset the RTC when we set the time.
> >
>
>
> This is one way to do it; but then on first boot you might get real awkward
> time; like year 2035 which can seriously confuse the boot process.
> Detecting an uninitialized RTC and forcing it to tick with time = 0 (i.e.
> 1970) is better way since boot failures can be reproduced in an orderly
> manner (and the developer would know what was really wrong).
Certainly not. If you know the time is invalid, then just return an
error. Else, userspace has no way to know whether it can rely on the
time from the RTC and act accordingly.
--
Alexandre Belloni, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
next prev parent reply other threads:[~2017-12-11 16:08 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-30 9:40 Armada RTC power up reset Baruch Siach
2017-12-01 17:10 ` Gregory CLEMENT
2017-12-11 12:46 ` Rabeeh Khoury
2017-12-11 16:08 ` Alexandre Belloni [this message]
2017-12-11 18:14 ` Rabeeh Khoury
2017-12-20 17:02 ` Alexandre Belloni
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=20171211160835.GC32306@piout.net \
--to=alexandre.belloni@free-electrons.com \
--cc=baruch@tkos.co.il \
--cc=gregory.clement@free-electrons.com \
--cc=linux-rtc@vger.kernel.org \
--cc=nadavh@marvell.com \
--cc=rabeeh@solid-run.com \
--cc=thomas.petazzoni@free-electrons.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.