Skip to contentSkip to conversation

spitz: Real time clock?

DISCUSSION Pavel Machek 3 participants 5 messages Dec 9, 2005 – Dec 10, 2005

lore
Share & tools
lore
#0 lore raw

Hi!

Is there driver for real time clock for spitz? I seem to get default time each time I boot. (And thats bad because means fsck "too much time since last check, check forced).

Pavel

Signature · 1 line
Thanks, Sharp!
#1 lore raw
Quoted 3 lines · Pavel Machek

Is there driver for real time clock for spitz? I seem to get default time each time I boot. (And thats bad because means fsck "too much time since last check, check forced).

There is but its already included with the kernels you have. It doesn't survive reboots and this is a limitation of the PXA processor. There's not a lot we can do about it I'm afraid.

Richard

#2 lore raw
Quoted 8 lines · Richard Purdie
Quoted 3 lines · Pavel Machek

Is there driver for real time clock for spitz? I seem to get default time each time I boot. (And thats bad because means fsck "too much time since last check, check forced).

There is but its already included with the kernels you have. It doesn't survive reboots and this is a limitation of the PXA processor. There's not a lot we can do about it I'm afraid.

Ouch, that's bad :-(. So PXA can't keep time properly... could we do something like storing time on system shutdown and restoring it on bootup? That way at least time will be monotonic... Ok, that's userland problem.

Is there way to reboot without "really" rebooting? That would help at least in my usage case. (Also reboot really does poweroff, not reboot, but...)

Pavel

Signature · 1 line
Thanks, Sharp!
#3 lore raw
Quoted 11 lines · Pavel Machek
Quoted 8 lines · Richard Purdie
Quoted 3 lines · Pavel Machek

Is there driver for real time clock for spitz? I seem to get default time each time I boot. (And thats bad because means fsck "too much time since last check, check forced).

There is but its already included with the kernels you have. It doesn't survive reboots and this is a limitation of the PXA processor. There's not a lot we can do about it I'm afraid.

Ouch, that's bad :-(. So PXA can't keep time properly...

The RTC count is lost on a hard reset. It survives sleep mode though.

The fact is that PocketPC/WinCE is not meant to be "rebooted" and the RTC on the PXA was probably designed with that fact. The normal usage pattern is to go into sleep mode all the time.

Quoted 3 lines

could we do something like storing time on system shutdown and restoring it on bootup? That way at least time will be monotonic... Ok, that's userland problem.

I'd say so.

Quoted 2 lines

Is there way to reboot without "really" rebooting? That would help at least in my usage case.

You should be able to "soft" reboot which will also preserve the RTC count.

Nicolas

#4 lore raw
Quoted 5 lines · Nicolas Pitre

The RTC count is lost on a hard reset. It survives sleep mode though.

The fact is that PocketPC/WinCE is not meant to be "rebooted" and the RTC on the PXA was probably designed with that fact. The normal usage pattern is to go into sleep mode all the time.

Which is the aim of the Zaurus kernel although it doesn't help when developing...

Quoted 5 lines
Quoted 3 lines

could we do something like storing time on system shutdown and restoring it on bootup? That way at least time will be monotonic... Ok, that's userland problem.

I'd say so.

OpenZaurus/OE did have code to try and do this built into its images. I'm not sure what its status is at the moment.

Quoted 5 lines
Quoted 2 lines

Is there way to reboot without "really" rebooting? That would help at least in my usage case.

You should be able to "soft" reboot which will also preserve the RTC count.

Based on past performance, the bootloader (in ROM) will probably corrupt/reset the RTC but I'd like to be proved wrong.

Russell posted some rough code to linux-arm-kernel recently that allowed you load a new kernel in a kexec sort of manner and that is probably the best bet to preserve the RTC. This functionality would be useful on the Zaurus in general.

Richard