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.

The RTC on chip of AM335x (omap_rtc) is not working !!

I have enable the omap_rtc driver and add rtc item on dts, when linux booting, it types the following log:

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Initializing cgroup subsys cpuset
[    0.000000] Initializing cgroup subsys cpu
[    0.000000] Initializing cgroup subsys cpuacct
[    0.000000] Linux version 4.1.13-g8dc6617 (lilianrong@ubuntu) (gcc version 4.9.2 (Buildroot 2015.05) ) #21 SMP Sun Jan 31 23:10:16 CST 2016
[    0.000000] CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=10c5387d
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] Machine model: TI AM335x EVM
[    0.000000] cma: Reserved 16 MiB at 0x9e800000
[    0.000000] Memory policy: Data cache writeback
[    0.000000] CPU: All CPU(s) started in SVC mode.
[    0.000000] AM335X ES2.1 (sgx neon )
[    0.000000] PERCPU: Embedded 13 pages/cpu @df915000 s22976 r8192 d22080 u53248
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 129408
[    0.000000] Kernel command line: console=ttyO0,115200n8 root=/dev/mmcblk0p2 rw rootwait
[    0.000000] PID hash table entries: 2048 (order: 1, 8192 bytes)
[    0.000000] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
[    0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
[    0.000000] Memory: 482400K/522240K available (6315K kernel code, 761K rwdata, 2212K rodata, 448K init, 8233K bss, 23456K reserved, 16384K cma-reserved, 0K highmem)
[    0.000000] Virtual kernel memory layout:
[    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
[    0.000000]     fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
[    0.000000]     vmalloc : 0xe0800000 - 0xff000000   ( 488 MB)
[    0.000000]     lowmem  : 0xc0000000 - 0xe0000000   ( 512 MB)
[    0.000000]     pkmap   : 0xbfe00000 - 0xc0000000   (   2 MB)
[    0.000000]     modules : 0xbf000000 - 0xbfe00000   (  14 MB)
[    0.000000]       .text : 0xc0008000 - 0xc085bfd8   (8528 kB)
[    0.000000]       .init : 0xc085c000 - 0xc08cc000   ( 448 kB)
[    0.000000]       .data : 0xc08cc000 - 0xc098a6a0   ( 762 kB)
[    0.000000]        .bss : 0xc098d000 - 0xc1197590   (8234 kB)
[    0.000000] Running RCU self tests
[    0.000000] Hierarchical RCU implementation.
[    0.000000]  RCU lockdep checking is enabled.
[    0.000000]  Additional per-CPU info printed with stalls.
[    0.000000]  RCU restricting CPUs from NR_CPUS=2 to nr_cpu_ids=1.
[    0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=1
[    0.000000] NR_IRQS:16 nr_irqs:16 16
[    0.000000] IRQ: Found an INTC at 0xfa200000 (revision 5.0) with 128 interrupts
[    0.000000] OMAP clockevent source: timer2 at 24000000 Hz
[    0.000015] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478484971ns
[    0.000038] clocksource timer1: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
[    0.000087] OMAP clocksource: timer1 at 24000000 Hz
[    0.000951] Console: colour dummy device 80x30
[    0.001014] Lock dependency validator: Copyright (c) 2006 Red Hat, Inc., Ingo Molnar
[    0.001023] ... MAX_LOCKDEP_SUBCLASSES:  8
[    0.001030] ... MAX_LOCK_DEPTH:          48
[    0.001038] ... MAX_LOCKDEP_KEYS:        8191
[    0.001045] ... CLASSHASH_SIZE:          4096
[    0.001052] ... MAX_LOCKDEP_ENTRIES:     32768
[    0.001059] ... MAX_LOCKDEP_CHAINS:      65536
[    0.001067] ... CHAINHASH_SIZE:          32768
[    0.001074]  memory used by lock dependency info: 5167 kB
[    0.001081]  per task-struct memory footprint: 1152 bytes
[    0.001107] Calibrating delay loop... 996.14 BogoMIPS (lpj=4980736)
[    0.078712] pid_max: default: 32768 minimum: 301
[    0.079067] Security Framework initialized
[    0.079233] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.079249] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.082362] Initializing cgroup subsys blkio
[    0.082408] Initializing cgroup subsys memory
[    0.082503] Initializing cgroup subsys devices
[    0.082590] Initializing cgroup subsys freezer
[    0.082715] Initializing cgroup subsys perf_event
[    0.082783] CPU: Testing write buffer coherency: ok
[    0.084286] CPU0: thread -1, cpu 0, socket -1, mpidr 0
[    0.084412] Setting up static identity map for 0x80008280 - 0x800082f0
[    0.088959] Brought up 1 CPUs
[    0.088985] SMP: Total of 1 processors activated (996.14 BogoMIPS).
[    0.088995] CPU: All CPU(s) started in SVC mode.
[    0.092446] devtmpfs: initialized
[    0.126753] VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 3
[    0.170277] omap_hwmod: tptc0 using broken dt data from edma
[    0.170750] omap_hwmod: tptc1 using broken dt data from edma
[    0.171195] omap_hwmod: tptc2 using broken dt data from edma
[    0.180132] omap_hwmod: debugss: _wait_target_disable failed
[    0.235476] clocksource jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.238251] pinctrl core: initialized pinctrl subsystem
[    0.244023] NET: Registered protocol family 16
[    0.250036] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.252280] cpuidle: using governor ladder
[    0.252309] cpuidle: using governor menu
[    0.263310] OMAP GPIO hardware version 0.1
[    0.284117] omap-gpmc 50000000.gpmc: could not find pctldev for node /ocp/l4_wkup@44c00000/scm@210000/pinmux@800/nandflash_pins_default, deferring probe
[    0.287886] No ATAGs?
[    0.287918] hw-breakpoint: debug architecture 0x4 unsupported.
[    0.290718] omap4_sram_init:Unable to allocate sram needed to handle errata I688
[    0.290741] omap4_sram_init:Unable to get sram pool needed to handle errata I688
[    0.331298] edma-dma-engine edma-dma-engine.0: TI EDMA DMA engine driver
[    0.336482] SCSI subsystem initialized
[    0.338461] omap_i2c 44e0b000.i2c: could not find pctldev for node /ocp/l4_wkup@44c00000/scm@210000/pinmux@800/pinmux_i2c0_pins, deferring probe
[    0.338563] omap_i2c 4802a000.i2c: could not find pctldev for node /ocp/l4_wkup@44c00000/scm@210000/pinmux@800/pinmux_i2c1_pins, deferring probe
[    0.338966] pps_core: LinuxPPS API ver. 1 registered
[    0.338979] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[    0.339038] PTP clock support registered
[    0.343237] Switched to clocksource timer1
[    0.494286] NET: Registered protocol family 2
[    0.496376] TCP established hash table entries: 4096 (order: 2, 16384 bytes)
[    0.496553] TCP bind hash table entries: 4096 (order: 5, 147456 bytes)
[    0.497742] TCP: Hash tables configured (established 4096 bind 4096)
[    0.497990] UDP hash table entries: 256 (order: 2, 20480 bytes)
[    0.498164] UDP-Lite hash table entries: 256 (order: 2, 20480 bytes)
[    0.499084] NET: Registered protocol family 1
[    0.500950] RPC: Registered named UNIX socket transport module.
[    0.500975] RPC: Registered udp transport module.
[    0.500985] RPC: Registered tcp transport module.
[    0.500995] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    0.503349] CPU PMU: Failed to parse /pmu/interrupt-affinity[0]
[    0.503452] hw perfevents: enabled with armv7_cortex_a8 PMU driver, 5 counters available
[    0.508051] futex hash table entries: 256 (order: 2, 16384 bytes)
[    0.508355] audit: initializing netlink subsys (disabled)
[    0.508650] audit: type=2000 audit(0.500:1): initialized
[    0.513871] VFS: Disk quotas dquot_6.6.0
[    0.514024] VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[    0.516518] NFS: Registering the id_resolver key type
[    0.516956] Key type id_resolver registered
[    0.516971] Key type id_legacy registered
[    0.517179] jffs2: version 2.2. (NAND) (SUMMARY)  �© 2001-2006 Red Hat, Inc.
[    0.522264] io scheduler noop registered
[    0.522298] io scheduler deadline registered
[    0.522352] io scheduler cfq registered (default)
[    0.524348] pinctrl-single 44e10800.pinmux: 142 pins at pa f9e10800 size 568
[    0.526854] Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
[    0.533439] omap_uart 44e09000.serial: no wakeirq for uart0
[    0.534076] 44e09000.serial: ttyO0 at MMIO 0x44e09000 (irq = 155, base_baud = 3000000) is a OMAP UART0
[    1.288997] console [ttyO0] enabled
[    1.295206] omap_uart 48022000.serial: no wakeirq for uart1
[    1.301379] 48022000.serial: ttyO1 at MMIO 0x48022000 (irq = 156, base_baud = 3000000) is a OMAP UART1
[    1.341749] brd: module loaded
[    1.363308] loop: module loaded
[    1.369137] mtdoops: mtd device (mtddev=name/number) must be supplied
[    1.378657] CAN device driver interface
[    1.385632] c_can_platform 481d0000.can: c_can_platform device registered (regs=fa1d0000, irq=161)
[    1.453213] davinci_mdio 4a101000.mdio: davinci mdio revision 1.6
[    1.459597] davinci_mdio 4a101000.mdio: detected phy mask ffffffde
[    1.472037] libphy: 4a101000.mdio: probed
[    1.476402] davinci_mdio 4a101000.mdio: phy[0]: device 4a101000.mdio:00, driver RTL8211E Gigabit Ethernet
[    1.486436] davinci_mdio 4a101000.mdio: phy[5]: device 4a101000.mdio:05, driver RTL8211E Gigabit Ethernet
[    1.497683] cpsw 4a100000.ethernet: Missing slave[1] phy_id property
[    1.504427] cpsw 4a100000.ethernet: Detected MACID = 84:eb:18:f6:41:b0
[    1.516578] mousedev: PS/2 mouse device common for all mice
[    1.522781] -------------1
[    1.525882] -------------2
[    1.528930] omap_rtc 44e3e000.rtc: already running
[    1.534178] -------------3
[    1.538646] omap_rtc 44e3e000.rtc: rtc core: registered 44e3e000.rtc as rtc0
[    1.546208] -------------4
[    1.549160] -------------5
[    1.552278] i2c /dev entries driver
[    1.556100] Driver for 1-wire Dallas network protocol.
[    1.566675] omap_hsmmc 48060000.mmc: Got CD GPIO
[    1.575338] ledtrig-cpu: registered to indicate activity on CPUs
[    1.582839] oprofile: using arm/armv7
[    1.587703] Initializing XFRM netlink socket
[    1.592333] NET: Registered protocol family 17
[    1.597170] NET: Registered protocol family 15
[    1.601822] can: controller area network core (rev 20120528 abi 9)
[    1.608477] NET: Registered protocol family 29
[    1.613260] can: raw protocol (rev 20120528)
[    1.617871] can: broadcast manager protocol (rev 20120528 t)
[    1.623871] can: netlink gateway (rev 20130117) max_hops=1
[    1.630128] Key type dns_resolver registered
[    1.635286] omap_voltage_late_init: Voltage driver support not added
[    1.641945] sr_dev_init: No voltage domain specified for smartreflex0. Cannot initialize
[    1.650460] sr_dev_init: No voltage domain specified for smartreflex1. Cannot initialize
[    1.660485] ThumbEE CPU extension supported.
[    1.665080] Registering SWP/SWPB emulation handler
[    1.670100] SmartReflex Class3 initialized
[    1.681528] omap-gpmc 50000000.gpmc: GPMC revision 6.0
[    1.687329] gpmc_mem_init: disabling cs 0 mapped at 0x0-0x1000000
[    1.697117] nand: device found, Manufacturer ID: 0x01, Chip ID: 0xd3
[    1.703879] nand: AMD/Spansion S34ML08G1
[    1.707981] nand: 1024 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64
[    1.716116] omap2-nand 8000000.nand: ELM device not found
[    1.721755] omap2-nand 8000000.nand: ELM not available
[    1.727289] omap2-nand: probe of 8000000.nand failed with error -22
[    1.774424] tps65910 0-002d: No interrupt support, no core IRQ
[    1.826633] omap_i2c 44e0b000.i2c: bus 0 rev0.11 at 400 kHz
[    1.835609] omap_i2c 4802a000.i2c: bus 1 rev0.11 at 100 kHz
[    1.842627] omap_hsmmc 48060000.mmc: Got CD GPIO
[    1.848372] vmmc: supplied by vbat
[    1.896640] omap_rtc 44e3e000.rtc: setting system clock to 2000-01-01 00:00:00 UTC (946684800)
[    1.905759] sr_init: No PMIC hook to init smartreflex
[    1.911293] sr_init: platform driver register failed for SR
[    1.937364] lis3_reg: disabling
[    1.945703] Waiting for root device /dev/mmcblk0p2...
[    2.023274] mmc0: host does not support reading read-only switch, assuming write-enable
[    2.035342] mmc0: new high speed SDHC card at address aaaa
[    2.044909] mmcblk0: mmc0:aaaa SS08G 7.40 GiB 
[    2.054322]  mmcblk0: p1 p2
[    2.201692] kjournald starting.  Commit interval 5 seconds
[    2.210572] EXT3-fs (mmcblk0p2): using internal journal
[    2.218817] EXT3-fs (mmcblk0p2): recovery complete
[    2.223908] EXT3-fs (mmcblk0p2): mounted filesystem with ordered data mode
[    2.231241] VFS: Mounted root (ext3 filesystem) on device 179:2.
[    2.241372] devtmpfs: mounted
[    2.245305] Freeing unused kernel memory: 448K (c085c000 - c08cc000)

But, when I test the rtc with hwclock command, it always return:

Sat Jan  1 00:00:00 2000  0.000000 seconds

And I can not write the rtc with command:

hwclock -w

I also check the /proc/driver/rtc, it tips that:

# cat /proc/driver/rtc
rtc_time : 00:00:00
rtc_date : 2000-01-01
alrm_time : 00:00:00
alrm_date : 2000-01-01
alarm_IRQ : no
alrm_pending : no
update IRQ enabled : no
periodic IRQ enabled : no
periodic IRQ frequency : 1
max user IRQ frequency : 64
24hr : yes

Can you help me? Thank you very much!