How to configure i2c to high speed mode

Brandon Wyman bjwyman at gmail.com
Tue Nov 26 08:25:09 AEDT 2019


On Sun, Nov 10, 2019 at 9:22 PM John Wang <wangzhiqiang8906 at gmail.com> wrote:
>
> Hi,all
>
> I did a test and found that if the firmware image is transmitted via i2c,
> it's too slow.
>
> The test I did:
>
> *slave side:
>
> use i2c-slave-mqueue[1] to receive and queue messages from the remote
> i2c master device.  the driveri's message size is 120 bytes,queue size
> is 32.
>
> *master side:
>
> test.sh:
> #!/bin/sh
>
> for i in {1..30}
> do
> i2ctransfer -y 3 w100 at 0x10 0xff-        # send 100 bytes
> done
>
> $time test.sh
> real 0m0.789s
> user 0m0.076s
> sys 0m0.328s
>
> Then 30*100/0.789 = 3.8k bytes/s, it will take 2.4 hours to send a 32M image
>
> Could we config the i2c to high speed mode? if so, how to configure it?

Is that just the bus-frequency property? It looks like the default
chosen in the dtsi files is 100000, but I do see instances of others
apparently overriding that in dts files.

https://github.com/openbmc/linux/blob/d41fa1fda16b4b0f9a2d098c1de8f259a00cc9bc/arch/arm/boot/dts/aspeed-g6.dtsi#L662

$ grep "bus-frequency" arch/arm/boot/dts/aspeed-bmc-*.dts
arch/arm/boot/dts/aspeed-bmc-facebook-minipack.dts:     bus-frequency
= <400000>;
arch/arm/boot/dts/aspeed-bmc-lenovo-hr855xg2.dts:       bus-frequency = <90000>;
$

>
> Thanks.
>
> [1] https://patchwork.ozlabs.org/patch/894425/


More information about the openbmc mailing list