Quote:
Hi there!
Another question about the real-time clock: one of the 2 board I bought is having a problem with the real-time clock - it is setting the date in 2016 and I promise my car is not a 1982 DeLorean :-)
We tried to set the clock using hwclock under Debian but it did not work (I have not had a chance yet to try it on the other board).
Can anyone confirm how to check the clock?
Thanks in advance
Olivier
There is an RTAS clock driver in /proc/rtas - you can write a value to this and it'll set the clock properly.
The MPC5200B has an RTC built in but it loses power when the board loses power - this is a design flaw of the chip. To fix it Gerald designed in a small PIC with a small embedded flash and a realtime clock (this also allows the ac-back-behaviour and potentially some other power management functionality). So the only way to truly access this PIC is through the RTAS clock.
A little while ago (2.6.9 or thereabouts) a lot of changes were made to in-kernel time code and RTC drivers which means RTAS isn't used in RTC emulation for some reason, and hwclock relies on ISA clocks and the old Linux RTC framework which isn't really the same.
If anyone wants to go ahead and fix this up, that'd be great. The easiest way is to patch the 'hwclock' scripts in your distribution but that means mimicing a lot of the hwclock tool's functionality in script form.
hwclock tool could also be patched to use RTAS.
The other way is to create an RTAS RTC driver in drivers/rtc which uses RTAS.
Take your pick. It is a Linux bug, not a board problem or an RTC problem, that it cannot handle an industry standard abstracted clock interface properly anymore.