UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Observer stoepsel93
Observer
3,747 Views
Registered: ‎05-12-2017

PS I2C: timeout waiting for completion

I'm trying to use the GPIO-expander PCF8574A with the Zybo. In Vivado 2017.1 I designed a simple Hardware Design using the I2C0 peripheral on MIO ports 10 and 11 (Speed slow, Pullup enabled).

 

The kernel I'm using is: https://github.com/Xilinx/linux-xlnx/tree/xilinx-v2017.1

You can find my Kernel config attached.

 

My zynq-zybo.dts looks like this:

/*
 *  Copyright (C) 2011 - 2014 Xilinx
 *  Copyright (C) 2012 National Instruments Corp.
 *
 * This software is licensed under the terms of the GNU General Public
 * License version 2, as published by the Free Software Foundation, and
 * may be copied, distributed, and modified under those terms.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 */
/dts-v1/;
#include "zynq-7000.dtsi"

/ {
        model = "Zynq ZYBO Development Board";
        compatible = "digilent,zynq-zybo", "xlnx,zynq-7000";

        aliases {
                ethernet0 = &gem0;
                serial0 = &uart1;
                spi0 = &qspi;
                mmc0 = &sdhci0;
        };

        memory@0 {
                device_type = "memory";
                reg = <0x0 0x20000000>;
        };

        chosen {
                bootargs = "";
                stdout-path = "serial0:115200n8";
        };

        usb_phy0: phy0 {
                #phy-cells = <0>;
                compatible = "usb-nop-xceiv";
                reset-gpios = <&gpio0 46 1>;
        };
};

&clkc {
        ps-clk-frequency = <50000000>;
};

&gem0 {
        status = "okay";
        phy-mode = "rgmii-id";
        phy-handle = <&ethernet_phy>;

        ethernet_phy: ethernet-phy@0 {
                reg = <0>;
                device_type = "ethernet-phy";
        };
};

&qspi {
        u-boot,dm-pre-reloc;
        status = "okay";
};

&sdhci0 {
        u-boot,dm-pre-reloc;
        status = "okay";
};

&uart1 {
        u-boot,dm-pre-reloc;
        status = "okay";
};

&usb0 {
        status = "okay";
        dr_mode = "host";
        usb-phy = <&usb_phy0>;
};

&i2c0 {
        status = "okay";
        clock-frequency = <400000>;

        pcf8574a: gpio@38 {
                compatible = "nxp,pcf8574a";
                reg = <0x38>;
                gpio-controller;
                #gpio-cells = <2>;
        };
};

 

I'm running Debian Jessie. On boot the pcf857x is probed, but times out.

[    0.000000] Preemptible hierarchical RCU implementation.
[    0.000000] 	Build-time adjustment of leaf fanout to 32.
[    0.000000] 	RCU restricting CPUs from NR_CPUS=4 to nr_cpu_ids=2.
[    0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=32, nr_cpu_ids=2
[    0.000000] NR_IRQS:16 nr_irqs:16 16
[    0.000000] efuse mapped to e0800000
[    0.000000] slcr mapped to e0802000
[    0.000000] L2C: platform modifies aux control register: 0x02060000 -> 0x32460000
[    0.000000] L2C: DT/platform modifies aux control register: 0x02060000 -> 0x32460000
[    0.000000] L2C-310 erratum 769419 enabled
[    0.000000] L2C-310 enabling early BRESP for Cortex-A9
[    0.000000] L2C-310 full line of zeros enabled for Cortex-A9
[    0.000000] L2C-310 dynamic clock gating enabled, standby mode enabled
[    0.000000] L2C-310 cache controller enabled, 8 ways, 512 kB
[    0.000000] L2C-310: CACHE_ID 0x410000c8, AUX_CTRL 0x46460001
[    0.000000] zynq_clock_init: clkc starts at e0802100
[    0.000000] Zynq clock init
[    0.000011] sched_clock: 64 bits at 325MHz, resolution 3ns, wraps every 4398046511103ns
[    0.000031] clocksource: arm_global_timer: mask: 0xffffffffffffffff max_cycles: 0x4af477f6aa, max_idle_ns: 440795207830 ns
[    0.000058] Switching to timer-based delay loop, resolution 3ns
[    0.000149] clocksource: ttc_clocksource: mask: 0xffff max_cycles: 0xffff, max_idle_ns: 551318127 ns
[    0.000175] timer #0 at e080a000, irq=17
[    0.000539] Console: colour dummy device 80x30
[    0.000557] Calibrating delay loop (skipped), value calculated using timer frequency.. 650.00 BogoMIPS (lpj=3250000)
[    0.000572] pid_max: default: 32768 minimum: 301
[    0.000705] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.000715] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.001332] CPU: Testing write buffer coherency: ok
[    0.001528] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[    0.001585] Setting up static identity map for 0x100000 - 0x100058
[    0.170683] CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
[    0.170781] Brought up 2 CPUs
[    0.170794] SMP: Total of 2 processors activated (1300.00 BogoMIPS).
[    0.170800] CPU: All CPU(s) started in SVC mode.
[    0.171670] devtmpfs: initialized
[    0.174527] VFP support v0.3: implementor 41 architecture 3 part 30 variant 9 rev 4
[    0.174840] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.187818] pinctrl core: initialized pinctrl subsystem
[    0.188923] NET: Registered protocol family 16
[    0.190962] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.192259] i2c-core: driver [dummy] registered
[    0.220743] cpuidle: using governor menu
[    0.222404] gpiochip_find_base: found new base at 906
[    0.222432] gpio gpiochip0: (zynq_gpio): added GPIO chardev (254:0)
[    0.222735] gpiochip_setup_dev: registered GPIOs 906 to 1023 on device: gpiochip0 (zynq_gpio)
[    0.234127] hw-breakpoint: found 5 (+1 reserved) breakpoint and 1 watchpoint registers.
[    0.234138] hw-breakpoint: maximum watchpoint size is 4 bytes.
[    0.234254] zynq-ocm f800c000.ocmc: ZYNQ OCM pool: 256 KiB @ 0xe0840000
[    0.234556] zynq-pinctrl 700.pinctrl: zynq pinctrl initialized
[    0.249447] i2c-core: driver [pcf857x] registered
[    0.249860] of_get_named_gpiod_flags: can't parse 'gpio' property of node '/fixedregulator[0]'
[    0.250513] vgaarb: loaded
[    0.250984] SCSI subsystem initialized
[    0.251576] usbcore: registered new interface driver usbfs
[    0.251709] usbcore: registered new interface driver hub
[    0.251845] usbcore: registered new device driver usb
[    0.251983] usb_phy_generic phy0: GPIO lookup for consumer reset
[    0.251992] usb_phy_generic phy0: using device tree for GPIO lookup
[    0.252011] of_get_named_gpiod_flags: parsed 'reset-gpios' property of node '/phy0[0]' - status (0)
[    0.252032] no flags found for reset
[    0.252042] usb_phy_generic phy0: GPIO lookup for consumer vbus-detect
[    0.252049] usb_phy_generic phy0: using device tree for GPIO lookup
[    0.252058] of_get_named_gpiod_flags: can't parse 'vbus-detect-gpios' property of node '/phy0[0]'
[    0.252066] of_get_named_gpiod_flags: can't parse 'vbus-detect-gpio' property of node '/phy0[0]'
[    0.252073] usb_phy_generic phy0: using lookup tables for GPIO lookup
[    0.252082] usb_phy_generic phy0: lookup for GPIO vbus-detect failed
[    0.252106] phy0 supply vcc not found, using dummy regulator
[    0.252565] media: Linux media interface: v0.10
[    0.252677] Linux video capture interface: v2.00
[    0.252825] pps_core: LinuxPPS API ver. 1 registered
[    0.252833] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[    0.252915] PTP clock support registered
[    0.253065] EDAC MC: Ver: 3.0.0
[    0.254039] FPGA manager framework
[    0.254497] fpga-region fpga-full: FPGA Region probed
[    0.254776] Advanced Linux Sound Architecture Driver Initialized.
[    0.260555] clocksource: Switched to clocksource arm_global_timer
[    0.272659] NET: Registered protocol family 2
[    0.273386] TCP established hash table entries: 4096 (order: 2, 16384 bytes)
[    0.273446] TCP bind hash table entries: 4096 (order: 3, 32768 bytes)
[    0.273530] TCP: Hash tables configured (established 4096 bind 4096)
[    0.273577] UDP hash table entries: 256 (order: 1, 8192 bytes)
[    0.273605] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes)
[    0.273755] NET: Registered protocol family 1
[    0.274165] RPC: Registered named UNIX socket transport module.
[    0.274173] RPC: Registered udp transport module.
[    0.274179] RPC: Registered tcp transport module.
[    0.274184] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    0.274196] PCI: CLS 0 bytes, default 64
[    0.274718] hw perfevents: enabled with armv7_cortex_a9 PMU driver, 7 counters available
[    0.276367] futex hash table entries: 512 (order: 3, 32768 bytes)
[    0.277295] workingset: timestamp_bits=30 max_order=17 bucket_order=0
[    0.277976] jffs2: version 2.2. (NAND) (SUMMARY)  © 2001-2006 Red Hat, Inc.
[    0.278655] io scheduler noop registered
[    0.278664] io scheduler deadline registered
[    0.278686] io scheduler cfq registered (default)
[    0.279636] i2c-core: driver [si570] registered
[    0.282434] dma-pl330 f8003000.dmac: Loaded driver for PL330 DMAC-241330
[    0.282451] dma-pl330 f8003000.dmac: 	DBUFF-128x8bytes Num_Chans-8 Num_Peri-4 Num_Events-16
[    0.283424] e0001000.serial: ttyPS0 at MMIO 0xe0001000 (irq = 144, base_baud = 6250000) is a xuartps
[    0.784739] console [ttyPS0] enabled
[    0.787590] [drm] Initialized
[    0.802186] brd: module loaded
[    0.811181] loop: module loaded
[    0.813043] i2c-core: driver [at24] registered
[    0.814850] zynq-qspi e000d000.spi: couldn't determine configuration info about dual memories. defaulting to single memory
[    0.825533] libphy: Fixed MDIO Bus: probed
[    0.830634] CAN device driver interface
[    0.833607] of_get_named_gpiod_flags: can't parse 'reset-gpios' property of node '/amba/ethernet@e000b000/ethernet-phy@0[0]'
[    0.833624] of_get_named_gpiod_flags: can't parse 'phy-reset-gpio' property of node '/amba/ethernet@e000b000[0]'
[    0.834664] libphy: MACB_mii_bus: probed
[    0.837770] macb e000b000.ethernet eth0: Cadence GEM rev 0x00020118 at 0xe000b000 irq 146 (f2:2b:c2:27:40:a3)
[    0.846346] RTL8211E Gigabit Ethernet e000b000.etherne:00: attached PHY driver [RTL8211E Gigabit Ethernet] (mii_bus:phy_addr=e000b000.etherne:00, irq=-1)
[    0.859026] e1000e: Intel(R) PRO/1000 Network Driver - 3.2.6-k
[    0.863486] e1000e: Copyright(c) 1999 - 2015 Intel Corporation.
[    0.872048] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    0.877188] ehci-pci: EHCI PCI platform driver
[    0.880610] usbcore: registered new interface driver usb-storage
[    0.885526] e0002000.usb supply vbus not found, using dummy regulator
[    0.910956] ci_hdrc ci_hdrc.0: EHCI Host Controller
[    0.914471] ci_hdrc ci_hdrc.0: new USB bus registered, assigned bus number 1
[    0.940597] ci_hdrc ci_hdrc.0: USB 2.0 started, EHCI 1.00
[    0.945483] hub 1-0:1.0: USB hub found
[    0.947881] hub 1-0:1.0: 1 port detected
[    0.952245] mousedev: PS/2 mouse device common for all mice
[    0.956820] i2c-core: driver [rtc-pcf8563] registered
[    0.956827] i2c /dev entries driver
[    0.959166] cdns-i2c e0004000.i2c: 400 kHz mmio e0004000 irq 141
[    0.964105] i2c-dev: adapter [Cadence I2C at e0004000] registered as minor 0
[    0.964186] i2c i2c-0: adapter [Cadence I2C at e0004000] registered
[    0.964225] i2c i2c-0: of_i2c: walking child nodes
[    0.964239] i2c i2c-0: of_i2c: register /amba/i2c@e0004000/gpio@38
[    0.964409] pcf857x 0-0038: probe
[    0.964430] i2c i2c-0: master_xfer[0] R, addr=0x38, len=1
[    1.990585] cdns-i2c e0004000.i2c: timeout waiting on completion
[    1.995205] pcf857x 0-0038: probe error -110 for 'pcf8574a'
[    1.995223] pcf857x: probe of 0-0038 failed with error -110
[    1.999498] i2c i2c-0: client [pcf8574a] registered with bus id 0-0038
[    1.999709] i2c-core: driver [pca954x] registered
[    1.999771] i2c-core: driver [adv7604] registered
[    2.000905] i2c-core: driver [pmbus] registered
[    2.000957] i2c-core: driver [ucd9000] registered
[    2.001015] i2c-core: driver [ucd9200] registered
[    2.001865] EDAC MC: ECC not enabled
[    2.004225] Xilinx Zynq CpuIdle Driver started
[    2.007752] sdhci: Secure Digital Host Controller Interface driver
[    2.012565] sdhci: Copyright(c) Pierre Ossman
[    2.015577] sdhci-pltfm: SDHCI platform and OF driver helper
[    2.020156] sdhci-arasan e0100000.sdhci: GPIO lookup for consumer cd
[    2.020166] sdhci-arasan e0100000.sdhci: using device tree for GPIO lookup
[    2.020176] of_get_named_gpiod_flags: can't parse 'cd-gpios' property of node '/amba/sdhci@e0100000[0]'
[    2.020185] of_get_named_gpiod_flags: can't parse 'cd-gpio' property of node '/amba/sdhci@e0100000[0]'
[    2.020193] sdhci-arasan e0100000.sdhci: using lookup tables for GPIO lookup
[    2.020202] sdhci-arasan e0100000.sdhci: lookup for GPIO cd failed
[    2.020211] sdhci-arasan e0100000.sdhci: GPIO lookup for consumer wp
[    2.020218] sdhci-arasan e0100000.sdhci: using device tree for GPIO lookup
[    2.020226] of_get_named_gpiod_flags: can't parse 'wp-gpios' property of node '/amba/sdhci@e0100000[0]'
[    2.020234] of_get_named_gpiod_flags: can't parse 'wp-gpio' property of node '/amba/sdhci@e0100000[0]'
[    2.020241] sdhci-arasan e0100000.sdhci: using lookup tables for GPIO lookup
[    2.020248] sdhci-arasan e0100000.sdhci: lookup for GPIO wp failed
[    2.080611] mmc0: SDHCI controller on e0100000.sdhci [e0100000.sdhci] using DMA
[    2.091956] ledtrig-cpu: registered to indicate activity on CPUs
[    2.098877] usbcore: registered new interface driver usbhid
[    2.103119] usbhid: USB HID core driver
[    2.118736] fpga_manager fpga0: Xilinx Zynq FPGA Manager registered
[    2.125113] NET: Registered protocol family 10
[    2.129257] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
[    2.134663] NET: Registered protocol family 17
[    2.137725] can: controller area network core (rev 20120528 abi 9)
[    2.142661] NET: Registered protocol family 29
[    2.145720] can: raw protocol (rev 20120528)
[    2.148669] can: broadcast manager protocol (rev 20161123 t)
[    2.153062] can: netlink gateway (rev 20130117) max_hops=1
[    2.157528] Registering SWP/SWPB emulation handler
[    2.161880] hctosys: unable to open rtc device (rtc0)
[    2.165574] of_cfs_init
[    2.166767] of_cfs_init: OK
[    2.168490] ALSA device list:
[    2.170106]   No soundcards found.
[    2.172628] Waiting for root device /dev/mmcblk0p2...
[    2.178295] mmc0: new high speed SDHC card at address 0001
[    2.182951] mmcblk0: mmc0:0001 00000 7.30 GiB 
[    2.187725]  mmcblk0: p1 p2
[    2.291351] EXT4-fs (mmcblk0p2): couldn't mount as ext3 due to feature incompatibilities
[    2.313381] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
[    2.320117] VFS: Mounted root (ext4 filesystem) on device 179:2.
[    2.329229] devtmpfs: mounted
[    2.332236] Freeing unused kernel memory: 1024K (c0900000 - c0a00000)
[    2.411292] random: fast init done
[    2.592616] systemd[1]: systemd 215 running in system mode. (+PAM +AUDIT +SELINUX +IMA +SYSVINIT +LIBCRYPTSETUP +GCRYPT +ACL +XZ -SECCOMP -APPARMOR)
[    2.604799] systemd[1]: Detected architecture 'arm'.
[    2.667411] systemd[1]: Failed to insert module 'autofs4'
[    2.673131] systemd[1]: Set hostname to <zybo02>.
[    3.058208] systemd[1]: Cannot add dependency job for unit dbus.socket, ignoring: Unit dbus.socket failed to load: No such file or directory.
[    3.069815] systemd[1]: Cannot add dependency job for unit display-manager.service, ignoring: Unit display-manager.service failed to load: No such file or directory.
[    3.085555] systemd[1]: Starting Forward Password Requests to Wall Directory Watch.
[    3.092261] systemd[1]: Started Forward Password Requests to Wall Directory Watch.
[    3.098517] systemd[1]: Expecting device dev-ttyPS0.device...
[    3.130690] systemd[1]: Starting Remote File Systems (Pre).
[    4.329350] systemd-udevd[1189]: starting version 215
[    4.989040] FAT-fs (mmcblk0p1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
[    5.260483] systemd-journald[1201]: Received request to flush runtime journal from PID 1
[    5.596723] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[    9.750817] macb e000b000.ethernet eth0: link up (1000/Full)
[    9.755110] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready

The I2C adapter can be detected:

root@zybo02:~# i2cdetect -l
i2c-0	i2c       	Cadence I2C at e0004000         	I2C adapter

 

root@zybo02:~# i2cdetect -F 0
Functionalities implemented by /dev/i2c-0:
I2C                              yes
SMBus Quick Command              no
SMBus Send Byte                  yes
SMBus Receive Byte               yes
SMBus Write Byte                 yes
SMBus Read Byte                  yes
SMBus Write Word                 yes
SMBus Read Word                  yes
SMBus Process Call               yes
SMBus Block Write                yes
SMBus Block Read                 yes
SMBus Block Process Call         no
SMBus PEC                        yes
I2C Block Write                  yes
I2C Block Read                   yes

 

Scanning for devices gives no result:

root@zybo02:~# i2cdetect -y -r 0
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --

Dmesg gets flooded with timeouts:

[  291.192805] i2c i2c-0: ioctl, cmd=0x703, arg=0x38
[  291.192822] i2c i2c-0: ioctl, cmd=0x720, arg=0xbefc3630
[  291.192835] i2c i2c-0: master_xfer[0] R, addr=0x38, len=1
[  292.228132] cdns-i2c e0004000.i2c: timeout waiting on completion

 

When looking with an oscilloscope both SCL and SDA remain high all the time.

 

I would be very grateful if anyone could provide me with some pointers regarding this issue.

Tags (3)
0 Kudos
3 Replies
Explorer
Explorer
2,902 Views
Registered: ‎10-19-2017

Re: PS I2C: timeout waiting for completion

Yeah, I am having a similar issue with 2016.4 ZC706 on a QEMU. Just trying to do a basic write to I2C and it is failing with a similar message. Don't think it is a hardware issue; there is an I2C bus enabled in my Linux device tree.

i2c@e0004000 {
			compatible = "cdns,i2c-r1p10";
			status = "okay";
			clocks = <0x1 0x26>;
			interrupt-parent = <0x3>;
			interrupts = <0x0 0x19 0x4>;
			reg = <0xe0004000 0x1000>;
			#address-cells = <0x1>;
			#size-cells = <0x0>;
			clock-frequency = <0x61a80>;
			i2c-reset = <0x4 0x2e 0x0>;
		};

root@plnx_arm:~# /usr/bin/i2ctest
funcs & I2C_FUNC_I2C: 0funcs & I2C_FUNC_SMBUS_WORD_DATA: 0
Attempting to write to I2C bus via I2C protocol...
cdns-i2c e0004000.i2c: timeout waiting on completion
Wrote -1 bytes  Failed to write to I2C Bus

 

0 Kudos
Explorer
Explorer
1,738 Views
Registered: ‎05-28-2014

Re: PS I2C: timeout waiting for completion

Hello,

 

Is this issue resolved ? How ?

 

Thank you

0 Kudos
Adventurer
Adventurer
1,707 Views
Registered: ‎05-26-2017

Re: PS I2C: timeout waiting for completion

Have you checked to make sure the FSBL configured the MIO pins for I2C use ?

0 Kudos