Bug 767

Summary: [beagleboard] Can not set RTC correctly
Product: [Build System, Metadata & Runtime] BSPs Reporter: Yi Zhao <yi.zhao>
Component: bsps-configurationAssignee: Bruce Ashfield <bruce.ashfield>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: Medium CC: dvhart, jefro, sgw, yp.bsp.watcher, yp.watcher
Version: 1.0   
Target Milestone: 1.0 M4   
Hardware: Beagleboard   
OS: arm   
Whiteboard: patches out for review (17-Jun-2011)
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: ---

Description Yi Zhao 2011-02-24 00:20:08 UTC
Testing Env:    
Host: Ubuntu 10.10 x86_64
Kernel: 2.6.35-25-generic

beagleboard kernel and rootfs from weekly build 20110221
http://autobuilder.pokylinux.org/nightly/20110221-1/machines/beagleboard/arm/

u-boot environment setting:
###########
setenv optargs 'omapdss.def_disp=dvi vram=12M omapfb.mode="dvi:800x480MR-16@60"
video=omapfb.vram:0:4M,1:4M,2:4M omapfb.debug=y omapdss.debug=y'
setenv console ttyO2,115200n8;mmcinit;fatload mmc 0 0x80800000 uImage.bin;run
mmcargs; bootm 0x80800000
###########

Steps:
###########
root@beagleboard:~# hwclock -r
Sat Jan  1 00:00:00 2000  0.000000 seconds
root@beagleboard:~# date 060708092011
Tue Jun  7 08:09:00 UTC 2011
root@beagleboard:~# date
Tue Jun  7 08:09:08 UTC 2011
root@beagleboard:~# hwclock -w
root@beagleboard:~# hwclock -r
Sat Jan  1 00:00:00 2000  0.000000 seconds
root@beagleboard:~# 
#############

More info:
############
root@beagleboard:~# dmesg |grep rtc -i
twl_rtc twl_rtc: rtc core: registered twl_rtc as rtc0
twl_rtc twl_rtc: Power up reset detected.
twl_rtc twl_rtc: Enabling TWL-RTC.
twl_rtc twl_rtc: setting system clock to 2000-01-01 00:00:00 UTC (946684800)
#############
Comment 1 Bruce Ashfield 2011-02-24 06:56:52 UTC
Did this work in the 2.6.34 kernel ? Again, just trying to establish if
this is a regression.

Chances are this is just a configuration issue on the 2.6.37 kernel, since
the twl rtc should handle this.
Comment 2 Yi Zhao 2011-02-24 20:22:48 UTC
I tested a 2.6.34 kernel from autobuilder weekly build 20110126:

uImage-2.6.34+git0+b67e060194a38c6331da1532bd06446087a42b3b_0+0431115c9d720fee5bb105f6a7411efb4f851d26-r12-beagleboard-20110127143833.bin

poky-image-sato-beagleboard-20110127162807.rootfs.tar.bz2

With this build, the RTC also can not set correctly.

#################
root@beagleboard:~# dmesg|grep rtc -i
twl_rtc twl_rtc: rtc core: registered twl_rtc as rtc0
twl_rtc twl_rtc: Enabling TWL-RTC.
twl_rtc twl_rtc: setting system clock to 2000-01-01 00:00:00 UTC (946684800)
root@beagleboard:~# hwclock -r
Sat Jan  1 00:00:00 2000  0.000000 seconds
root@beagleboard:~# date 060708092010
Mon Jun  7 08:09:00 UTC 2010
root@beagleboard:~# hwclock -w
root@beagleboard:~# date
Mon Jun  7 08:09:04 UTC 2010
root@beagleboard:~# hwclock -r
Sat Jan  1 00:00:00 2000  0.000000 seconds
##################
Comment 3 Yi Zhao 2011-03-07 21:38:42 UTC
With the 20110305 build images form http://autobuilder.yoctoproject.org/nightly/20110305-4/machines/beagleboard/arm/, this issue still happens.
Comment 4 Jeff Osier-Mixon 2011-03-18 10:26:25 UTC
Hi all - I just wanted to comment that you must make sure your BeagleBoard has a RTC batter installed in order to get RTC to work. This is a known issue in the community but it is not documented in the most visible way. If the battery is installed and RTC is still not working, I'd be happy to contact the board's maintainers to find out what is going on - there may be an obscure patch necessary.

Jefro
Comment 5 Bruce Ashfield 2011-03-20 19:05:29 UTC
Thanks Jeff, I've got the contacts to dig into this one when the
time comes. Chances are this is just our boards or the config, and
we'll address this via the beagleboard revisit post 1.0.
Comment 6 Darren Hart 2011-06-07 17:09:14 UTC
does this require something like the zippy2 add on board or should this work with just the bbxm or the bb c4 ?
Comment 7 Bruce Ashfield 2011-06-07 18:37:18 UTC
Is Jeffro still watching this bug ? He can dig it up, or we can ask TI directly, I'm honestly not sure
if the beagleboard comes populated with a RTC without a addon board. From what I've read,
you DO need the zippy board to get the battery backed up RTC.
Comment 8 Jeff Osier-Mixon 2011-06-07 19:17:49 UTC
Saw this go by & forwarded to the Beagle guys, hope to have an answer tomorrow. I have a memory that you can install a battery with a board much smaller/cheaper than the zippy, although the zippy does also give other benefits on a rev C.
Comment 9 Darren Hart 2011-06-28 09:07:53 UTC
Fix included in:

commit ee4dd303b6667a691ed6093b13c226a7466ee31e
Author: Bruce Ashfield <bruce.ashfield@windriver.com>
Date:   Wed Jun 22 16:00:01 2011 -0400

    linux-yocto/meta-yocto: update yocto/standard and beagleboard SRCREVs
Comment 10 Yi Zhao 2011-06-28 23:30:43 UTC
Verified it with 20110625 build on beagleboard C4

Tree/Branch: Poky/Master
Poky Commit: a1f79a7896b6411669b3ccada6204d2695e80fc5