Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
en:xu3_hardware_i2c [2017/06/14 15:40] ruppi [How to change the I2C clock speed] |
en:xu3_hardware_i2c [2017/06/20 16:05] neal [How to change the I2C clock speed] |
||
---|---|---|---|
Line 101: | Line 101: | ||
Make a backup of DTB file. | Make a backup of DTB file. | ||
+ | * kernel 4.9.y | ||
<code> | <code> | ||
- | cp /media/boot/meson64_odroidc2.dtb /media/boot/exynos5422-odroidxu3.dtb.org | + | cp /media/boot/exynos5422-odroidxu4.dtb /media/boot/exynos5422-odroidxu4.dtb.org |
+ | </code> | ||
+ | * kernel 3.10.y | ||
+ | <code> | ||
+ | cp /media/boot/exynos5422-odroidxu3.dtb /media/boot/exynos5422-odroidxu3.dtb.org | ||
+ | </code> | ||
+ | |||
+ | Using dtc command, you can make "dts" type of device tree from "dtb" type. | ||
+ | * kernel 4.9.y | ||
+ | <code> | ||
+ | dtc -I dtb -O dts -o exynos5422-odroidxu4.dts exynos5422-odroidxu4.dtb | ||
+ | </code> | ||
+ | * kernel 3.10.y | ||
+ | <code> | ||
+ | dtc -I dtb -O dts -o exynos5422-odroidxu3.dts exynos5422-odroidxu3.dtb | ||
+ | </code> | ||
+ | |||
+ | And, open by an editor you like it and check the i2c path. | ||
+ | <code> | ||
+ | vi exynos5422-odroidxu4.dts | ||
+ | |||
+ | -------------------------------------- | ||
+ | .. | ||
+ | / { | ||
+ | .. | ||
+ | soc { | ||
+ | .. | ||
+ | i2c@12C70000 { | ||
+ | .. | ||
+ | -------------------------------------- | ||
+ | </code> | ||
+ | |||
+ | Check current maximum bus frequency of i2c@12C70000 | ||
+ | * kernel 4.9.y | ||
+ | <code> | ||
+ | fdtget /media/boot/exynos5422-odroidxu4.dtb /soc/i2c@12C70000 samsung,i2c-max-bus-freq | ||
+ | </code> | ||
+ | * kernel 3.10.y | ||
+ | <code> | ||
+ | fdtget /media/boot/exynos5422-odroidxu3.dtb /i2c@12C70000 samsung,i2c-max-bus-freq | ||
</code> | </code> | ||
Change the DTB file for i2c-1 (i2c channel #1) | Change the DTB file for i2c-1 (i2c channel #1) | ||
+ | * kernel 4.9.y | ||
<code> | <code> | ||
- | fdtput -t i /media/boot/exynos5422-odroidxu3.dtb /i2c@c1108500 master_i2c_speed "100000" | + | fdtput -t i /media/boot/exynos5422-odroidxu4.dtb /soc/i2c@12c70000 samsung,i2c-max-bus-freq "10000" |
sync | sync | ||
reboot | reboot | ||
</code> | </code> | ||
- | + | * kernel 3.10.y | |
- | Change the DTB file for i2c-2 (i2c channel #2) | + | |
<code> | <code> | ||
- | dtput -t i /media/boot/exynos5422-odroidxu3.dtb /i2c@c11087c0 master_i2c_speed "100000" | + | fdtput -t i /media/boot/exynos5422-odroidxu3.dtb /i2c@12c70000 samsung,i2c-max-bus-freq "10000" |
sync | sync | ||
reboot | reboot | ||
</code> | </code> | ||
- | If you want to go back to original 300Khz mode, change "100000" to "300000".\\ | + | If you want to go back to original 400Khz mode, change "10000" to "400000".\\ |
**Actual I2C clock speed** (Measured with an oscilloscope)\\ | **Actual I2C clock speed** (Measured with an oscilloscope)\\ | ||
- | In 300Khz mode : 270Khz \\ | + | In 400Khz mode : 344.8khz \\ |
- | In 100Khz mode : 80Khz \\ | + | In 100Khz mode : 63.7khz \\ |
+ | In 10Khz mode : 9.3Khz \\ | ||
**Default I2C clock speed** \\ | **Default I2C clock speed** \\ | ||
- | C1/C1+/C0 : 100Khz mode \\ | + | |
- | C2 : 400Khz mode \\ | + | XU4 : 400Khz mode \\ |