tc358746 parallel to mipi problem

We have completed our hardware test. It seems the signal output of TC358746 CSI Tx mode is ok based on our test.
We have contacted local technical support of Toshiba for TC358746 MIPI CSI shipset. They provided a Excel datasheet
which allows us to input some basic parameters of camera and generated some values used for TC358746 registers.
We put those valuses into the registers and can read them back. So, these parameters for TC358746 seems ok.

We built up our driver based on the source code from OV5693, we made some modification.
Please see attached tc358746 driver source code.
But it is not working and we cannot capture video from our camera.

Please see attached V4L2 error report for error from V4L2 driver. We used the following command line:
v4l2-ctl -d /dev/video0 -w --verbose --set-fmt-video=width=1077,height=788,pixelformat=RGGB --set-ctrl bypass_mode=0 --stream-mmap --stream-count=1 --stream-to=test.

Please see attached nvgstcapture-1.0error1 and nvgstcapture-1.0error2 for errors found under nvgstcapture-1.0 command.

Device tree

#include <dt-bindings/media/camera.h>
#include <dt-bindings/platform/t210/t210.h>
#define CAM0_RST_L      TEGRA_GPIO(S, 4)
#define CAM0_PWDN       TEGRA_GPIO(S, 7)
#define CAM1_RST_L      TEGRA_GPIO(S, 5)
#define CAM1_PWDN       TEGRA_GPIO(T, 0)

/ {
	host1x {
                vi {
			num-channels = <6>;
                        ports {

				#address-cells = <1>;
                                #size-cells = <0>;
                                status = "okay";

                                vi_port0: port@0 {
                                        status = "okay";
					reg = <0x0>;
                                        vi_in0: endpoint {
                                                status = "okay";
                                                csi-port = <0>;
                                                bus-width = <2>;
                                                remote-endpoint = <&ov5693_out1>;
                                        };
                                };
                                vi_port1: port@1 {
                                        status = "okay";
					reg = <0x1>;
                                        vi_in1: endpoint {
                                                status = "okay";
						csi-port = <1>;
						bus-width = <2>;
                                                remote-endpoint = <&ov5693_out2>;
                                        };
                                };
                                vi_port2: port@2 {
                                        status = "okay";
					reg = <0x2>;
                                        vi_in2: endpoint {
                                                status = "okay";
						csi-port = <2>;
                                                bus-width = <2>;
                                                remote-endpoint = <&ov5693_out3>;
                                        };
                                };
				vi_port3: port@3 {
                                        status = "okay";
					reg = <0x3>;
                                        vi_in3: endpoint {
                                                status = "okay";
						csi-port = <3>;
                                                bus-width = <2>;
                                                remote-endpoint = <&ov5693_out4>;
                                        };
                                };
                                vi_port4: port@4 {
                                        status = "okay";
					reg = <0x4>;
                                        vi_in4: endpoint {
                                                status = "okay";
						csi-port = <4>;
                                                bus-width = <2>;
                                                remote-endpoint = <&ov5693_out5>;
                                        };
                                };
                                vi_port5: port@5 {
                                        status = "okay";
					reg = <0x5>;
                                        vi_in5: endpoint {
                                                status = "okay";
						csi-port = <5>;
                                                bus-width = <2>;
                                                remote-endpoint = <&ov5693_out6>;
                                        };
                                };
                        };
                };
				i2c@546c0000 {
							status = "okay";
							#address-cells = <1>;
							#size-cells = <0>;
					ov5693_p@e {
                                //compatible="nvidia,tc358746a";
                                compatible="nvidia,ov5693";
                                reset-gpios = <&gpio CAM0_RST_L GPIO_ACTIVE_HIGH>;
                                pwdn-gpios = <&gpio CAM0_PWDN GPIO_ACTIVE_HIGH>;
				vana-supply = <&en_vdd_cam_hv_2v8>;
                                vif-supply = <&en_vdd_cam>;
                                has-eeprom = <1>;
                                avdd-reg = "vana";
				sensor_model ="ov5693";
                                iovdd-reg = "vif";
				post_crop_frame_drop = "0";
                                status = "okay";
                                reg = <0xe>;
                                devnode = "video0";
                                physical_w = "3.674";
                                physical_h = "2.738";
				clocks = <&tegra_car TEGRA210_CLK_ID_CLK_OUT_3>;
                                clock-names = "mclk";
                                clock-frequency = <24000000>;
				mclk = "cam_mclk1";

				mode0 {
                                        mclk_khz = "24000";
                                        num_lanes = "2";
                                        tegra_sinterface = "serial_a";
                                        discontinuous_clk = "yes";
                                        dpcm_enable = "false";
                                        cil_settletime = "0";
                                        active_w = "1077";
                                        active_h = "788";
                                        pixel_t = "bayer_bggr";
                                        readout_orientation = "90";
                                        line_length = "1920";
                                        inherent_gain = "1";
                                        mclk_multiplier = "6.67";
                                        pix_clk_hz = "160000000";
                                        min_gain_val = "1.0";
                                        max_gain_val = "16";
                                        min_hdr_ratio = "1";
                                        max_hdr_ratio = "64";
                                        min_framerate = "1.816577";
                                        max_framerate = "30";
                                        min_exp_time = "34";
                                        max_exp_time = "550385";
					embedded_metadata_height = "0";

                                };

                                ports {
                                        #address-cells = <1>;
                                        #size-cells = <0>;
                                        port@0 {
                                                reg = <0>;
                                                ov5693_out1: endpoint {
                                                csi-port = <0>;
                                                bus-width = <2>;
                                                remote-endpoint = <&vi_in0>;
                                                };
                                                };
                                        };
				};
				};
	};
			i2c@7000c400 {
					status = "okay";
					#address-cells = <1>;
					#size-cells = <0>;
				tca9548@70 {
                                compatible = "nxp,pca9548";
                                reg = <0x70>;
                                #address-cells = <1>;
                                #size-cells = <0>;
                                vcc-supply = <&en_vdd_cam>;
                                skip_mux_detect;
				i2c@0 {
                                        reg = <0>;
                                        i2c-mux,deselect-on-exit;
                                        #address-cells = <1>;
                                        #size-cells = <0>;
				ov5640_p@48 {
                                //compatible="nvidia,tc358746a";
                                reset-gpios = <&gpio CAM0_RST_L GPIO_ACTIVE_HIGH>;
                                pwdn-gpios = <&gpio CAM0_PWDN GPIO_ACTIVE_HIGH>;
				vana-supply = <&en_vdd_cam_hv_2v8>;
                                vif-supply = <&en_vdd_cam>;
                                has-eeprom = <1>;
                                avdd-reg = "vana";
				sensor_model ="ov5693";
                                iovdd-reg = "vif";
				post_crop_frame_drop = "0";
                                status = "okay";
                                reg = <0x48>;
                                devnode = "video1";
                                physical_w = "3.674";
                                physical_h = "2.738";
				clocks = <&tegra_car TEGRA210_CLK_ID_CLK_OUT_3>;
                                clock-names = "mclk";
                                clock-frequency = <24000000>;
				mclk = "cam_mclk1";

				mode0 {
                                        mclk_khz = "24000";
                                        num_lanes = "2";
                                        tegra_sinterface = "serial_b";
                                        discontinuous_clk = "no";
                                        dpcm_enable = "false";
                                        cil_settletime = "0";
                                        //active_w = "2592";
                                        active_w = "1024";
                                        //active_h = "1944";
                                        active_h = "768";
                                        pixel_t = "bayer_bggr";
                                        readout_orientation = "90";
                                        line_length = "1024";
                                        inherent_gain = "1";
                                        //mclk_multiplier = "1.41";
                                        mclk_multiplier = "6.67";
                                        pix_clk_hz = "160000000";
                                        //pix_clk_hz = "33750000";
                                        min_gain_val = "1.0";
                                        max_gain_val = "16";
                                        min_hdr_ratio = "1";
                                        max_hdr_ratio = "64";
                                        min_framerate = "1.816577";
                                        max_framerate = "30";
                                        min_exp_time = "34";
                                        max_exp_time = "550385";
					embedded_metadata_height = "0";

                                };

                                ports {
                                        #address-cells = <1>;
                                        #size-cells = <0>;
                                        port@0 {
                                                reg = <0>;
                                                ov5693_out2: endpoint {
                                                csi-port = <1>;
                                                bus-width = <2>;
                                                remote-endpoint = <&vi_in1>;
                                                };
                                                };
                                        };
				};
			};
			 i2c@1 {
                                        reg = <1>;
                                        i2c-mux,deselect-on-exit;
                                        #address-cells = <1>;
                                        #size-cells = <0>;
                                ov5640_a@49 {
                                //compatible="nvidia,ov5693";
                                //compatible="nvidia,tc358746a";
                                reset-gpios = <&gpio CAM0_RST_L GPIO_ACTIVE_HIGH>;
                                pwdn-gpios = <&gpio CAM0_PWDN GPIO_ACTIVE_HIGH>;
				vana-supply = <&en_vdd_cam_hv_2v8>;
                                vif-supply = <&en_vdd_cam>;
                                has-eeprom = <1>;
                                avdd-reg = "vana";
				sensor_model ="ov5693";
                                iovdd-reg = "vif";
				post_crop_frame_drop = "0";
                                status = "okay";
                                reg = <0x49>;
                                devnode = "video2";
                                physical_w = "3.674";
                                physical_h = "2.738";
				clocks = <&tegra_car TEGRA210_CLK_ID_CLK_OUT_3>;
                                clock-names = "mclk";
                                clock-frequency = <24000000>;
				mclk = "cam_mclk1";

				mode0 {
                                        mclk_khz = "24000";
                                        num_lanes = "2";
                                        tegra_sinterface = "serial_c";
                                        discontinuous_clk = "no";
                                        dpcm_enable = "false";
                                        cil_settletime = "0";
                                        active_w = "2592";
                                        active_h = "1944";
                                        pixel_t = "bayer_bggr";
                                        readout_orientation = "90";
                                        line_length = "2688";
                                        inherent_gain = "1";
                                        mclk_multiplier = "6.67";
                                        pix_clk_hz = "160000000";
                                        min_gain_val = "1.0";
                                        max_gain_val = "16";
                                        min_hdr_ratio = "1";
                                        max_hdr_ratio = "64";
                                        min_framerate = "1.816577";
                                        max_framerate = "30";
                                        min_exp_time = "34";
                                        max_exp_time = "550385";
					embedded_metadata_height = "0";

                                };

                                ports {
                                        #address-cells = <1>;
                                        #size-cells = <0>;
                                        port@0 {
                                                reg = <0>;
                                                ov5693_out3: endpoint {
                                                csi-port = <2>;
                                                bus-width = <2>;
                                                remote-endpoint = <&vi_in2>;
                                                };
                                                };
                                        };
				};
			};
			i2c@2 {
                                        reg = <2>;
                                        i2c-mux,deselect-on-exit;
                                        #address-cells = <1>;
                                        #size-cells = <0>;
			ov5640_b@4a {
                                //compatible="nvidia,ov5693";
                               //compatible="nvidia,tc358746a";
                                reset-gpios = <&gpio CAM0_RST_L GPIO_ACTIVE_HIGH>;
                                pwdn-gpios = <&gpio CAM0_PWDN GPIO_ACTIVE_HIGH>;
				vana-supply = <&en_vdd_cam_hv_2v8>;
                                vif-supply = <&en_vdd_cam>;
                                has-eeprom = <1>;
                                avdd-reg = "vana";
				sensor_model ="ov5693";
                                iovdd-reg = "vif";
				post_crop_frame_drop = "0";
                                status = "okay";
                                reg = <0x4a>;
                                devnode = "video3";
                                physical_w = "3.674";
                                physical_h = "2.738";
				clocks = <&tegra_car TEGRA210_CLK_ID_CLK_OUT_3>;
                                clock-names = "mclk";
                                clock-frequency = <24000000>;
				mclk = "cam_mclk1";

				mode0 {
                                        mclk_khz = "24000";
                                        num_lanes = "2";
                                        tegra_sinterface = "serial_d";
                                        discontinuous_clk = "no";
                                        dpcm_enable = "false";
                                        cil_settletime = "0";
                                        active_w = "2592";
                                        active_h = "1944";
                                        pixel_t = "bayer_bggr";
                                        readout_orientation = "90";
                                        line_length = "2688";
                                        inherent_gain = "1";
                                        mclk_multiplier = "6.67";
                                        pix_clk_hz = "160000000";
                                        min_gain_val = "1.0";
                                        max_gain_val = "16";
                                        min_hdr_ratio = "1";
                                        max_hdr_ratio = "64";
                                        min_framerate = "1.816577";
                                        max_framerate = "30";
                                        min_exp_time = "34";
                                        max_exp_time = "550385";
					embedded_metadata_height = "0";

                                };

                                ports {
                                        #address-cells = <1>;
                                        #size-cells = <0>;
                                        port@0 {
                                                reg = <0>;
                                                ov5693_out4: endpoint {
                                                csi-port = <3>;
                                                bus-width = <2>;
                                                remote-endpoint = <&vi_in3>;
                                                };
                                                };
                                        };
				};
			};
			i2c@3 {
                                        reg = <3>;
                                        i2c-mux,deselect-on-exit;
                                        #address-cells = <1>;
                                        #size-cells = <0>;
			ov5640_c@4b {
                                //compatible="nvidia,ov5693";
                                //compatible="nvidia,tc358746a";
                                reset-gpios = <&gpio CAM0_RST_L GPIO_ACTIVE_HIGH>;
                                pwdn-gpios = <&gpio CAM0_PWDN GPIO_ACTIVE_HIGH>;
				vana-supply = <&en_vdd_cam_hv_2v8>;
                                vif-supply = <&en_vdd_cam>;
                                has-eeprom = <1>;
                                avdd-reg = "vana";
				sensor_model ="ov5693";
                                iovdd-reg = "vif";
				post_crop_frame_drop = "0";
                                status = "okay";
                                reg = <0x4b>;
                                devnode = "video4";
                                physical_w = "3.674";
                                physical_h = "2.738";
				clocks = <&tegra_car TEGRA210_CLK_ID_CLK_OUT_3>;
                                clock-names = "mclk";
                                clock-frequency = <24000000>;
				mclk = "cam_mclk1";

				mode0 {
                                        mclk_khz = "24000";
                                        num_lanes = "2";
                                        tegra_sinterface = "serial_e";
                                        discontinuous_clk = "no";
                                        dpcm_enable = "false";
                                        cil_settletime = "0";
                                        active_w = "2592";
                                        active_h = "1944";
                                        pixel_t = "bayer_bggr";
                                        readout_orientation = "90";
                                        line_length = "2688";
                                        inherent_gain = "1";
                                        mclk_multiplier = "6.67";
                                        pix_clk_hz = "160000000";
                                        min_gain_val = "1.0";
                                        max_gain_val = "16";
                                        min_hdr_ratio = "1";
                                        max_hdr_ratio = "64";
                                        min_framerate = "1.816577";
                                        max_framerate = "30";
                                        min_exp_time = "34";
                                        max_exp_time = "550385";
					embedded_metadata_height = "0";

                                };

                                ports {
                                        #address-cells = <1>;
                                        #size-cells = <0>;
                                        port@0 {
                                                reg = <0>;
                                                ov5693_out5: endpoint {
                                                csi-port = <4>;
                                                bus-width = <2>;
                                                remote-endpoint = <&vi_in4>;
                                                };
                                                };
                                        };
				};
			};
			 i2c@4 {
                                        reg = <4>;
                                        i2c-mux,deselect-on-exit;
                                        #address-cells = <1>;
                                        #size-cells = <0>;
			ov5640_d@20 {
                                //compatible="nvidia,ov5693";
                                //compatible="nvidia,tc358746a";
                                reset-gpios = <&gpio CAM0_RST_L GPIO_ACTIVE_HIGH>;
                                pwdn-gpios = <&gpio CAM0_PWDN GPIO_ACTIVE_HIGH>;
				vana-supply = <&en_vdd_cam_hv_2v8>;
                                vif-supply = <&en_vdd_cam>;
                                has-eeprom = <1>;
                                avdd-reg = "vana";
				sensor_model ="ov5693";
                                iovdd-reg = "vif";
				post_crop_frame_drop = "0";
                                status = "okay";
                                reg = <0x20>;
                                devnode = "video5";
                                physical_w = "3.674";
                                physical_h = "2.738";
				clocks = <&tegra_car TEGRA210_CLK_ID_CLK_OUT_3>;
                                clock-names = "mclk";
                                clock-frequency = <24000000>;
				mclk = "cam_mclk1";

				mode0 {
                                        mclk_khz = "24000";
                                        num_lanes = "2";
                                        tegra_sinterface = "serial_f";
                                        discontinuous_clk = "no";
                                        dpcm_enable = "false";
                                        cil_settletime = "0";
                                        active_w = "2592";
                                        active_h = "1944";
                                        pixel_t = "bayer_bggr";
                                        readout_orientation = "90";
                                        line_length = "2688";
                                        inherent_gain = "1";
                                        mclk_multiplier = "6.67";
                                        pix_clk_hz = "160000000";
                                        min_gain_val = "1.0";
                                        max_gain_val = "16";
                                        min_hdr_ratio = "1";
                                        max_hdr_ratio = "64";
                                        min_framerate = "1.816577";
                                        max_framerate = "30";
                                        min_exp_time = "34";
                                        max_exp_time = "550385";
					embedded_metadata_height = "0";

                                };

                                ports {
                                        #address-cells = <1>;
                                        #size-cells = <0>;
                                        port@0 {
                                                reg = <0>;
                                                ov5693_out6: endpoint {
                                                csi-port = <5>;
                                                bus-width = <2>;
                                                remote-endpoint = <&vi_in5>;
                                                };
                                                };
                                        };
				};
			};
			};
		};

		tegra-camera-platform {
                		compatible = "nvidia, tegra-camera-platform";
				num_csi_lanes = <12>;
                		max_lane_speed = <1500000>;
                		min_bits_per_pixel = <8>;
                		vi_peak_byte_per_pixel = <2>;
               			vi_bw_margin_pct = <25>;
               			max_pixel_rate = <160000>;
                		isp_peak_byte_per_pixel = <2>;
                		isp_bw_margin_pct = <25>;
                		modules {
                        	module0 {
                                status = "okay";
                                badge = "e3326_front_P5V27C";
                                position = "rear";
                                orientation = "1";
                                drivernode0 {
                                        status = "okay";
                                        pcl_id = "v4l2_sensor";
					devname = "ov5640 6-000e";
                                        proc-device-tree = "/proc/device-tree/host1x/i2c@546c0000/ov5693_p@e";
                                };
                                drivernode1 {
                                        status = "disable";
                                        pcl_id = "v4l2_focuser_stub";
					proc-device-tree = "";
                                };
                        };
				module1 {
                                status = "okay";
                                badge = "e3326_front_P5V27C";
                                position = "rear";
                                orientation = "1";
                                drivernode0 {
                                        status = "okay";
                                        pcl_id = "v4l2_sensor";
					devname = "ov5640 7-0048";
                                        proc-device-tree = "/proc/device-tree/i2c@7000c400/tca9548@70/i2c@0/ov5640_p@48";
                                };
                                drivernode1 {
                                        status = "disable";
                                        pcl_id = "v4l2_focuser_stub";
					proc-device-tree = "";
                                };
                        };
				module2 {
                                status = "okay";
                                badge = "e3326_front_P5V27C";
                                position = "rear";
                                orientation = "1";
                                drivernode0 {
                                        status = "okay";
                                        pcl_id = "v4l2_sensor";
					devname = "ov5640 7-0049";
                                        proc-device-tree = "/proc/device-tree/i2c@7000c400/tca9548@70/i2c@1/ov5640_a@49";
                                };
                                drivernode1 {
                                        status = "disable";
                                        pcl_id = "v4l2_focuser_stub";
					proc-device-tree = "";
                                };
                        };
				module3 {
                                status = "okay";
                                badge = "e3326_front_P5V27C";
                                position = "rear";
                                orientation = "1";
                                drivernode0 {
                                        status = "okay";
                                        pcl_id = "v4l2_sensor";
					devname = "ov5640 7-004a";
                                        proc-device-tree = "/proc/device-tree/i2c@7000c400/tca9548@70/i2c@2/ov5640_b@4a";
                                };
                                drivernode1 {
                                        status = "disable";
                                        pcl_id = "v4l2_focuser_stub";
					proc-device-tree = "";
                                };
                        };
				module4 {
                                status = "okay";
                                badge = "e3326_front_P5V27C";
                                position = "rear";
                                orientation = "1";
                                drivernode0 {
                                        status = "okay";
                                        pcl_id = "v4l2_sensor";
					devname = "ov5640 7-004b";
                                        proc-device-tree = "/proc/device-tree/i2c@7000c400/tca9548@70/i2c@3/ov5640_c@4b";
                                };
                                drivernode1 {
                                        status = "disable";
                                        pcl_id = "v4l2_focuser_stub";
					proc-device-tree = "";
                                };
                        };
				module5 {
                                status = "okay";
                                badge = "e3326_front_P5V27C";
                                position = "rear";
                                orientation = "1";
                                drivernode0 {
                                        status = "okay";
                                        pcl_id = "v4l2_sensor";
					devname = "ov5640 7-0020";
                                        proc-device-tree = "/proc/device-tree/i2c@7000c400/tca9548@70/i2c@4/ov5640_d@20";
                                };
                                drivernode1 {
                                        status = "disable";
                                        pcl_id = "v4l2_focuser_stub";
					proc-device-tree = "";
                                };
                        };

		};
		};
		gpio@6000d000 {
                camera-control {
                        gpio-output-low = <
                                CAM0_RST_L
                                CAM0_PWDN
				CAM1_RST_L
                                CAM1_PWDN
                                >;
                };
        };
};

oot@tegra-ubuntu:/home/ubuntu# v4l2-ctl -d /dev/video0 -w --verbose --set-fmt-video=width=1077,height=788,pixelformat=RGGB --set-ctrl bypass_mode=0 --stream-mmap --stream-count=1 --stream-to=test
VIDIOC_QUERYCAP: ok
VIDIOC_S_EXT_CTRLS: ok
VIDIOC_G_FMT: ok
VIDIOC_S_FMT: ok
Format Video Capture:
Width/Height : 1077/788
Pixel Format : ‘RGGB’
Field : None
Bytes per Line : 1088
Size Image : 857344
Colorspace : sRGB
Transfer Function : Default
YCbCr/HSV Encoding: Default
Quantization : Default
Flags :
VIDIOC_REQBUFS: ok
VIDIOC_QUERYBUF: ok
VIDIOC_QBUF: ok
VIDIOC_QUERYBUF: ok
VIDIOC_QBUF: ok
VIDIOC_QUERYBUF: ok
VIDIOC_QBUF: ok
VIDIOC_QUERYBUF: ok
VIDIOC_QBUF: ok
VIDIOC_STREAMON: ok
Index : 0
Type : Video Capture
Flags : mapped, done, error
Field : None
Sequence : 0
Length : 857344
Bytesused: 857344
Timestamp: 0.18446744073434681118s (Monotonic, End-of-Frame)

Index    : 1
Type     : Video Capture
Flags    : mapped, done, error
Field    : None
Sequence : 1
Length   : 857344
Bytesused: 857344
Timestamp: 0.18446744073434681118s (Monotonic, End-of-Frame)

Index    : 2
Type     : Video Capture
Flags    : mapped, done, error
Field    : None
Sequence : 2
Length   : 857344
Bytesused: 857344
Timestamp: 0.18446744073434681118s (Monotonic, End-of-Frame)

root@tegra-ubuntu:/home/ubuntu# v4l2-compliance
v4l2-compliance SHA : bbc257a21d0fa08c47dd24f4e563dd682a087ecc

Driver Info:
Driver name : tegra-video
Card type : vi-output-0, ov5693 6-000e
Bus info : platform:vi:0
Driver version: 3.10.96
Capabilities : 0x84200001
Video Capture
Streaming
Extended Pix Format
Device Capabilities
Device Caps : 0x04200001
Video Capture
Streaming
Extended Pix Format

Compliance test for device /dev/video0 (not using libv4l2):

Required ioctls:
test VIDIOC_QUERYCAP: OK

Allow for multiple opens:
test second video open: OK
test VIDIOC_QUERYCAP: OK
test VIDIOC_G/S_PRIORITY: OK
test for unlimited opens: OK

Debug ioctls:
test VIDIOC_DBG_G/S_REGISTER: OK (Not Supported)
test VIDIOC_LOG_STATUS: OK (Not Supported)

Input ioctls:
test VIDIOC_G/S_TUNER/ENUM_FREQ_BANDS: OK (Not Supported)
test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
test VIDIOC_S_HW_FREQ_SEEK: OK (Not Supported)
test VIDIOC_ENUMAUDIO: OK (Not Supported)
test VIDIOC_G/S/ENUMINPUT: OK
test VIDIOC_G/S_AUDIO: OK (Not Supported)
Inputs: 1 Audio Inputs: 0 Tuners: 0

Output ioctls:
test VIDIOC_G/S_MODULATOR: OK (Not Supported)
test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
test VIDIOC_ENUMAUDOUT: OK (Not Supported)
test VIDIOC_G/S/ENUMOUTPUT: OK (Not Supported)
test VIDIOC_G/S_AUDOUT: OK (Not Supported)
Outputs: 0 Audio Outputs: 0 Modulators: 0

Input/Output configuration ioctls:
test VIDIOC_ENUM/G/S/QUERY_STD: OK (Not Supported)
test VIDIOC_ENUM/G/S/QUERY_DV_TIMINGS: OK (Not Supported)
test VIDIOC_DV_TIMINGS_CAP: OK (Not Supported)
test VIDIOC_G/S_EDID: OK (Not Supported)

Test input 0:

Control ioctls:
	test VIDIOC_QUERY_EXT_CTRL/QUERYMENU: OK
	test VIDIOC_QUERYCTRL: OK
	test VIDIOC_G/S_CTRL: OK
	fail: v4l2-test-controls.cpp(624): did not check against size
	test VIDIOC_G/S/TRY_EXT_CTRLS: FAIL
	test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: OK
	test VIDIOC_G/S_JPEGCOMP: OK (Not Supported)
	Standard Controls: 1 Private Controls: 10

Format ioctls:
	test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: OK
	fail: v4l2-test-formats.cpp(1162): ret && node->has_frmintervals
	test VIDIOC_G/S_PARM: FAIL
	test VIDIOC_G_FBUF: OK (Not Supported)
	test VIDIOC_G_FMT: OK
	test VIDIOC_TRY_FMT: OK
	test VIDIOC_S_FMT: OK
	test VIDIOC_G_SLICED_VBI_CAP: OK (Not Supported)
	test Cropping: OK (Not Supported)
	test Composing: OK (Not Supported)
	test Scaling: OK (Not Supported)

Codec ioctls:
	test VIDIOC_(TRY_)ENCODER_CMD: OK (Not Supported)
	test VIDIOC_G_ENC_INDEX: OK (Not Supported)
	test VIDIOC_(TRY_)DECODER_CMD: OK (Not Supported)

Buffer ioctls:
	test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: OK
	test VIDIOC_EXPBUF: OK

Test input 0:

Total: 43, Succeeded: 41, Failed: 2, Warnings: 0

csi2_write:port 0 offset 0x00000218 val:0x00000000
[ 239.279240] vi vi: csi2_read:port 0 offset 0x000000d0
[ 239.279248] vi vi: csi2_write:port 0 offset 0x000000d0 val:0x00000001
[ 239.279540] ov5693 6-000e: ov5693_s_stream++
[ 239.279549] ov5693 6-000e: reset tc358746 chips
[ 239.280068] ov5693 6-000e: set tc358746 pclk
[ 239.281830] ov5693 6-000e: write tc358746 fifoctl
[ 239.282091] ov5693 6-000e: set tc358746 data format bayer
[ 239.282366] ov5693 6-000e: write tc358746 wordcnt
[ 239.282617] ov5693 6-000e: write tc358746 tx_dt
[ 239.282873] ov5693 6-000e: write tc358746 clkcntl
[ 239.283125] ov5693 6-000e: write tc358746 Mclk
[ 239.283375] ov5693 6-000e: gpio setting
[ 239.284223] ov5693 6-000e: Dphy clk lane and data lane enable
[ 239.285313] ov5693 6-000e: set tc358746 csi-tx-ppi
[ 239.288740] ov5693 6-000e: set tc358746 confctl register
[ 239.289221] ov5693 6-000e: TX func is busy
[ 239.289227] ov5693 6-000e: ov5693_s_stream–
[ 239.290520] host1x host1x: no_interruptible
[ 239.482374] video4linux video0: frame start syncpt timeout!0
[ 239.488793] vi vi: TEGRA_CSI_PIXEL_PARSER_STATUS 0x00000000
[ 239.488885] vi vi: TEGRA_CSI_CIL_STATUS 0x00000010
[ 239.488957] vi vi: TEGRA_CSI_CILX_STATUS 0x00040040
[ 239.489025] vi vi: TEGRA_CSI_DEBUG_COUNTER_0 0x00000000
[ 239.489093] vi vi: TEGRA_CSI_DEBUG_COUNTER_1 0x00000000
[ 239.489157] vi vi: TEGRA_CSI_DEBUG_COUNTER_2 0x00000000
[ 239.489240] vi vi: csi2_write:port 0 offset 0x00000214 val:0x00000001
[ 239.489513] vi vi: csi2_write:port 0 offset 0x00000214 val:0x00000000
[ 239.489616] vi vi: csi2_write:port 0 offset 0x00000218 val:0x00000000
[ 239.489698] vi vi: csi2_read:port 0 offset 0x000000d0
[ 239.489769] vi vi: csi2_write:port 0 offset 0x000000d0 val:0x00000001
[ 239.497155] host1x host1x: no_interruptible
[ 239.692181] video4linux video0: frame start syncpt timeout!0
[ 239.698261] vi vi: TEGRA_CSI_PIXEL_PARSER_STATUS 0x00000000
[ 239.698345] vi vi: TEGRA_CSI_CIL_STATUS 0x00000010
[ 239.698414] vi vi: TEGRA_CSI_CILX_STATUS 0x00040040
[ 239.698484] vi vi: TEGRA_CSI_DEBUG_COUNTER_0 0x00000000
[ 239.698550] vi vi: TEGRA_CSI_DEBUG_COUNTER_1 0x00000000
[ 239.698610] vi vi: TEGRA_CSI_DEBUG_COUNTER_2 0x00000000
[ 239.698694] vi vi: csi2_write:port 0 offset 0x00000214 val:0x00000001
[ 239.698995] vi vi: csi2_write:port 0 offset 0x00000214 val:0x00000000
[ 239.699095] vi vi: csi2_write:port 0 offset 0x00000218 val:0x00000000
[ 239.699173] vi vi: csi2_read:port 0 offset 0x000000d0
[ 239.699247] vi vi: csi2_write:port 0 offset 0x000000d0 val:0x00000001
[ 239.705740] host1x host1x: no_interruptible
[ 239.902336] video4linux video0: frame start syncpt timeout!0
[ 239.908168] vi vi: TEGRA_CSI_PIXEL_PARSER_STATUS 0x00000000
[ 239.908251] vi vi: TEGRA_CSI_CIL_STATUS 0x00000010
[ 239.908320] vi vi: TEGRA_CSI_CILX_STATUS 0x00040040
[ 239.908389] vi vi: TEGRA_CSI_DEBUG_COUNTER_0 0x00000000
[ 239.908458] vi vi: TEGRA_CSI_DEBUG_COUNTER_1 0x00000000
[ 239.908520] vi vi: TEGRA_CSI_DEBUG_COUNTER_2 0x00000000
[ 239.908599] vi vi: csi2_write:port 0 offset 0x00000214 val:0x00000001
[ 239.908892] vi vi: csi2_write:port 0 offset 0x00000214 val:0x00000000
[ 239.908997] vi vi: csi2_write:port 0 offset 0x00000218 val:0x00000000
[ 239.909076] vi vi: csi2_read:port 0 offset 0x000000d0
[ 239.909149] vi vi: csi2_write:port 0 offset 0x000000d0 val:0x00000001
[ 239.914823] host1x host1x: no_interruptible
[ 240.111940] video4linux video0: frame start syncpt timeout!0
[ 240.118376] vi vi: TEGRA_CSI_PIXEL_PARSER_STATUS 0x00000000
[ 240.118474] vi vi: TEGRA_CSI_CIL_STATUS 0x00000010
[ 240.118545] vi vi: TEGRA_CSI_CILX_STATUS 0x00040040
[ 240.118614] vi vi: TEGRA_CSI_DEBUG_COUNTER_0 0x00000000
[ 240.118679] vi vi: TEGRA_CSI_DEBUG_COUNTER_1 0x00000000
[ 240.118741] vi vi: TEGRA_CSI_DEBUG_COUNTER_2 0x00000000
[ 240.118821] vi vi: csi2_write:port 0 offset 0x00000214 val:0x00000001
[ 240.119129] vi vi: csi2_write:port 0 offset 0x00000214 val:0x00000000
[ 240.119235] vi vi: csi2_write:port 0 offset 0x00000218 val:0x00000000
[ 240.119315] vi vi: csi2_read:port 0 offset 0x000000d0
[ 240.119389] vi vi: csi2_write:port 0 offset 0x000000d0 val:0x00000001
[ 240.125166] host1x host1x: no_interruptible
[ 240.322996] video4linux video0: frame start syncpt timeout!0
[ 240.328829] vi vi: TEGRA_CSI_PIXEL_PARSER_STATUS 0x00000000
[ 240.328910] vi vi: TEGRA_CSI_CIL_STATUS 0x00000010
[ 240.328982] vi vi: TEGRA_CSI_CILX_STATUS 0x00040040
[ 240.329050] vi vi: TEGRA_CSI_DEBUG_COUNTER_0 0x00000000
[ 240.329114] vi vi: TEGRA_CSI_DEBUG_COUNTER_1 0x00000000
[ 240.329175] vi vi: TEGRA_CSI_DEBUG_COUNTER_2 0x00000000
[ 240.329258] vi vi: csi2_write:port 0 offset 0x00000214 val:0x00000001
[ 240.329558] vi vi: csi2_write:port 0 offset 0x00000214 val:0x00000000
[ 240.329660] vi vi: csi2_write:port 0 offset 0x00000218 val:0x00000000
[ 240.329744] vi vi: csi2_read:port 0 offset 0x000000d0
[ 240.329827] vi vi: csi2_write:port 0 offset 0x000000d0 val:0x00000001
[ 240.335633] host1x host1x: no_interruptible
[ 240.532209] video4linux video0: frame start syncpt timeout!0
[ 240.538671] vi vi: TEGRA_CSI_PIXEL_PARSER_STATUS 0x00000000
[ 240.538769] vi vi: TEGRA_CSI_CIL_STATUS 0x00000010
[ 240.538843] vi vi: TEGRA_CSI_CILX_STATUS 0x00040040
[ 240.538910] vi vi: TEGRA_CSI_DEBUG_COUNTER_0 0x00000000
[ 240.538977] vi vi: TEGRA_CSI_DEBUG_COUNTER_1 0x00000000
[ 240.539043] vi vi: TEGRA_CSI_DEBUG_COUNTER_2 0x00000000
[ 240.539126] vi vi: csi2_write:port 0 offset 0x00000214 val:0x00000001
[ 240.539436] vi vi: csi2_write:port 0 offset 0x00000214 val:0x00000000
[ 240.539541] vi vi: csi2_write:port 0 offset 0x00000218 val:0x00000000
[ 240.539619] vi vi: csi2_read:port 0 offset 0x000000d0
[ 240.539691] vi vi: csi2_write:port 0 offset 0x000000d0 val:0x00000001
[ 240.545459] host1x host1x: no_interruptible
[ 240.742357] video4linux video0: frame start syncpt timeout!0
[ 240.748800] vi vi: TEGRA_CSI_PIXEL_PARSER_STATUS 0x00000000
[ 240.748891] vi vi: TEGRA_CSI_CIL_STATUS 0x00000010
[ 240.748957] vi vi: TEGRA_CSI_CILX_STATUS 0x00040040
[ 240.749027] vi vi: TEGRA_CSI_DEBUG_COUNTER_0 0x00000000
[ 240.749094] vi vi: TEGRA_CSI_DEBUG_COUNTER_1 0x00000000
[ 240.749155] vi vi: TEGRA_CSI_DEBUG_COUNTER_2 0x00000000
[ 240.749239] vi vi: csi2_write:port 0 offset 0x00000214 val:0x00000001
[ 240.749544] vi vi: csi2_write:port 0 offset 0x00000214 val:0x00000000
[ 240.749648] vi vi: csi2_write:port 0 offset 0x00000218 val:0x00000000
[ 240.749723] vi vi: csi2_read:port 0 offset 0x000000d0
[ 240.749793] vi vi: csi2_write:port 0 offset 0x000000d0 val:0x00000001
[ 240.755431] host1x host1x: no_interruptible
[ 240.952177] video4linux video0: frame start syncpt timeout!0
[ 240.958010] vi vi: TEGRA_CSI_PIXEL_PARSER_STATUS 0x00000000
[ 240.958089] vi vi: TEGRA_CSI_CIL_STATUS 0x00000010
[ 240.958157] vi vi: TEGRA_CSI_CILX_STATUS 0x00040040
[ 240.958225] vi vi: TEGRA_CSI_DEBUG_COUNTER_0 0x00000000
[ 240.958288] vi vi: TEGRA_CSI_DEBUG_COUNTER_1 0x00000000
[ 240.958349] vi vi: TEGRA_CSI_DEBUG_COUNTER_2 0x00000000
[ 240.958431] vi vi: csi2_write:port 0 offset 0x00000214 val:0x00000001
[ 240.958729] vi vi: csi2_write:port 0 offset 0x00000214 val:0x00000000
[ 240.958832] vi vi: csi2_write:port 0 offset 0x00000218 val:0x00000000
[ 240.958910] vi vi: csi2_read:port 0 offset 0x000000d0
[ 240.958982] vi vi: csi2_write:port 0 offset 0x000000d0 val:0x00000001
[ 240.959777] ov5693 6-000e: ov5693_s_stream++
[ 240.959850] ov5693 6-000e: reset tc358746 chips
[ 240.961219] ov5693 6-000e: set tc358746 pclk
[ 240.965221] ov5693 6-000e: write tc358746 fifoctl
[ 240.965791] ov5693 6-000e: set tc358746 data format bayer
[ 240.966320] ov5693 6-000e: write tc358746 wordcnt
[ 240.966855] ov5693 6-000e: write tc358746 tx_dt
[ 240.967374] ov5693 6-000e: write tc358746 clkcntl
[ 240.967888] ov5693 6-000e: write tc358746 Mclk
[ 240.968404] ov5693 6-000e: gpio setting
[ 240.970204] ov5693 6-000e: Dphy clk lane and data lane enable
[ 240.972762] ov5693 6-000e: set tc358746 csi-tx-ppi
[ 240.979809] ov5693 6-000e: set tc358746 confctl register
[ 240.980845] ov5693 6-000e: TX func is busy
[ 240.980917] ov5693 6-000e: ov5693_s_stream–

I think you can find the status REG from the TRM.
From the log it’s could be the mipi signal not match the mipi spec. You may need to probe the mipi signal it’s mipi compliance.

[ 239.488885] vi vi: TEGRA_CSI_CIL_STATUS 0x00000010
[ 239.488957] vi vi: TEGRA_CSI_CILX_STATUS 0x00040040

Hi shaneccc,
We capture the clk and data lane signal by scope.
TLPX =64ns THS = 64ns THS-ZERO = 200ns CSI-CLK=187.5MHz

mode0 {
mclk_khz = “24000”;
num_lanes = “2”;
tegra_sinterface = “serial_a”;
discontinuous_clk = “no”;
dpcm_enable = “false”;
cil_settletime = “0”;
active_w = “1024”;
active_h = “768”;
pixel_t = “bayer_bggr”;
readout_orientation = “90”;
line_length = “1920”;
inherent_gain = “1”;
mclk_multiplier = “1.125”;
pix_clk_hz = “33750000”;
min_gain_val = “3.0”;
max_gain_val = “12”;
min_hdr_ratio = “1”;
max_hdr_ratio = “64”;
min_framerate = “1.816577”;
max_framerate = “30”;
min_exp_time = “34”;
max_exp_time = “550385”;
embedded_metadata_height = “0”;

                            };

How do I set " pix_clk_hz"? Our sensor output clk is 33.75Mhz.That’s why I set " pix_clk_hz" as this value. And how do I set CSI-CLK frequency?

TLPX.jpg
one_line.jpg
THS.jpg
THS-ZERO.jpg

TLPX.jpg

one_line.jpg

THS.jpg

THS-ZERO.jpg

please see attachment.





Does it means tx1 csi channel does not receive any MIPI package according to attachment Vn-Vp.jpg?
Base on TOCHIBA engineer discussion,TX1 MIPI lane does not set any terminal resistance.How set TX1 MIPI compatible TC358746 timing?

Hi Le0Nard0,

Could you share the Excel datasheet and driver code, which allows us to input some basic parameters of camera and generated some values used for TC358746 registers. I am debugging this IC for TX1 now.

My email address is cloundliu@163.com

thanks

@Le0Nard0
Does the sensor output as continuous mode? Could you try discontinuous mode.

We have several toshiba chips working with TX1, let us know if you require additional help.

-David

Hi, David!
Did you work with tc358746 or tc358748?
Could you, please, provide drivers for 48 or, if not, for 46.

I have some problems with starting tc358748 to work in Parallel -> CSI mode.

Hi, there is one open source for i.MX6 and TC358743 here I think: https://github.com/boundarydevices/linux-imx6. RidgeRun has for:

https://developer.ridgerun.com/wiki/index.php?title=Toshiba_TC358743_Linux_driver_for_Tegra_X1
https://developer.ridgerun.com/wiki/index.php?title=Toshiba_TC358840_Linux_driver_for_Tegra_X1

and is creating one for TC358746, however, I can’t share the code for those, for more info please contact us: http://www.ridgerun.com/contact

Thank you!
Wrote to you to http://www.ridgerun.com/contact