cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
fanat9
Explorer
Explorer
10,152 Views
Registered: ‎02-16-2014

AXI I2C device tree node.

Jump to solution

Can anybody post a correct device tree node for Xilinx AXI I2C IP for Xilinx kernel 3.14.2 which comes with Petalinux 2014.2?

 

In a hardware design I got 2 PS I2C and 1 PL AXI I2C and I enabled both Cadence and Xilinx I2C drivers in a kernel config. And PS I2C modules getting detected at boot time and work just fine, but not a AXI one.

 

I tried different 'compatible' strings with no luck including "xlnx,xps-iic-2.00.a" which I found in xilinx i2c driver. If I set it to be Cadence version - it failed to detect clock source and I can't figure out correct clock source for AXI I2C. Anybody got it to work with latest kernel from Xilinx?

 

Regards

 

 

0 Kudos
1 Solution

Accepted Solutions
fanat9
Explorer
Explorer
15,467 Views
Registered: ‎02-16-2014

Thank you for the only response.

 

I already solved my problem. Apparently, axy-i2c device tree node must have interrupt defined. In my hardware design I left interrupt unconnected and autogenerated device tree node have interrupt value ommitted, something like "interrupts = <0  4>;" Once I set it to some number driver started to see it. Not sure if I really needed an interrupt, but I went and changed my hardware design to have a real value to set to.

View solution in original post

0 Kudos
4 Replies
jpl@xiphos.ca
Adventurer
Adventurer
10,138 Views
Registered: ‎10-28-2007

I'm not the one responsible for generating the DTS here, but apparently Vivado generates the following within the _ps.dtsi.

 

143     ps7_i2c_0: ps7-i2c@e0004000 {                                               
144       bus-id = <0>;                                                             
145       clock-frequency = <400000>;                                               
146       clocks = <&clkc 38>;                                                      
147       compatible = "cdns,i2c-r1p10";                                            
148       interrupt-parent = <&ps7_scugic_0>;                                       
149       interrupts = <0 25 4>;                                                    
150       reg = <0xe0004000 0x1000>;                                                
151       xlnx,has-interrupt = <0x1>;                                               
152       xlnx,i2c-reset = "";                                                      
153     } ;      

 

I then have a separate .dtsi that includes the I2C slaves.

 

 10 &ps7_i2c_0 {                                                                    
 11   #address-cells = < 1 >;                                                       
 12   #size-cells = < 0 >;                                                          
 13   q7adc: max11613@34 {                                                          
 14     compatible = "maxim,max11613";                                              
 15     reg = <0x34>;                                                               
 16     vcc-supply = <&q7_3v3>;                                                     
 17   };                                                                            
 18   q7rtc: ab-rtcmc@56 {                                                          
 19     compatible = "abracon,ab-rtcmc";                                            
 20     reg = <0x56>;                                                               
 21   };                                                                            
 22 } ; 

 

How does this compare to what is generated by your tools?

 

Joshua

0 Kudos
fanat9
Explorer
Explorer
15,468 Views
Registered: ‎02-16-2014

Thank you for the only response.

 

I already solved my problem. Apparently, axy-i2c device tree node must have interrupt defined. In my hardware design I left interrupt unconnected and autogenerated device tree node have interrupt value ommitted, something like "interrupts = <0  4>;" Once I set it to some number driver started to see it. Not sure if I really needed an interrupt, but I went and changed my hardware design to have a real value to set to.

View solution in original post

0 Kudos
snehaputhani
Visitor
Visitor
9,743 Views
Registered: ‎09-17-2014

Did u use cadence driver or xilinx xps-iic driver in the device tree node?

I am facing the same issue with cadence driver, its regarding the input clock source.

 

axi_iic:i2c@41600000 {
            compatible = "cdns,i2c-r1p10";
            reg = < 0x41600000 0x10000 >;
            interrupt-parent = <&ps7_scugic_0>;
            interrupts = <0 32 4>;
            i2c-clk = <100000>;
            input-clk = <111111111>;
            #size-cells = <0>;
            #address-cells = <1>;

};

 

The above is my device tree node for axi-i2c.

 

If i use xilinx driver as shown below:

 

axi_iic:i2c@41600000 {
            compatible = "xlnx,xps-iic-2.00.a";
            reg = < 0x41600000 0x10000 >;
            interrupt-parent = <&ps7_scugic_0>;
            interrupts = <0 32 4>;
            xlnx,ten-bit-adr = <0x0>;
            xlnx,gpo-width = <0x1>;
            #size-cells = <0>;
            #address-cells = <1>;
        };

 

I can see i2c-0 under /dev folder.

But the issue is that read and write always fails with error no 110.  The error is " connection timed out" error.

 

Tags (1)
0 Kudos
vijaydhoki
Adventurer
Adventurer
1,683 Views
Registered: ‎07-03-2019

Hi @snehaputhani i'm getting a reg property error while compiling the kernel source ,will you please how to do that .

0 Kudos