[RFC 0/5] add rtc support

Sascha Hauer s.hauer at pengutronix.de
Thu Jul 10 23:37:16 PDT 2014


On Fri, Jul 11, 2014 at 10:32:57AM +0400, Antony Pavlov wrote:
> On Fri, 11 Jul 2014 08:10:26 +0200
> Sascha Hauer <s.hauer at pengutronix.de> wrote:
> 
> > > I have an idea to put epoch offset (number of years into AD to which a zero year value
> > > in the Hardware Clock refers) into "global.epoch" variable and add corresponding
> > > Kconfig option for default epoch value.
> > 
> > Does Linux support such a mechanism aswell? How can we make sure Linux
> > uses the same epoch offset?
> 
> Here is a quote from my hwclock(8) manpage:
> 
>        --getepoch
>               Print  the  kernel's Hardware Clock epoch value to standard output.  This is the
>               number of years into AD to which a zero year value in the Hardware Clock refers.
>               For example, if you are using the convention that the year counter in your Hard‐
>               ware Clock contains the number of full years since 1952, then the kernel's Hard‐
>               ware Clock epoch value must be 1952.
> 
>               This epoch value is used whenever hwclock reads or sets the Hardware Clock.
> 
>        --setepoch
>               Set  the  kernel's  Hardware  Clock  epoch  value  to the value specified by the
>               --epoch option.  See the --getepoch option for details.
> 
> I suppose that Hardware Clock epoch depends on RTC-chip. I see no automatic machanism to guarantee the same epoch
> for linux and barebox.

Is this used anywhere? Running a hwclock --getepoch on my desktop PC
answers with:

| hwclock: The kernel keeps an epoch value for the Hardware Clock only on an Alpha machine.
| This copy of hwclock was built for a machine other than Alpha
| (and thus is presumably not running on an Alpha now).  No action taken.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



More information about the barebox mailing list