Aaron.energy Posted September 5, 2018 Posted September 5, 2018 I was wondering if anyone could help with the following issue, We are working on a project utilized with an Orange Pi Lite, ALLWINNER H3 processor and Armbian stretch mainline kernel, Now we are bundled a chip over GPIO, due to the chip frequency we looking for a library or setting file to modify and match I2C frequency with the chip, BR,
martinayotte Posted September 5, 2018 Posted September 5, 2018 As you can see in Mainline doc, you can use "clock-frequency" parameter directly either in main DT or in the i2c overlay. https://elixir.bootlin.com/linux/v4.18.5/source/Documentation/devicetree/bindings/i2c/i2c.txt Beware that kernel driver will probably only accept standard rates, either 100000 or 400000.
Aaron.energy Posted September 6, 2018 Author Posted September 6, 2018 Tnx Martinayotte for your reply, Sorry, I'm new to Armbian. Are you meaning that i should modify i2c dt source and recompile kernel or it's possible to establish changes in a working armbian.
martinayotte Posted September 6, 2018 Posted September 6, 2018 3 hours ago, Aaron.energy said: it's possible to establish changes in a working armbian. Yes ! you simply need to decompile device-tree DTBO into DTS source using "dtc" compiler, edit the DTS by adding "clock-frequency = <100000>;" in the i2c node, and then re-compile it into DTBO (after having take care of doing a backup of original DTBO).
Aaron.energy Posted September 8, 2018 Author Posted September 8, 2018 There are some dtbo files in the /boot directory. Which one of them should be modified with clock frequency? Again tnx for your attention martin. 1
Aaron.energy Posted September 8, 2018 Author Posted September 8, 2018 Tnx martin, I found the the proper dtb file in /boot/dtb directory. According to my board version it was sun8i-h3-orangepi-lite.dtb which I recompiled it and successfully its i2c frequency changed.cd /boot/dtb Following I insert my instructions maybe it can help some other people. dtc -I dtb -O dts sun8i-h3-orangepi-lite.dtb -o sun8i-h3-orangepi-lite.dts #modifiy dts file and set clock-frequency=0x009c40 in node i2c@01c2ac00 dtc -I dts -O dtb sun8i-h3-orangepi-lite.dts -o sun8i-h3-orangepi-lite.dtb sudo reboot
ag123 Posted September 21, 2018 Posted September 21, 2018 i found a more recent dtc compiler which might be shipped in a 'future' release of debian (it isn't in nightly) that has the dynamic overlay and symbol substitution features it is actually a more recent version of dtc bundled with the linux kernel. Some how that recent version didn't get bundled with the recent kernels which uses those features
Recommended Posts