IMX8QXP adroid11 i2c扫描问题

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

IMX8QXP adroid11 i2c扫描问题

429 Views
c-luo
Contributor III

您好,NXP:
最近我使用imx8qxp的板子,android11系统,用的是imx8qxp官方的源码。 发现源码中的i2c0和cm4是复用的,并且用的是gpio模拟的i2c进行数据通信。源码中:

&cm40_i2c {
#address-cells = <1>;
#size-cells = <0>;
clock-frequency = <100000>;
pinctrl-names = "default", "gpio";
pinctrl-0 = <&pinctrl_cm40_i2c>;
pinctrl-1 = <&pinctrl_cm40_i2c_gpio>;
scl-gpios = <&lsio_gpio1 10 GPIO_ACTIVE_HIGH>;
sda-gpios = <&lsio_gpio1 9 GPIO_ACTIVE_HIGH>;
status = "okay";
};
使用gpio1-10和gpio1-9模拟的i2c的数据和时钟线。我的i2c驱动加载正常,log中会有一些警告,并不会导致我的驱动加载失败。 但是我在不知到为什么驱动log中会出现错误的提示,尽管这并不影响我的使用。
1|mek_8q:/ # logcat -b all | grep i2c
05-20 07:54:41.603 0 0 I : i2c /dev entries driver
05-20 07:54:42.263 0 0 I imx-lpi2c 37230000.i2c: using scl,sda for recovery
05-20 07:54:42.269 0 0 E imx-lpi2c 37230000.i2c: can't get the TX DMA channel, error -19!
05-20 07:54:42.276 0 0 E imx-lpi2c 37230000.i2c: error -ENODEV: dma setup error -19, use pio
05-20 07:54:42.290 0 0 I i2c-16 : LPI2C adapter registered
05-20 07:54:42.295 0 0 E imx-lpi2c 5a810000.i2c: can't get the TX DMA channel, error -19!
05-20 07:54:42.302 0 0 E imx-lpi2c 5a810000.i2c: error -ENODEV: dma setup error -19, use pio
05-20 07:54:42.319 0 0 E OF : graph: no port node found in /bus@5a000000/i2c@5a810000/typec-portc@22
05-20 07:54:42.327 0 0 E OF : graph: no port node found in /bus@5a000000/i2c@5a810000/typec-portc@22r
05-20 07:54:42.336 0 0 E OF : graph: no port node found in /bus@5a000000/i2c@5a810000/typec-portc@22r
05-20 07:54:42.354 0 0 I i2c-1 : LPI2C adapter registered
05-20 07:54:42.360 0 0 E imx-lpi2c 5a820000.i2c: can't get the TX DMA channel, error -19!
05-20 07:54:42.367 0 0 E imx-lpi2c 5a820000.i2c: error -ENODEV: dma setup error -19, use pio
05-20 07:54:42.505 0 0 I i2c-2 : LPI2C adapter registered
05-20 07:54:42.518 0 0 E imx-lpi2c 5a830000.i2c: can't get the TX DMA channel, error -19!
05-20 07:54:42.525 0 0 E imx-lpi2c 5a830000.i2c: error -ENODEV: dma setup error -19, use pio
05-20 07:54:42.556 0 0 I i2c-3 : LPI2C adapter registered

我的i2c-1(不是gpio模拟)和i2c-2总线(不是gpio模拟的)扫描正常。但是我的i2c-16是使用gpio模拟的i2c总线,在扫描的时候会出现卡顿一下的情况:
mek_8q:/ # i2cdetect -y 16
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
[ 83.344813] AidlLazyServiceRegistrar: Process has 0 (of 1 available) client(s) in use after notification android.apex.IApexService has clients: 0
[ 83.359267] AidlLazyServiceRegistrar: Trying to shut down the service. No clients in use for any service in process.
[ 83.371976] AidlLazyServiceRegistrar: Unregistered all clients and exiting
[ 83.383746] printk: Binder:313_2: 221 output lines suppressed due to ratelimiting
[ 83.393267] init: Service 'apexd' (pid 313) exited with status 0 oneshot service took 60.764000 seconds in background
[ 83.405248] init: Sending signal 9 to service 'apexd' (pid 313) process group...
[ 83.413305] libprocessgroup: Successfully killed process cgroup uid 0 pid 313 in 0ms
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- 68 -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
可以清楚的看到当我扫描i2c-16的时候,我会马上显示00 ~ 0F的地址,但是我的10~1F的地址中间会卡顿大概2s,此时如果有log打印则会显示在i2c总线地址的中间。
并且我的i2c-16的0x1a的地址上挂载了一个wm8960的音频芯片,我并没有扫描到对应的外设。我试着去i2cdump对应的寄存器。但是他提示我链接超时:
mek_8q:/ # i2cdump -f -y 16 0x1a
0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
i2cdump: i2c_read_byte: Connection timed out
我们通过使用示波器进行测量,发现i2c扫描到了该地址,但是并没有对该地址进行读写
我尝试去修改i2c的速率,但是这并没有任何改善。 我用示波器去测量,发现我的数据线会马上被拉底2s左右(i2c扫描卡顿)然后才会有一段正常的数据出现 我现在不知道该如何去解决这个bug。


十分感谢你们,并期待你们的回复!

 

0 Kudos
Reply
0 Replies