chowderhead Posted September 3, 2018 Posted September 3, 2018 4.14.65-sunxi on an Orange Pi Zero. Trying to set the i2c bus speed to 400kHz using the following dts: /dts-v1/; /plugin/; / { compatible = "allwinner,sun8i-h3"; fragment@0 { target = <&i2c0>; __overlay__ { clock-frequency = <400000>; }; }; }; Which produces: Error: dtc does not support compiling overlays Please try to install matching kernel headers Installed linux-headers-next-sunxi and still getting the same thing. Device tree compiler version: DTC 1.4.2. What am I doing wrong? Spoiler
ag123 Posted September 10, 2018 Posted September 10, 2018 try with Pantelis Antoniou's dtc compiler https://github.com/pantoniou/dtc and i'm not sure if your dtc script is correct and if it'd actually work there are hints in this thread as well
martinayotte Posted September 10, 2018 Posted September 10, 2018 2 hours ago, ag123 said: try with Pantelis Antoniou's dtc compiler https://github.com/pantoniou/dtc ... and make sure to swtich the the right branch by doing "git checkout dt-overlays5" ...
chowderhead Posted September 15, 2018 Author Posted September 15, 2018 Thanks ag123 - the link to the other post did the trick. Didn't need to try the other dtc compiler. In case someone else is doing the same thing: Decompile the dtb in /boot/dtb. In the case of the Orange Pi Zero, it's sun8i-h2-plus-orangepi-zero.dtb: dtc -I dtb -O dts sun8i-h2-plus-orangepi-zero.dtb -o sun8i-h2-plus-orangepi-zero.dts The original dtb had no clock frequency entries for any of the i2c buses: i2c0 (i2c@01c2ac00), i2c1 (i2c@01c2b000) and i2c2 (i2c@01c2b400). Add a line to the i2c@01c2b000 (i2c) section (or whichever bus you're wishing to change): clock-frequency = <0x61A80>; Recompile the dts: dtc -I dts -O dtb sun8i-h2-plus-orangepi-zero.dts -o sun8i-h2-plus-orangepi-zero.dtb Reboot.
Recommended Posts