Showing results for 
Show  only  | Search instead for 
Did you mean: 
Registered: ‎08-08-2008

Zedboard + Digilent Pmod Real Time Clock cannot detect

  I have a problem with RTC driver on zed board.  RTC is Digilent Pmod-RTCC, which has a Microchip MCP7941x compatiable IC onboard.  I used DS1307 driver to run it, since MCP7941x does not have its own drivers in Linux and is supposed to be compatible with DS1307.
Below is the bootup output on console.
The error occurs at 
cdns-i2c e0004000.ps7-i2c: timeout waiting on completion
rtc-ds1307: probe of 0-006f failed with error -5
Now '/sys/class/rtc' is empty, supposed to have some files and folders related to ds1307.
'/sys/bus/i2c/devices' has '0-006f'  'i2c-0'm and 
'/sys/bus/i2c/devices/i2c-0' has 
0-006f         device         name           power          uevent
delete_device  i2c-dev        new_device     subsystem
I also tried to build ds1307 driver as an module, so that kernel won't load it and I manually load it at user space, still have same problem.
Here's the console output and I have attached the modified DTS file:
Thanks for the help,
Console output when boot:
Memory: 375964K/524288K available (4604K kernel code, 232K rwdata, 1540K rodata, 188K init, 192K bss, 148324K reserved, 0K highmem)
Virtual kernel memory layout:
    vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)
    vmalloc : 0xe0800000 - 0xff000000   ( 488 MB)
    lowmem  : 0xc0000000 - 0xe0000000   ( 512 MB)
    pkmap   : 0xbfe00000 - 0xc0000000   (   2 MB)
    modules : 0xbf000000 - 0xbfe00000   (  14 MB)
      .text : 0xc0008000 - 0xc060861c   (6146 kB)
      .init : 0xc0609000 - 0xc0638340   ( 189 kB)
      .data : 0xc063a000 - 0xc0674160   ( 233 kB)
       .bss : 0xc067416c - 0xc06a42fc   ( 193 kB)
Preemptible hierarchical RCU implementation.
        Dump stacks of tasks blocking RCU-preempt GP.
        RCU restricting CPUs from NR_CPUS=4 to nr_cpu_ids=2.
RCU: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=2
NR_IRQS:16 nr_irqs:16 16
ps7-slcr mapped to e0802000
zynq_clock_init: clkc starts at e0802100
Zynq clock init
sched_clock: 64 bits at 333MHz, resolution 3ns, wraps every 3298534883328ns
ps7-ttc #0 at e0804000, irq=43
Console: colour dummy device 80x30
Calibrating delay loop... 1325.46 BogoMIPS (lpj=6627328)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
CPU: Testing write buffer coherency: ok
CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
Setting up static identity map for 0x459b68 - 0x459bc0
L310 cache controller enabled
l2x0: 8 ways, CACHE_ID 0x410000c8, AUX_CTRL 0x72760000, Cache size: 512 kB
CPU1: Booted secondary processor
CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
Brought up 2 CPUs
SMP: Total of 2 processors activated.
CPU: All CPU(s) started in SVC mode.
devtmpfs: initialized
VFP support v0.3: implementor 41 architecture 3 part 30 variant 9 rev 4
regulator-dummy: no parameters
NET: Registered protocol family 16
DMA: preallocated 256 KiB pool for atomic coherent allocations
cpuidle: using governor ladder
cpuidle: using governor menu
syscon f8000000.ps7-slcr: regmap [mem 0xf8000000-0xf8000fff] registered
hw-breakpoint: found 5 (+1 reserved) breakpoint and 1 watchpoint registers.
hw-breakpoint: maximum watchpoint size is 4 bytes.
zynq-ocm f800c000.ps7-ocmc: ZYNQ OCM pool: 256 KiB @ 0xe0880000
bio: create slab <bio-0> at 0
vgaarb: loaded
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
media: Linux media interface: v0.10
Linux video capture interface: v2.00
pps_core: LinuxPPS API ver. 1 registered
pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <>
PTP clock support registered
EDAC MC: Ver: 3.0.0
Advanced Linux Sound Architecture Driver Initialized.
Switched to clocksource arm_global_timer
NET: Registered protocol family 2
TCP established hash table entries: 4096 (order: 2, 16384 bytes)
TCP bind hash table entries: 4096 (order: 3, 32768 bytes)
TCP: Hash tables configured (established 4096 bind 4096)
TCP: reno registered
UDP hash table entries: 256 (order: 1, 8192 bytes)
UDP-Lite hash table entries: 256 (order: 1, 8192 bytes)
NET: Registered protocol family 1
RPC: Registered named UNIX socket transport module.
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
Trying to unpack rootfs image as initramfs...
Freeing initrd memory: 5572K (df5bc000 - dfb2d000)
hw perfevents: enabled with ARMv7 Cortex-A9 PMU driver, 7 counters available
futex hash table entries: 512 (order: 3, 32768 bytes)
jffs2: version 2.2. (NAND) (SUMMARY)  © 2001-2006 Red Hat, Inc.
msgmni has been set to 1001
io scheduler noop registered
io scheduler deadline registered
io scheduler cfq registered (default)
dma-pl330 f8003000.ps7-dma: Loaded driver for PL330 DMAC-2364208
dma-pl330 f8003000.ps7-dma:     DBUFF-128x8bytes Num_Chans-8 Num_Peri-4 Num_Events-16
console [ttyPS0] enabledat MMIO 0xe0001000 (irq = 82, base_baud = 3124999) is a xuartps
console [ttyPS0] enabled
bootconsole [earlycon0] disabled
bootconsole [earlycon0] disabled
xdevcfg f8007000.ps7-dev-cfg: ioremap 0xf8007000 to e0866000
[drm] Initialized drm 1.1.0 20060810
brd: module loaded
loop: module loaded
m25p80 spi0.0: found s25fl256s1, expected n25q128
m25p80 spi0.0: s25fl256s1 (32768 Kbytes)
5 ofpart partitions found on MTD device spi0.0
Creating 5 MTD partitions on "spi0.0":
0x000000000000-0x000000100000 : "qspi-fsbl-uboot"
0x000000100000-0x000000600000 : "qspi-linux"
0x000000600000-0x000000620000 : "qspi-device-tree"
0x000000620000-0x000000c00000 : "qspi-rootfs"
0x000000c00000-0x000001000000 : "qspi-bitstream"
e1000e: Intel(R) PRO/1000 Network Driver - 2.3.2-k
e1000e: Copyright(c) 1999 - 2013 Intel Corporation.
libphy: XEMACPS mii bus: probed
xemacps e000b000.ps7-ethernet: pdev->id -1, baseaddr 0xe000b000, irq 54
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
ehci-pci: EHCI PCI platform driver
ULPI transceiver vendor/product ID 0x0451/0x1507
Found TI TUSB1210 ULPI transceiver.
ULPI integrity check: passed.
zynq-ehci zynq-ehci.0: Xilinx Zynq USB EHCI Host Controller
zynq-ehci zynq-ehci.0: new USB bus registered, assigned bus number 1
zynq-ehci zynq-ehci.0: irq 53, io mem 0x00000000
zynq-ehci zynq-ehci.0: USB 2.0 started, EHCI 1.00
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
usbcore: registered new interface driver usb-storage
mousedev: PS/2 mouse device common for all mice
i2c /dev entries driver
cdns-i2c e0004000.ps7-i2c: timeout waiting on completion
rtc-ds1307: probe of 0-006f failed with error -5
cdns-i2c e0004000.ps7-i2c: 400 kHz mmio e0004000 irq 57
zynq-edac f8006000.ps7-ddrc: ecc not enabled
cpufreq_cpu0: failed to get cpu0 regulator: -19
Xilinx Zynq CpuIdle Driver started
sdhci: Secure Digital Host Controller Interface driver
sdhci: Copyright(c) Pierre Ossman
sdhci-pltfm: SDHCI platform and OF driver helper
mmc0: no vqmmc regulator found
mmc0: no vmmc regulator found
mmc0: SDHCI controller on e0100000.ps7-sdio [e0100000.ps7-sdio] using ADMA
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
TCP: cubic registered
NET: Registered protocol family 17
Registering SWP/SWPB emulation handler
regulator-dummy: disabling
drivers/rtc/hctosys.c: unable to open rtc device (rtc0)
ALSA device list:
  No soundcards found.
Freeing unused kernel memory: 188K (c0609000 - c0638000)
mmc0: new high speed SDHC card at address 0007
mmcblk0: mmc0:0007 SD04G 3.70 GiB
INIT: version 2.88 booting
Starting Bootlog daemon: bootlogd.
Creating /dev/flash/* device nodes
random: dd urandom read with 8 bits of entropy available
starting Busybox inet Daemon: inetd... done.
update-rc.d: /etc/init.d/run-postinsts exists during rc.d purge (continuing)
 Removing any system startup links for run-postinsts ...
INIT: Entering runlevel: 5
Configuring network interfaces... udhcpc (v1.22.1) started
Sending discover...
Sending discover...
xemacps e000b000.ps7-ethernet: Set clk to 124999998 Hz
xemacps e000b000.ps7-ethernet: link up (1000/FULL)
Sending discover...
No lease, failing
Starting Dropbear SSH server: Generating key, this may take a while...
Public key portion is:
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCJ1NCNGCOE3GIrPP5zwcaynW9GSmfSi3oKE2fLRASYsbhen694XzWmXNgGxs8kC3ow9xL2hbQjnuNYzUbs1bV+nD9MxAreZsSw9stbTkG41MmL9oif/jHmDzgVXIZ/fQXUuUWqh3fHNy2HCySVntJ80lIVMifsp7aCMKbpgBL37e9l1t9fRYvrR7gp5HFV2sU9RB64vCWAzPvEzSWN9pNHwE1YMjURpIskCTrrNEd6ZNlVIG7Y8p1IpQgsCEwzFKbF69vJNcgtgueF9a16Umfvc3dipXiEfHlR75WBBdaBQ3WenrJ5Y3ymR26XQAxrgtnMbCexefnnZaGRy42FuW/F root@zynq
Fingerprint: md5 56:88:73:3e:ea:ed:59:9b:8d:6e:45:40:ad:3f:e3:89
Stopping Bootlog daemon: bootlogd.
Starting tcf-agent: OK
Built with PetaLinux v2014.2 (Yocto 1.6) zynq /dev/ttyPS0
zynq login: root
login[817]: root login on 'ttyPS0'
root@zynq:~# cd /sys/b
block/ bus/
root@zynq:~# cd /sys/bus/
root@zynq:/sys/bus# ls
amba          cpu           i2c           pci           serio
clockevents   edac          mdio_bus      platform      spi
clocksource   event_source  media         scsi          usb
container     hid           mmc           sdio          workqueue
root@zynq:/sys/bus# cd i2c/devices/
root@zynq:/sys/bus/i2c/devices# ls
0-006f  i2c-0
root@zynq:/sys/bus/i2c/devices# cd /sys/class/rtc/
0 Kudos
4 Replies
Registered: ‎11-28-2009

I've got a Maxim DS3231M on a PMOD connected to a Zed board.


Dmesg show this:


root@bt_cntlr:~# dmesg | grep rtc
rtc-ds1307 0-0068: read: 01 48 01 01 22 01 00
rtc-ds1307 0-0068: read secs=1, mins=48, hours=1, mday=22, mon=0, year=100, wday=0
rtc rtc0: ds3231: dev (254:0)
rtc-ds1307 0-0068: rtc core: registered ds3231 as rtc0
rtc-ds1307 0-0068: read: 01 48 01 01 22 01 00
rtc-ds1307 0-0068: read secs=1, mins=48, hours=1, mday=22, mon=0, year=100, wday=0
rtc-ds1307 0-0068: setting system clock to 2000-01-22 01:48:01 UTC (948505681)


But when I try hwclock -r I get this:


root@bt_cntlr:~# hwclock -r
xi2cps e0004000.ps7-i2c: timeout waiting on completion
rtc-ds1307 0-0068: read error -110
hwclock: RTC_RD_TIME: Input/output error


If I try IOCTLs (which work if not registered as an RTC in the devicetree) I get a device
busy message.


Does the kernal somehow have it tied up?


This similar to the original post.  So I thought I would put it here.




0 Kudos
Registered: ‎08-08-2008

Hi all,

  I found the solution some time back, forgot to post, so here's the solution.  The prolem is related to Zynq PS7 hard-IP I2C controller.


  I added a new Xilinx AXI-I2C controller,  reconfig/compile kernel, moved the RTC PMOD to a PL side IO PMOD connector and modified and rebuilt the Device Tree file.  It is working now.  I can use Linux commands to set and read time.  Linux automatically loads the time from RTC at boot up.


  My setup is : Vivado 2014.2, Linux kernel source referenced from Xilinx Wiki, version 3.14 I think.





0 Kudos
Registered: ‎04-29-2015

 Hi Neo,


I am thinking to use the same RTC using Petalinux. Do you know if I need a special driver for this module? Is it possible to see your device tree file?





0 Kudos
Registered: ‎03-31-2012

here is the section I add to the axi-i2c group for rtc:

i2c@4 {
#address-cells = <1>;
#size-cells = <0>;
reg = <4>;
rtc@54 {
compatible = "nxp,pcf8563";
reg = <0x51>;

You don't need a special driver. I think it's already included in the default kernel config, if not, you need to turn it on.
- Please mark the Answer as "Accept as solution" if information provided is helpful.
Give Kudos to a post which you think is helpful and reply oriented.
0 Kudos