Olimex Support Forum

OLinuXino Android / Linux boards and System On Modules => A20 => Topic started by: tedium on June 02, 2023, 11:31:26 AM

Title: Change clock frequency of i2c - device tree overlay
Post by: tedium on June 02, 2023, 11:31:26 AM
Hi

I am trying to change the I2C clock frequency on my 'A20-OLinuXino-LIME2' with the Image 'A20-OLinuXino-bullseye-minimal-20220928-143706.img'.

I have done some research on this topic and came across Device Tree Overlays which an be linked in the '/boot/uEnv.txt' file. So my question is how do I find the right device the in device tree?

If I search the device tree file I get five results:
i2c@1c2ac00 {
compatible = "allwinner,sun7i-a20-i2c\0allwinner,sun4i-a10-i2c";
i2c@1c2b000 {
compatible = "allwinner,sun7i-a20-i2c\0allwinner,sun4i-a10-i2c";
i2c@1c2b400 {
compatible = "allwinner,sun7i-a20-i2c\0allwinner,sun4i-a10-i2c";
i2c@1c2b800 {
compatible = "allwinner,sun7i-a20-i2c\0allwinner,sun4i-a10-i2c";
i2c@1c2c000 {
compatible = "allwinner,sun7i-a20-i2c\0allwinner,sun4i-a10-i2c";

And I don't know which is the one I should overlay. Another point is, that in these devices there is no clock frequency attribute, only the clocks attribute which contains two addresses of clocks.

This is my fist post in this forum, I hope my text structure is okey and you understand my questions.

Thanks in advance
 
Title: Re: Change clock frequency of i2c - device tree overlay
Post by: LubOlimex on August 01, 2023, 04:50:48 PM
It might be the in the u-boot. I am not sure if it is so easy to change it in run-time, maybe someone more experienced can say but I'd assume speed is set when driver is loaded.