We have discovered on our custom board using iMX6DualLite that RTC is getting late for a few seconds after waking up from sleep. For the reference we have used SabreSD platform which also has this problem. If the device is awake constantly than RTC is doing fine so I do not think it is a calibration/capacitance problem.
I have not figured out from the documentation which RTC is working when iMX is wake/sleep. I understand there is HP and LP RTC.
On the other hand the RTC SVNS driver in kernel (3.0.53 and newer) does not comply with the reference manual. For example following is not mentioned in ref manual:
#define SNVS_LPSRTCMR 0x50 /* LP Secure Real Time Counter MSB Register */
#define SNVS_LPSRTCLR 0x54 /* LP Secure Real Time Counter LSB Register */
#define SNVS_LPCR_SRTC_ENV (1 << 0)
#define SNVS_LPCR_LPTA_EN (1 << 1)
#define SNVS_LPCR_LPWUI_EN (1 << 3)
Can someone explain what happens when iMX goes to sleep and how RTC counts the time in sleep?