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
5,051 Views
Registered: ‎02-15-2017

PetaLinux 2016.4 AXI I2C bus

Jump to solution

I'm having problems adding AXI I2C support to my ZedBoard.  It's partially in my device tree under amba_pl, but I don't see the expected driver probes under Linux.  The result I expect is to see an i2c device created for my bus (ex /dev/i2c-2).

 

In Vivado, I have an AXI I2C peripheral on PS_MIO14 and PS_MIO15.  The HDF import into the PetaLinux build produces the following in my device tree.

 

i2c@80005000 {
#address-cells = <0x1>;
#size-cells = <0x0>;
clock-names = "ref_clk";
clocks = <0x1 0xf>;
compatible = "xlnx,xps-iic-2.00.a";
reg = <0x80005000 0x1000>;
};

 

According to http://www.wiki.xilinx.com/Linux+I2C+Driver, I should expect something more like:

IIC: i2c@81600000 {
    compatible = "xlnx,xps-iic-2.00.a";
    interrupt-parent = <&xps_intc_0>;
    interrupts = < 6 2 >;
    reg = < 0x81600000 0x10000 >;
    xlnx,clk-freq = <0x5f5e100>;
    xlnx,family = "virtex5";
    xlnx,gpo-width = <0x1>;
    xlnx,iic-freq = <0x186a0>;
    xlnx,scl-inertial-delay = <0x0>;
    xlnx,sda-inertial-delay = <0x0>;
    xlnx,ten-bit-adr = <0x0>;
 
    #address-cells = <1>;
    #size-cells = <0>;
 
    m24c08@50 {
        compatible = "at,24c08";
        reg = <0x50>;
    };
} ;

 I've also inserted my slave device in place of the m24c08 using system-top.dts, but I presume I should see the bus driver initialized in dmesg even without a slave declared.

 

On the target:

root@plnx_arm:~# i2cdetect -l
i2c-0 i2c Cadence I2C at e0004000 I2C adapter
i2c-1 i2c Cadence I2C at e0005000 I2C adapter

 

root@plnx_arm:~# cat /proc/interrupts
CPU0 CPU1
16: 1 0 GIC-0 27 Edge gt
17: 0 0 GIC-0 43 Level ttc_clockevent
18: 347021 114414 GIC-0 29 Edge twd
21: 43 0 GIC-0 39 Level f8007100.adc
141: 0 0 GIC-0 57 Level cdns-i2c
142: 0 0 GIC-0 80 Level cdns-i2c
144: 0 0 GIC-0 35 Level f800c000.ocmc
145: 110 0 GIC-0 59 Level
146: 2272 0 GIC-0 82 Level xuartps
147: 138 0 GIC-0 81 Level e0007000.spi
148: 6 0 GIC-0 51 Level e000d000.spi
149: 32217 0 GIC-0 54 Level eth0
150: 16479 0 GIC-0 56 Level mmc0
151: 0 0 GIC-0 45 Level f8003000.dmac
152: 0 0 GIC-0 46 Level f8003000.dmac
153: 0 0 GIC-0 47 Level f8003000.dmac
154: 0 0 GIC-0 48 Level f8003000.dmac
155: 0 0 GIC-0 49 Level f8003000.dmac
156: 0 0 GIC-0 72 Level f8003000.dmac
157: 0 0 GIC-0 73 Level f8003000.dmac
158: 0 0 GIC-0 74 Level f8003000.dmac
159: 0 0 GIC-0 75 Level f8003000.dmac
160: 0 0 GIC-0 40 Level f8007000.devcfg
IPI1: 0 0 Timer broadcast interrupts
IPI2: 21516 26964 Rescheduling interrupts
IPI3: 35 75 Function call interrupts
IPI4: 0 0 CPU stop interrupts
IPI5: 1 0 IRQ work interrupts
IPI6: 0 0 completion interrupts
Err: 0

 

Does anyone have any ideas why I can't register this bus?

0 Kudos
1 Solution

Accepted Solutions
Moderator
Moderator
8,594 Views
Registered: ‎04-17-2011

Re: PetaLinux 2016.4 AXI I2C bus

Jump to solution

AXI IIC can only be implemented in the PL where the IP can be connected to GP port. Have you ensured that the Interrupt pin from AXI IIC is connected properly to the Zynq Interrupt port? I couldn't see the Interrupt-parent entry for your i2c node. 

 

Example:

axi_iic_0: i2c@40000000 {
#address-cells = <1>;
#size-cells = <0>;
compatible = "xlnx,xps-iic-2.00.a";
interrupt-parent = <&gic>;
interrupts = <8 2>;
reg = <0x43c20000 0x1000>;
};

Regards,
Debraj
----------------------------------------------------------------------------------------------
Kindly note- 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
3 Replies
4,903 Views
Registered: ‎02-15-2017

Re: PetaLinux 2016.4 AXI I2C bus

Jump to solution

I was mistaken about the PS_MIO14 and PS_MIO15 device, because that's on the PS side.  There's a separate issue preventing me from talking to that slave.

 

My questions still stand about the AXI I2C peripheral.  I have one at 80004000 and 80005000 that look pretty similar and are missing those attributes I described.  What's interesting is the missing attributes appear to be in the hdf (specifically in the hwh file), so I believe they are not getting correctly imported by PetaLinux.

 

Here are the missing values for one of my AXI I2C peripherals:

<PARAMETERS>
<PARAMETER NAME="C_FAMILY" VALUE="zynq"/>
<PARAMETER NAME="C_S_AXI_ADDR_WIDTH" VALUE="9"/>
<PARAMETER NAME="C_S_AXI_DATA_WIDTH" VALUE="32"/>
<PARAMETER NAME="C_IIC_FREQ" VALUE="100000"/>
<PARAMETER NAME="C_TEN_BIT_ADR" VALUE="0"/>
<PARAMETER NAME="C_GPO_WIDTH" VALUE="1"/>
<PARAMETER NAME="C_S_AXI_ACLK_FREQ_HZ" VALUE="100000000"/>
<PARAMETER NAME="C_SCL_INERTIAL_DELAY" VALUE="0"/>
<PARAMETER NAME="C_SDA_INERTIAL_DELAY" VALUE="0"/>
<PARAMETER NAME="C_SDA_LEVEL" VALUE="1"/>
<PARAMETER NAME="C_SMBUS_PMBUS_HOST" VALUE="0"/>
<PARAMETER NAME="C_DEFAULT_VALUE" VALUE="0x00"/>
<PARAMETER NAME="Component_Name" VALUE="axi_fan_bus_0"/>
<PARAMETER NAME="TEN_BIT_ADR" VALUE="7_bit"/>
<PARAMETER NAME="AXI_ACLK_FREQ_MHZ" VALUE="100.0"/>
<PARAMETER NAME="IIC_FREQ_KHZ" VALUE="100"/>
<PARAMETER NAME="USE_BOARD_FLOW" VALUE="false"/>
<PARAMETER NAME="IIC_BOARD_INTERFACE" VALUE="Custom"/>
<PARAMETER NAME="EDK_IPTYPE" VALUE="PERIPHERAL"/>
<PARAMETER NAME="C_BASEADDR" VALUE="0x80004000"/>
<PARAMETER NAME="C_HIGHADDR" VALUE="0x80004FFF"/>
</PARAMETERS>

 

Has anyone encountered anything like this?

0 Kudos
Moderator
Moderator
4,852 Views
Registered: ‎07-31-2012

Re: PetaLinux 2016.4 AXI I2C bus

Jump to solution

Hi,

 

AXI IIC pins are on PL side for both SCL and SDA. It is not PS MIOs.

Also make sure you have enabled the Xilinx IIC driver in kernel configuration during petalinux flow.

 

Thus the IP nodes will be in amba_pl.

 

regards

Praveen


-------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------
Moderator
Moderator
8,595 Views
Registered: ‎04-17-2011

Re: PetaLinux 2016.4 AXI I2C bus

Jump to solution

AXI IIC can only be implemented in the PL where the IP can be connected to GP port. Have you ensured that the Interrupt pin from AXI IIC is connected properly to the Zynq Interrupt port? I couldn't see the Interrupt-parent entry for your i2c node. 

 

Example:

axi_iic_0: i2c@40000000 {
#address-cells = <1>;
#size-cells = <0>;
compatible = "xlnx,xps-iic-2.00.a";
interrupt-parent = <&gic>;
interrupts = <8 2>;
reg = <0x43c20000 0x1000>;
};

Regards,
Debraj
----------------------------------------------------------------------------------------------
Kindly note- 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