This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM335X RTC stops during kernel booting

Other Parts Discussed in Thread: AM3358

Hi !

We have designed a custom board on AM3358 processor and running Linux kernel3.12 on it. The board has an external RTC(RAMTRAN FM31256) powered by a lithium battery.

I am trying to synchronize both the External and Internal RTC's in the U-Boot before kernel boot up. I read the time from the External RTC and write to the Internel AM335x RTC in u-boot. I observed that both the RTC's are in Sync.. However, when the kernel starts boot up, i observed that the AM335x RTC does not increment its time untill unless kernel register's the AM335x RTC as rtc0.

So every time i do a cold reset, even though both the RTC's are syncronized in u-boot, by the time the kernel loads the Internal RTC is off by the kernel loading time!!  (using silicon Ver 2)

I was wondering if any one has the same problem and explain me which kernel is turning off the clocks and why Am335x RTC starts incremeting only after its registered by kernel even though its been configured and written in u-boot.

Please find the sample log below when i loaded the rtc-omap.c as a module from the inittab  after kernel booted up..

(i kernel)

# .././sync.sh 
# .././show.sh
Internal:
Wed Feb 26 16:45:59 2014 0.000000 seconds
External:
Wed Feb 26 16:45:59 2014 0.000000 seconds
#

(cold reset)
U-Boot SPL 2013.04 (Feb 26 2014 - 13:03:41)
***logs***

U-Boot 2013.04 (Feb 26 2014 - 13:03:41)

**logs***
******Synchronizing the External and Internal RTC's*******
Reading ERTC: 2014-02-26 16:45:59 UTC
READ PASS !!!
Reading ERTC: 2014-02-26 16:45:59 UTC
Writing IRTC: 2014-02-26 16:45:59 UTC
Reading IRTC: 2014-02-26 16:45:59 UTC

**LOGS***

kernel boots...

[ 5.497205] VFS: Mounted root (nfs filesystem) on device 0:14.
[ 5.504679] devtmpfs: mounted
[ 5.508550] Freeing unused kernel memory: 252K (c0731000 - c0770000)
Starting logging: OK
Initializing random number generator... done.
Starting network...
ip: RTNETLINK answers: File exists
Starting sshd: OK
[ 6.838542] omap_rtc 44e3e000.rtc: rtc core: registered 44e3e000.rtc as rtc0
[ 6.873238] rtc-fm31256 0-006b: rtc core: registered fm31256 as rtc1
Internal:
Wed Feb 26 16:46:00 2014 0.000000 seconds
External:
Wed Feb 26 16:46:24 2014 0.000000 seconds

Welcome to Linux Diamond
Diamond login: root
# .././show.sh
Internal:
Wed Feb 26 16:46:07 2014 0.000000 seconds
External:
Wed Feb 26 16:46:31 2014 0.000000 seconds
#

Thanks and Regards,

Harsha Kiran

  • What is your definition of cold reset?

    You should assert the RTC_PWRONRSTn input along with the PWRONRSTn input the first time power is applied to the product, but you would only assert the PWRONRSTn input on subsequent power cycles if you need the RTC to maintain time.

    The RTC crystal oscillator is disabled by default after RTC_PWRONRSTn is asserted.

    Regards,
    Paul