Hi,
I am working on kernel 5.10 and imx8qxp. An eeprom is connected on i2c_mipi_csi0, the dts is below:
&i2c_mipi_csi0 {
#address-cells = <1>;
#size-cells = <0>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_i2c_mipi_csi0>;
clock-frequency = <100000>;
status = "okay";
eeprom@50 {
compatible = "atmel,24c64";
reg = <0x50>;
pagesize = <32>;
status = "okay";
};
};
pinctrl_i2c_mipi_csi0: i2c-mipi-csi0grp {
fsl,pins = <
IMX8QXP_MIPI_CSI0_I2C0_SCL_MIPI_CSI0_I2C0_SCL 0xc2000020
IMX8QXP_MIPI_CSI0_I2C0_SDA_MIPI_CSI0_I2C0_SDA 0xc2000020
>;
};
but I only got results as:
There is no device of i2c_mipi_csi0. I don't know where I was wrong. Could you help me with this? thanks a lot!
Li
解決済! 解決策の投稿を見る。
Hi Rita,
thanks for your support.
I found the problem: we need to enable at least one isi interface, after adding below in device tree, i2c_mipi_csi0 works.
+&isi_0 {
+ status = "okay";
+
+ port@0 {
+ isi_input: endpoint {
+ remote-endpoint = <&ar0234_mipi_ep>;
+ };
+ };
+ cap_device {
+ status = "okay";
+ };
+};
Hi Team
Any update on below query , Please expecting inputs from expertise .
Any inputs/suggestion are welcome and most appreciated !!
Thanks in Advance !!
Li
Hi
I found i2c_mipi_csi0 on my board are connected to 1V8, but i2c-0, i2c-1, i2c-2, i2c-3 are connected to 3V3. is this related? how to configure i2c_mipi_csi0 to 1.8v? thanks
Li
That's maybe the root cause, so coudl you share us your schematic, we can help check and confirm
Hi Rita,
Thanks for reply, attached are schematics of i2c_mipi_csi0, we used this i2c for camera, I/O expander, EEPROM. In hardware, there is two pull up in i2c, I removed 2k on R11 and R12, the results are same.
I have some questions about the dts settings of i2c_mipi_csi0. Is i2c_mipi_csi0 a special i2c only for mipi csi interface? when I set MIPI_CSI0_I2C0_SCL and MIPI_CSI0_I2C0_SDA to &i2c0, the I/O expander can be found. It matches the datasheet. but when set these two pins to i2c_mipi_csi0, the I/O expander cannot be found.
I added our device tree file, defconfig file and power on log. please help check the dts file, anything wrong? Is there any other kernel configure need to be added or removed to enable i2c_mipi_csi0?
In the log, if i2c_mipi_csi0 works, should I see a 5th i2c port in "i2cdetect -l" command?
thanks
Li
Hi @liaxxin ,]
I know that:
when I set MIPI_CSI0_I2C0_SCL and MIPI_CSI0_I2C0_SDA to &i2c0, the I/O expander can be found. It matches the datasheet. but when set these two pins to i2c_mipi_csi0, the I/O expander cannot be found.
It is normal in your side, as set these two pins to i2c_mipi_csi0 so they are using for the MIPI CSI. As If the I2C0 IF inside MIPI CSI0 has been multiplexed on MIPI_CSI0_I2C0_SCL/SDA, it cannot be assigned on CSI_PCLK/MCLK anymore.
Hi Rita,
I did two independent tests. please see my last message. If I configured as i2c-mipi-csi0, (see imx8dx-axcore-i2c-mipi-csi0.dts in last message), is it a dedicated mipi-csi interface, which cannot be used as an i2c interface? Our hardware design to use MIPI_CSI0_I2C0_SCL & MIPI_CSI0_I2C0_SDA to drive a mipi-csi sensor, and I/O expander, eeprom and ADC as well. Is this design wrong?
please see more devices connected on MIPI_CSI0_I2C0_SCL & MIPI_CSI0_I2C0_SDA
Thanks
Li
What about the "when I set MIPI_CSI0_I2C0_SCL and MIPI_CSI0_I2C0_SDA to &i2c0, the I/O expander can be found,but when set these two pins to i2c_mipi_csi0, the I/O expander cannot be found.." you mentioned?
Can you share both of this two situation softare code and test result to us.
Thanks
Hi Rita:
I did two tests:
test1: MIPI_CSI0_I2C0_SCL and MIPI_CSI0_I2C0_SDA are configured as i2c_mipi_csi0,(imx8dx-axcore-i2c-mipi-csi0.dts) and in the log (log-i2c-mipi-csi0.txt), I cannot find the port i2c_mipi_csi0. for my understanding, there should be another i2c@58226000 device besides i2c0, i2c1, i2c2, i2c3.
test2: MIPI_CSI0_I2C0_SCL and MIPI_CSI0_I2C0_SDA are configured as i2c0(imx8dx-axcore-i2c0.dts) and removed original i2c0 settings. In the log (log-i2c0.txt), I can find I/O expander pca953x 0-0020 in i2c0.
In our hardware design, i2c0 should be used as original settings(wm8904). So how to use i2c@58226000 in test1 configuration? thanks a lot
Li
our I/O expander is 99% compatible with pcal6416. the only difference is i2c write is 8-bit while pcal6416 is 16-bit. In device tree, I set I/O expander as pcal6416, and add patch to modify the register writing function in drivers\gpio\gpio-pca953x.c. After set MIPI_CSI0_I2C0_SCL & MIPI_CSI0_I2C0_SDA to i2c0, the expander address 0-0020 can be found, but still got i2c write error see below image. Now I am working on it. I attached my new dts file.
Check Wiring and Connections: Ensure that the SDA and SCL lines are correctly connected and there are no loose connections. Double-check the pin assignments in your device tree.
Verify I2C Address: Confirm that the I2C address set in the device tree matches the actual address of your I/O expander. Sometimes, addressing issues can cause write errors
Pull-up Resistors: Make sure that the SDA and SCL lines have appropriate pull-up resistors. Missing or incorrect pull-up resistors can lead to communication errors
Voltage Levels: Ensure that the voltage levels on the I2C bus are compatible with your devices. Mismatched voltage levels can cause write errors
Bus Speed: Check the I2C bus speed settings. If the bus speed is too high, it might cause communication issues. Try lowering the speed to see if it resolves the error
Patch Verification: Review the patch you added to modify the register writing function in drivers/gpio/gpio-pca953x.c
. Ensure that the changes correctly handle the 8-bit write operations for your I/O expander
Use a Logic Analyzer: If possible, use a logic analyzer to monitor the I2C communication. This can help you pinpoint where the error occurs and provide more insight into the issue
Hi Rita,
In u-boot, I set MIPI_CSI0_I2C0_SCL & MIPI_CSI0_I2C0_SDA to i2c0_cis0. see fsl-imx8qxp-axcore.dts. it was successful set i2c@58226000 as i2c bus 16. and it can read & write to I/O expander and EEPROM. and I caught the waveform, it matches the data.
the problem is I cannot find i2c@58226000 in kernel.
Best Regards
Li
Hi Team:
In my previous message, we can successful catch i2c signal in u-boot, but when MIPI_CSI0_I2C0_SCL and MIPI_CSI0_I2C0_SDA are configured as i2c_mipi_csi0,(imx8dx-axcore-i2c-mipi-csi0.dts) in linux-imx 5.10 and in defconfig, we cannot find the port i2c_mipi_csi0. I attached my dts and defconfig files again, and the hardware schematics can be found in previous messages. Could you help to check where I was wrong?
Very appreciate for your support!
Best Regards
Li
Hi @liaxxin ,
I will help check on our EVK Board when I back from our Labor holiday, I will back to office in the 7th May, I will help test then.
Wish you have a nice day
Best Regards
Rita
Hi Rita,
sure! Wish you have a good holiday!
Best Regards
Li
Hi Rita,
Hope everything goes well.
Did you test i2c_mipi_csi0 on your evk board? could you shall the defconfig and dts to me? and what is your kernel version number?
Best Regards
Li
Hi @liaxxin ,
I have test on our board in my hand, it works well:
I see your software I think it is OK. It maybe caused by the hardware problmem.
Here could you share me the full schematic.
I need to check your hardware design, you said"hardware design to use MIPI_CSI0_I2C0_SCL & MIPI_CSI0_I2C0_SDA to drive a mipi-csi sensor, and I/O expander, eeprom and ADC as well." You connect them all together in one board? or different board?
Wish you have a nice day
Best Regards
Rita
Hi Rita,
thanks for your support.
I found the problem: we need to enable at least one isi interface, after adding below in device tree, i2c_mipi_csi0 works.
+&isi_0 {
+ status = "okay";
+
+ port@0 {
+ isi_input: endpoint {
+ remote-endpoint = <&ar0234_mipi_ep>;
+ };
+ };
+ cap_device {
+ status = "okay";
+ };
+};
Hi @liaxxin ,
Great!! Good news it works. Thank you very much for sharing the root cause.
Wish you have a nice day
Best Regards
Rita
Hi Rita,
Thanks again for your support! Have a nice day!
Best Regards
Li
OK, I will help check it.