Post Go back to editing

ADV7282-M with i.MX8M Mini not working

Hi

I'm trying to set up an ADV7282 Video Decoder with a iMX8M Mini Board. For that, I have enabled building of the ADV7180 driver in the Kernel (CONFIG_VIDEO_ADV7180=m) and changed the device tree for the ADV7282 Video Decoder.

My Device Tree:

&csi1_bridge {
	fsl,mipi-mode;
	status = "okay";
	port {
		csi1_ep: endpoint {
			remote-endpoint = <&csi1_mipi_ep>;
		};
	};
};

&i2c2 {
	clock-frequency = <100000>;
	pinctrl-names = "default", "gpio";
	pinctrl-0 = <&pinctrl_i2c2>;
	pinctrl-1 = <&pinctrl_i2c2_gpio>;
	scl-gpios = <&gpio5 16 GPIO_ACTIVE_HIGH>;
	sda-gpios = <&gpio5 17 GPIO_ACTIVE_HIGH>;
	status = "okay";

	adv728x_mipi1: adv728x_mipi1@21 {
		status = "okay";
		compatible = "adi,adv7282-m";
/*		compatible = "adv,adv7180";*/
		reg = <0x21>;
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_csi1>;
		clocks = <&clk IMX8MM_CLK_CLKO1>;
		clock-names = "csi_mclk";
/* Disabled CLKO2, since VAR-SOM-MX8M-MINI camera expansion board uses
 * its own oscillator. Enable CLK02 if your design requires it
 */
#if 0
		assigned-clocks = <&clk IMX8MM_CLK_CLKO1>;
		assigned-clock-parents = <&clk IMX8MM_CLK_24M>;
		assigned-clock-rates = <24000000>;
#endif
		csi_id = <0>;
/*
		pwn-gpios = <&gpio5 12 GPIO_ACTIVE_HIGH>;
		rst-gpios = <&gpio1 13 GPIO_ACTIVE_HIGH>;
*/
		mclk = <24000000>;
		mclk_source = <0>;
		cvbs = <1>;
		port {
			adv728x_mipi1_ep: endpoint {
				remote-endpoint = <&mipi1_sensor_ep>;
			};
		};
	};
};

&mipi_csi_1 {
	#address-cells = <1>;
	#size-cells = <0>;
	status = "okay";
	port {
		mipi1_sensor_ep: endpoint@1 {
			remote-endpoint = <&adv728x_mipi1_ep>;
			data-lanes = <1>;
			csis-hs-settle = <13>;
			csis-clk-settle = <2>;
			/*csis-wclk;*/
		};

		csi1_mipi_ep: endpoint@2 {
			remote-endpoint = <&csi1_ep>;
		};
	};
};

I have also added the following snippet to mipi_csis_formats in github.com/.../mxc_mipi_csi.c

, {
		.code = MEDIA_BUS_FMT_UYVY8_2X8,
		.fmt_reg = MIPI_CSIS_ISPCFG_DOUBLE_CMPNT | MIPI_CSIS_ISPCFG_FMT_YCBCR422_8BIT,
		.data_alignment = 16,
	}

It is initialized correctly

# dmesg | grep adv
[    5.663585] adv7180 1-0021: chip found @ 0x21 (30a30000.i2c)
[    5.793635] mxc_mipi-csi 32e30000.mipi_csi: Registered sensor subdevice: adv7180 1-0021

But capturing doesn't work. It doesn't get any data to capture.

# gst-launch-1.0 v4l2src device=/dev/video0 norm=PAL ! jpegenc ! avimux ! filesink location=mjpeg.avi
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock

  • Hi,

    I recommend you to enable dynamic debugging on the kernel and try to get more info out of the NXP MIPI capture subsystem.

    Using menuconfig "dynamic_debugging" and after that depending if you have the NXP MIPI drivers built as modules or builtin you can use something like:

    echo -n 'file imx8-isi-hw.c +p' > /sys/kernel/debug/dynamic_debug/control 
    echo -n 'file imx8-isi-cap.c +p' > /sys/kernel/debug/dynamic_debug/control
    echo -n 'file imx8-isi-core.c +p' > /sys/kernel/debug/dynamic_debug/control 
    echo -n 'file imx8-mipi-csi2-sam.c +p' > /sys/kernel/debug/dynamic_debug/control 
    echo -n 'file imx8-media-dev.c +p' > /sys/kernel/debug/dynamic_debug/control 
    echo -n 'file addicmos.c +p' > /sys/kernel/debug/dynamic_debug/control
    echo 2 > /sys/module/imx8_mipi_csi2_sam/parameters/debug

    Take care that's for I.MX8MP but you can find the equivalent drivers for I.MX8MM.

    If you get the subdevice registered that's a good sign and next you should try to debug why the NXP capture driver does not get the video frames.