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
Visitor joule_thief
Visitor
486 Views
Registered: ‎02-27-2019

AXI IIC Bus Cannot Set SCL Frequency

Hello,

 

I want to set the i2c speed to 400 kHz for a Linux application using the axi_iic bus. Normally, this is done via the device-tree, but the "clock-frequency" property has no effect on this bus.

At first, the SCL frequency was stuck at 5 kHz until the introduction of this patch: Retain Timing Values

 

Now, the bus operates at a reasonable speed (1 MHz, fast-mode). However, I need to use 400 kHz (full-speed) so I set up my device-tree as shown below:

 

 

		pl_i2c0: i2c@41600000 {
			#address-cells = <1>;
			#size-cells = <0>;
			compatible = "xlnx,xps-iic-2.00.a";
			clocks = <&clkc 15>;
			interrupt-parent = <&intc>;
			interrupts = <0 29 4>;
			reg = <0x41600000 0x10000>;
			clock-frequency = <400000>;
		};

 

 

The SCL frequency never alters from 1 MHz as measured with a logic analyzer:

 

Broken_axi_iic_bus.png

 

What actually controls the i2c speed and how can I overwrite it?

 

Thanks.

0 Kudos
3 Replies
Explorer
Explorer
428 Views
Registered: ‎06-03-2015

Re: AXI IIC Bus Cannot Set SCL Frequency

Hi

In fact I2C speed provided in depends I2C Master controller used in PL Program on FPGA board, if it really supports , we can alter the speed of Device using I2C .dts node

Here the points is Integrated I2C supports max. speed supports how much, please check the TRM ,

if it supports, there are set of Bits to change the speed from existing value to max. aue, so these values should modify in the Header file if I2C Master controller Driver.

So the vaues adjusted in the I2C master driver will be effected in .dts file

Because .dts is simply identifying avalible devices instead of changing their capabilities

Provide Kudos if reply is helpful.

Thanks &  Regards

Satish G

G Satish Kumar
0 Kudos
Visitor joule_thief
Visitor
407 Views
Registered: ‎02-27-2019

Re: AXI IIC Bus Cannot Set SCL Frequency

Hi Satish,

What you're saying makes sense; I understand the device-tree doesn't change the properties of the device. The device I'm using certainly *does* support the other speeds I'm trying to change to.

 

When you say "set of bits" are you referring to the registers that contain timing values for I2C (i.e. TSUSTA, TSUSTO, etc.)?

I've managed to hard-code the correct values in there and set the speed I want.

 

I still wish I had an answer as to what is actually happening here, though. Is the .dts value being interpretted anywhere? Or is it being continously overwritten by some other mechanism?

 

Thanks

0 Kudos
Explorer
Explorer
397 Views
Registered: ‎06-03-2015

Re: AXI IIC Bus Cannot Set SCL Frequency

Hi

Yes, I am refering to Register bits of I2C master cotroller, because by default board vendor here Xilinx BSP code support one value, which give certain speed ,  and you are trying to change the same, should change identify register for Changing speed for I2C Controller , & change corrspending bit(If it supports).

Provide Kudos, if post is helpful.

Regards

Satish G

G Satish Kumar
0 Kudos