Hi Community,
I am developing ISP driver for Sony IMX678 4K sensor and inheriting from my previous IMX296 2Mpixels. For the IMX296, following setting works well :
mipi_csi0_ep: endpoint {
remote-endpoint = <&imx296_mipi_0_ep>;
data-lanes = <1>;
clock-lane = <0>;
csis-hs-settle = <13>;
csis-clk-settle = <2>;
csis-wclk;
};
For the IMX678 with 1440Mbps/lane, I set :
mipi_csi0_ep: endpoint {
remote-endpoint = <&imx678_mipi_0_ep>;
data-lanes = <2>;
clock-lane = <0>;
csis-hs-settle = <31>;
csis-clk-settle = <2>;
csis-wclk;
};
I received none of following events :
[ 106.507262] mxc-mipi-csi2.0: Frame End events: 0
[ 106.514692] mxc-mipi-csi2.0: Frame Start events: 0
[ 106.519483] mxc-mipi-csi2.0: Non-image data after odd frame events: 0
[ 106.525922] mxc-mipi-csi2.0: Non-image data before odd frame events: 0
[ 106.532448] mxc-mipi-csi2.0: Non-image data after even frame events: 0
[ 106.538974] mxc-mipi-csi2.0: Non-image data before even frame events: 0
[ 106.545586] mxc-mipi-csi2.0: Unknown Error events: 0
[ 106.550548] mxc-mipi-csi2.0: CRC Error events: 0
[ 106.555166] mxc-mipi-csi2.0: ECC Error events: 0
[ 106.559782] mxc-mipi-csi2.0: FIFO Overflow Error events: 0
[ 106.565264] mxc-mipi-csi2.0: Lost Frame End Error events: 0
[ 106.570836] mxc-mipi-csi2.0: Lost Frame Start Error events: 0
[ 106.576581] mxc-mipi-csi2.0: SOT Error events: 0
There's no MIPI clock during the streaming as well.
Checking the sensor's specification, it says :
The pixel signals are output by the CSI-2 High-speed serial interface.
See the MIPI Standard
- MIPI Alliance Standard for Camera Serial Interface 2 (CSI-2) v1.2
- MIPI Alliance Specification for D-PHY Version 1.2
So should I change csis-clk-settle to 0 for MIPI CSI-2 version 1.2 as mentioned in the following ticket https://community.nxp.com/t5/i-MX-Processors/How-to-compute-S-CLKSETTLECTL-value-for-MIPI-CSI-2-rece... ? And could it be the cause of nothing received on the CSI-Rx side?
Best Regards,
Khang
try to set data lanes to 4 and keep the csis-hs-settle to 13 or 16, refer to your log file, did your camera output interlaced video?
Hi @joanxie ,
Thanks for your suggestion, that might be a good idea but should high csis-hs-settle cause some problem to CSI-Rx ? As far as I know, Sony sensor such as IMX219 or IMX477 can work well with 2 mipi data-lanes anyway, so there would be no problem with IMX678 that I am using.
And how about csis-clk-settle regarding the MIPI-CSI2 v1.2 of the IMX678 sensor, please ?
Best regards,
Khang
refer to your sensor data, it seems csis-hs-settle = <31>; is too high, pls refer to the table as below and set the correct data
HI @joanxie ,
I was also asking for `csis-clk-settle` regarding the MIPI-CSI2 version of my sensor mainly.
Btw, do you mean that `csis-hs-settle=31` is too high for iMX8MP to handle because as I said the output of the selected mode of my sensor was 1440Mbps which is in the range of 1440~1410 (correspond to HS_SETTLE[7:0]=31) but you said csis-hs-settle=31 is not correct makes me confused about the table you provided.
Regards,
Khang.
this table is for serial clock, 1440MBPS you mentions isn't the serial clock, that's why I suggest that you try the lower value, you can try the 15 and test again
I understood that for my data-rate 1440Mbps/lane implies clock-rate 720MHz, then I also tried with csis-hs-settle=15 and csis-hs-settle=16 and neither worked.
From the following discussion : https://community.nxp.com/t5/i-MX-Processors/Explenation-for-HS-SETTLE-parameter-in-MIPI-CSI-D-PHY-r... with the answer of you colleague :
I understood differently : for clock freq 720MHz --> value in the table should 720 * 2 = 1440MHz then csis-hs-settle=31. What do you think?
Regards,
Khang
yes this depends on ddr mode, but according to my experience, it seems this table isn't correct enough, you may try the other value again
Hi @joanxie ,
I saw your advice about the `assign-clock-rates` for MIPI-CSI2 from following discussion : https://community.nxp.com/t5/i-MX-Processors/CSI-transfer-rates-and-limitations/m-p/995950
For being able to capture 4K, would it still be valid for the BSP-5.4.70-2.3.2 that I am using seeing the configuration of mipi_csi nodes are as below (arch/arm64/boot/dts/freescale/imx8mp.dtsi) :
mipi_csi_0: csi@32e40000 {
compatible = "fsl,imx8mp-mipi-csi", "fsl,imx8mn-mipi-csi";
reg = <0x32e40000 0x10000>;
interrupts = <GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>;
clock-frequency = <500000000>;
clocks = <&clk IMX8MP_CLK_MEDIA_CAM1_PIX>,
<&clk IMX8MP_CLK_MEDIA_AXI>,
<&clk IMX8MP_CLK_MEDIA_APB>;
clock-names = "mipi_clk", "disp_axi", "disp_apb";
assigned-clocks = <&clk IMX8MP_CLK_MEDIA_CAM1_PIX>;
assigned-clock-parents = <&clk IMX8MP_SYS_PLL2_1000M>;
assigned-clock-rates = <500000000>;
bus-width = <4>;
csi-gpr = <&mediamix_gasket0>;
gpr = <&mediamix_blk_ctl>;
no-reset-control;
power-domains = <&mipi_phy1_pd>;
status = "disabled";
};
mipi_csi_1: csi@32e50000 {
compatible = "fsl,imx8mp-mipi-csi", "fsl,imx8mn-mipi-csi";
reg = <0x32e50000 0x10000>;
interrupts = <GIC_SPI 80 IRQ_TYPE_LEVEL_HIGH>;
clock-frequency = <266000000>;
clocks = <&clk IMX8MP_CLK_MEDIA_CAM2_PIX>,
<&clk IMX8MP_CLK_MEDIA_AXI>,
<&clk IMX8MP_CLK_MEDIA_APB>;
clock-names = "mipi_clk", "disp_axi", "disp_apb";
assigned-clocks = <&clk IMX8MP_CLK_MEDIA_CAM2_PIX>;
assigned-clock-parents = <&clk IMX8MP_SYS_PLL1_266M>;
assigned-clock-rates = <266000000>;
bus-width = <4>;
csi-gpr = <&mediamix_gasket1>;
gpr = <&mediamix_blk_ctl>;
no-reset-control;
power-domains = <&mipi_phy2_pd>;
status = "disabled";
};
Thanks in advance and best regards,
Khang
Hi again,
With recommended values of registers of the selected mode (All-pixel scan, CSI-2_2lane, MCLK=74.25MHz, AD:10bit Output:10bit, 1440Mbps, Master Mode, LCG Mode, 25fps), I found that the default resolution was 3856x2180 while I'm expecting 3840x2160. I then updated the related registers of the sensor so that it outputs exactly 3840x2160 as someone in the following said that additional pixel(s) might hang the CSI-Rx on the SoC side: https://community.nxp.com/t5/i-MX-Processors/Creating-a-MIPI-CSI-Camera-driver-on-i-MX-8MP-EVK/m-p/1...
just for your information. I the meantime I got my sensor running. Indeed it was an issue of the image sensor configuration. It was outputting a few more pixels than expected. That reached to hang up the csi receiver.
However, there's still nothing happens (none of Unknown Error, CRC Error, ECC Error, FIFO Overflow Error, Lost Frame End Error, Lost Frame Start Error, SOT Error).
Could you give any advice ?
Thanks and best regards,
Khang
Hello Khang,
I am bringuping IMX678 and have the exact same issue.
The registers are properly preconfigured for 3840x2160 together with sensor start up sequence, but on CSI side I don't have any events.
Did you get any progress on your side?
Best Regards,
Konstantin.