Hello,
i am currently working on a custom board project in which i am using a toshiba tc358743 HDMI to MIPI CSI converter ic in order to capture the incoming data with the imx8mm.
I am able to establish a stable stream on a single lane with 800x600@60Hz. However, if i try higher resolutions for which the driver increases the number of lanes that have to be used the received image is corrupted.
The statistics data of the mipi csi show no CRC or ECC errors and all frames seem to be received properly.
I tried several days playing around with different flags and tried all patches and suggestions i could find in the forum but i never got it to work with more than a single lane.
I am using the tc358743 from the codeaura linux-imx 5-10 kernel
https://source.codeaurora.org/external/imx/linux-imx/tree/?h=lf-5.10.y
For mipi and csi I am using the staging dir media drivers imx7_mipi_csis and imx7_media_csi.
This is the devicetree configuration:
/ {
tc358743_clk: tc358743_clk {
#clock-cells = <0>;
compatible = "fixed-clock";
clock-frequency = <27000000>;
status = "okay";
};
reg_mipi_1p0: regulator-mipi-1p0 {
compatible = "regulator-fixed";
regulator-name = "mipi_1p0";
regulator-min-microvolt = <1000000>;
regulator-max-microvolt = <1000000>;
};
};
&i2c2 {
tc358743_dvi: tc358743@f {
compatible = "toshiba,tc358743";
reg = <0x0f>;
clocks = <&tc358743_clk>;
clock-names = "refclk";
port@0 {
reg = <0>;
tc358743_out: endpoint {
remote-endpoint = <&mipi_csi2_in>;
data-lanes = <1 2 3 4>;
clock-lanes = <0>;
/*clock-noncontinuous;*/
link-frequencies = /bits/ 64 <297000000>;
};
};
};
};
&csi1_bridge {
dma-coherent;
status = "okay";
port {
csi1_ep: endpoint {
remote-endpoint = <&csi1_mipi_ep>;
};
};
};
&mipi_csi_1 {
#address-cells = <1>;
#size-cells = <0>;
status = "okay";
phy-supply = <®_mipi_1p0>;
fsl,csis-hs-settle = <6>; /* 13 */
fsl,csis-clk-settle = <0>;
clock-frequency = <333000000>;
/*clock-noncontinuous;*/
port@0 {
reg = <0>;
mipi_csi2_in: endpoint {
remote-endpoint = <&tc358743_out>;
data-lanes = <1 2>;
clock-lanes = <0>;
/*clock-noncontinuous;*/
};
};
port@1 {
reg = <1>;
csi1_mipi_ep: endpoint {
remote-endpoint = <&csi1_ep>;
};
};
};
media-ctl output
root@imx8mm:~> media-ctl -p
Media controller API version 5.10.9
Media device information
------------------------
driver imx7-csi
model imx-media
serial
bus info
hw revision 0x0
driver version 5.10.9
Device topology
- entity 1: csi (2 pads, 2 links)
type V4L2 subdev subtype Unknown flags 0
device node name /dev/v4l-subdev0
pad0: Sink
[fmt:UYVY8_2X8/1024x768 field:none colorspace:smpte170m xfer:709 ycbcr:601 quantization:lim-range]
<- "imx7-mipi-csis.0":1 [ENABLED]
pad1: Source
[fmt:UYVY8_2X8/1024x768 field:none colorspace:smpte170m xfer:709 ycbcr:601 quantization:lim-range]
-> "csi capture":0 [ENABLED]
- entity 4: csi capture (1 pad, 1 link)
type Node subtype V4L flags 0
device node name /dev/video0
pad0: Sink
<- "csi":1 [ENABLED]
- entity 10: imx7-mipi-csis.0 (2 pads, 2 links)
type V4L2 subdev subtype Unknown flags 0
device node name /dev/v4l-subdev1
pad0: Sink
[fmt:UYVY8_2X8/1024x768 field:none colorspace:smpte170m xfer:709 ycbcr:601 quantization:lim-range]
<- "tc358743 1-000f":0 [ENABLED]
pad1: Source
[fmt:UYVY8_2X8/1024x768 field:none colorspace:smpte170m xfer:709 ycbcr:601 quantization:lim-range]
-> "csi":0 [ENABLED]
- entity 15: tc358743 1-000f (1 pad, 1 link)
type V4L2 subdev subtype Unknown flags 0
device node name /dev/v4l-subdev2
pad0: Source
[fmt:UYVY8_2X8/1024x768 field:none colorspace:smpte170m]
[dv.caps:BT.656/1120 min:640x350@13000000 max:1920x1200@165000000 stds:CEA-861,DMT,CVT,GTF caps:progressive,reduced-blanking,custom]
[dv.detect:BT.656/1120 1024x768p60 (1344x798) stds: flags:]
[dv.current:BT.656/1120 1024x768p60 (1344x798) stds: flags:]
-> "imx7-mipi-csis.0":0 [ENABLED]
stream
root@imx8mm:~> v4l2-ctl --device /dev/video0 --stream-mmap --set-fmt-video=pixelformat=UYVY --stream-to=/tmp/testbild_2-lane_1024x768.yuv --stream-count=1 --verbose
VIDIOC_QUERYCAP: ok
VIDIOC_G_FMT: ok
VIDIOC_S_FMT: ok
Format Video Capture:
Width/Height : 1024/768
Pixel Format : 'UYVY' (UYVY 4:2:2)
Field : None
Bytes per Line : 2048
Size Image : 1572864
Colorspace : SMPTE 170M
Transfer Function : Rec. 709
YCbCr/HSV Encoding: ITU-R 601
Quantization : Limited Range
Flags :
VIDIOC_REQBUFS returned 0 (Success)
VIDIOC_QUERYBUF returned 0 (Success)
VIDIOC_QUERYBUF returned 0 (Success)
VIDIOC_QUERYBUF returned 0 (Success)
VIDIOC_QUERYBUF returned 0 (Success)
VIDIOC_QBUF returned 0 (Success)
VIDIOC_QBUF returned 0 (Success)
VIDIOC_QBUF returned 0 (Success)
VIDIOC_QBUF returned 0 (Success)
VIDIOC_STREAMON returned 0 (Success)
cap dqbuf: 0 seq: 0 bytesused: 1572864 ts: 40.679512 delta: 40679.512 ms (ts-monotonic, ts-src-eof)
This is a grabbed image from 800x600@60 over 1-lane which looks perfect.

This is a grabbed image with 1024x768@60 over 2-lane which looks distorted and vertically strechted.

This is a grabbed image with 1920x1080@60 over 4-lane which looks heavily distorted.

Maybe somebody got a hint what i could try to resolve the problem or point me in the right direction.
Best Regards,
Thomas