* [U-Boot-Users] "date reset" for MPC8xx
@ 2003-04-14 13:16 Steven Scholz
2003-04-14 13:41 ` Wolfgang Denk
0 siblings, 1 reply; 2+ messages in thread
From: Steven Scholz @ 2003-04-14 13:16 UTC (permalink / raw)
To: u-boot
Hi there,
I think would should realy reset the MPC8xx's internal RTC when
calling "date reset" or "rtc_reset" instead of "nothing to do".
Please find and consider the attached patch.
Background:
I have seen it several times, that the MPC8xx's internal RTC contains
an invalid date, e.g. negative times (caused by no or low battery).
That might result in dates before 1970-01-01 under Linux and that in
turn confuses timeouts.
I've seen that udhcpc (from busybox) hangs in such cases!
For that reason u-boot should check for valid dates and do a
rtc_reset() if nessesary.
Thanks,
Steven
---------
CHANGELOG:
* Patch by Steven Scholz, 14 Apr 2003:
- reset_rtc() sets MPC8xx internal RTC back to 1970-01-01
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: mpc8xx_rtc.patch
Url: http://lists.denx.de/pipermail/u-boot/attachments/20030414/688eb3bf/attachment.txt
^ permalink raw reply [flat|nested] 2+ messages in thread
* [U-Boot-Users] "date reset" for MPC8xx
2003-04-14 13:16 [U-Boot-Users] "date reset" for MPC8xx Steven Scholz
@ 2003-04-14 13:41 ` Wolfgang Denk
0 siblings, 0 replies; 2+ messages in thread
From: Wolfgang Denk @ 2003-04-14 13:41 UTC (permalink / raw)
To: u-boot
Dear Steven,
in message <3E9AB4C2.6020500@imc-berlin.de> you wrote:
>
> I think would should realy reset the MPC8xx's internal RTC when
> calling "date reset" or "rtc_reset" instead of "nothing to do".
But on the MPC8xx's internal RTC there is no "reset" function, so it
is IMHO appropriate to do nothing.
> Please find and consider the attached patch.
>
> Background:
>
> I have seen it several times, that the MPC8xx's internal RTC contains
> an invalid date, e.g. negative times (caused by no or low battery).
There is no "invalid date" in the Unix notation of time_t. Negative
times (i. e. dates < January 1, 1970,00:00:00 UTC, are valid, too.
> That might result in dates before 1970-01-01 under Linux and that in
> turn confuses timeouts.
Oops? I am not aware of any part in U-Boot (or Linux) that uses the
system time for timeouts! And I cannot understand why January 1, 1970
should be any better than January 1, 1960 or January 1, 1950 or any
other arbitrarily chosen date.
> I've seen that udhcpc (from busybox) hangs in such cases!
FIx this, then.
> For that reason u-boot should check for valid dates and do a
> rtc_reset() if nessesary.
No. The RTC reset funtion is only to be used for RTC chips where the
hardware supports such a reset operation.
If you need a valid system time, please use the "date" command to set
a valid time.
Patch rejected.
Best regards,
Wolfgang Denk
--
Software Engineering: Embedded and Realtime Systems, Embedded Linux
Phone: (+49)-8142-4596-87 Fax: (+49)-8142-4596-88 Email: wd at denx.de
Any sufficiently advanced technology is indistinguishable from magic.
- Arthur C. Clarke
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2003-04-14 13:41 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-04-14 13:16 [U-Boot-Users] "date reset" for MPC8xx Steven Scholz
2003-04-14 13:41 ` Wolfgang Denk
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.