[RFC 5/5] commands: add hwclock

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


On Fri, Jul 11, 2014 at 09:59:36AM +0400, Antony Pavlov wrote:
> On Thu, 10 Jul 2014 23:45:47 +0200
> Sascha Hauer <s.hauer at pengutronix.de> wrote:
> 
> > > +BAREBOX_CMD_START(hwclock)
> > > +	.cmd		= do_hwclock,
> > > +	BAREBOX_CMD_DESC("query or set the hardware clock (RTC)")
> > 
> > This initial version doesn't allow to set the time.
> 
> I have no idea about simple and elegant solution for setting clock :(
> 
> My hwclock man page show me an example:
> 
>  hwclock --set --date="2011-08-14 16:45:05"
> 
> I'll try to find some ready-to-use strptime-like function (e.g. in uClibc).

The format which the date man page describes as "coordinated universal
time" seems quite easy to parse. It's [MMDDhhmm[[CC]YY][.ss]], so
071107572014 for now.

> 
> Also there is no epoch handling.
> 
> May be it's better to drop hwclock clock setting in the inital rtc support series?

I think we should have set time support from the beginning. I mean
setting the time is an important part of testing the drivers before
merging them.

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