<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>i.MX ProcessorsのトピックRe: iMX8QM MIPI CSI2 virtual channel setting</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/iMX8QM-MIPI-CSI2-virtual-channel-setting/m-p/1734124#M213592</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/102266"&gt;@aso&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;I hope you are doing well.&lt;/P&gt;
&lt;P&gt;There seem to be redundant nodes of&amp;nbsp;mipi_csi_0 in shared dts.&lt;/P&gt;
&lt;P&gt;It looks like virtual channels are hardcoded to 1 or 4 in&amp;nbsp;imx8-media-dev.c driver.&lt;/P&gt;
&lt;P&gt;mipi_vc = (mipi_csi2-&amp;gt;vchannel) ? &lt;STRONG&gt;4&lt;/STRONG&gt; : 1;&lt;/P&gt;
&lt;P&gt;One can try changing it in&lt;A href="https://github.com/nxp-imx/linux-imx/blob/lf-6.1.y/drivers/staging/media/imx/imx8-media-dev.c#L525C1-L526C1" target="_self"&gt;&amp;nbsp;/drivers/staging/media/imx/imx8-media-dev.c&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Thanks &amp;amp; Regards,&lt;BR /&gt;Dhruvit Vasavada&lt;/P&gt;</description>
    <pubDate>Thu, 05 Oct 2023 08:58:33 GMT</pubDate>
    <dc:creator>Dhruvit</dc:creator>
    <dc:date>2023-10-05T08:58:33Z</dc:date>
    <item>
      <title>iMX8QM MIPI CSI2 virtual channel setting</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/iMX8QM-MIPI-CSI2-virtual-channel-setting/m-p/1731714#M213370</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hello Community!&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&lt;/SPAN&gt;I am developing an ISP board that connects to iMX8QM MEK.&lt;BR /&gt;The hardware configuration diagram is below.&lt;BR /&gt;The software is Linux 6.1.22, and the sensor driver is created based on gmsl-max9286.c.&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="WS000000.JPG" style="width: 630px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/243219i2DC2BA3A02C93D65/image-size/large?v=v2&amp;amp;px=999" role="button" title="WS000000.JPG" alt="WS000000.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now I get an exception when starting Linux.&lt;BR /&gt;The sensor board outputs virtual channel 2ch via MIPI, and I have an inquiry regarding the kernel 2ch settings.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;[ question 1 ]&lt;/STRONG&gt;&lt;BR /&gt;I changed the kernel dts and sensor driver as shown below, but are there any mistakes in the settings?&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;dts:&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;&amp;amp;isi_0 {
	status = "okay";

	cap_device {
		status = "okay";
	};

	m2m_device {
		status = "okay";
	};
};

&amp;amp;isi_1 {
	status = "okay";

	cap_device {
		status = "okay";
	};
};

&amp;amp;isi_2 {
	status = "disabled";		//[sdi] to disabled

	cap_device {
		status = "disabled";	//[sdi] to disabled
	};
};

&amp;amp;isi_3 {
	status = "disabled";		//[sdi] to disabled

	cap_device {
		status = "disabled";	//[sdi] to disabled
	};
};

&amp;amp;isi_4 {
	status = "disabled";		//[sdi] to disabled

	cap_device {
		status = "disabled";	//[sdi] to disabled
	};
};

&amp;amp;isi_5 {
	status = "disabled";		//[sdi] to disabled

	cap_device {
		status = "disabled";	//[sdi] to disabled
	};
};

&amp;amp;isi_6 {
	status = "disabled";		//[sdi] to disabled

	cap_device {
		status = "disabled";	//[sdi] to disabled
	};
};

&amp;amp;isi_7 {
	status = "disabled";		//[sdi] to disabled

	cap_device {
		status = "disabled";	//[sdi] to disabled
	};
};

&amp;amp;mipi_csi_0 {
	#address-cells = &amp;lt;1&amp;gt;;
	#size-cells = &amp;lt;0&amp;gt;;
	virtual-channel;
	status = "okay";

	/* Camera 0  MIPI CSI-2 (CSIS0) */
	port@0 {
		reg = &amp;lt;0&amp;gt;;
		mipi_csi0_ep: endpoint {
			remote-endpoint = &amp;lt;&amp;amp;max9286_0_ep&amp;gt;;
			data-lanes = &amp;lt;1 2 3 4&amp;gt;;
		};
	};
};

&amp;amp;i2c_mipi_csi0 {
	#address-cells = &amp;lt;1&amp;gt;;
	#size-cells = &amp;lt;0&amp;gt;;
	pinctrl-names = "default";
	pinctrl-0 = &amp;lt;&amp;amp;pinctrl_i2c_mipi_csi0&amp;gt;;
	clock-frequency = &amp;lt;100000&amp;gt;;
	status = "okay";

	max9286_mipi@6a {
		compatible = "sdi,isp_mipi";
		reg = &amp;lt;0x6a&amp;gt;;
		pinctrl-names = "default";
		pinctrl-0 = &amp;lt;&amp;amp;pinctrl_mipi_csi0&amp;gt;;
		clocks = &amp;lt;&amp;amp;clk_dummy&amp;gt;;
		clock-names = "capture_mclk";
		mclk = &amp;lt;27000000&amp;gt;;
		mclk_source = &amp;lt;0&amp;gt;;
		pwn-gpios = &amp;lt;&amp;amp;lsio_gpio1 27 GPIO_ACTIVE_HIGH&amp;gt;;
		virtual-channel;
		status = "okay";
		port {
			max9286_0_ep: endpoint {
				remote-endpoint = &amp;lt;&amp;amp;mipi_csi0_ep&amp;gt;;
				data-lanes = &amp;lt;1 2 3 4&amp;gt;;
			};
		};
	};
};&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;senser driver probe function：&lt;/STRONG&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;#define MIPI_CSI2_SENS_VC0_PAD_SOURCE	0
#define MIPI_CSI2_SENS_VC1_PAD_SOURCE	1
#define MIPI_CSI2_SENS_VC2_PAD_SOURCE	2
#define MIPI_CSI2_SENS_VCX_PADS_NUM		2

struct sensor_data {
		:
	struct media_pad pads[MIPI_CSI2_SENS_VCX_PADS_NUM];
		:
}

sd-&amp;gt;flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
sd-&amp;gt;entity.function = MEDIA_ENT_F_CAM_SENSOR;
max9286_data-&amp;gt;pads[MIPI_CSI2_SENS_VC0_PAD_SOURCE].flags = MEDIA_PAD_FL_SOURCE;
max9286_data-&amp;gt;pads[MIPI_CSI2_SENS_VC1_PAD_SOURCE].flags = MEDIA_PAD_FL_SOURCE;
retval = media_entity_pads_init(&amp;amp;sd-&amp;gt;entity, MIPI_CSI2_SENS_VCX_PADS_NUM, max9286_data-&amp;gt;pads);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Linux dmesg:&lt;/STRONG&gt;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;[    2.428771] isp_mipi 2-006a: isp_mipi is found, name isp_mipi 2-006a

[   10.169351] imx8_media_dev: module is from the staging directory, the quality is unknown, you have been warned.
[   10.196793] mx8-img-md: Registered mxc_isi.0.capture as /dev/video3
[   10.214497] mx8-img-md: Registered mxc_isi.1.capture as /dev/video4
[   10.221031] mx8-img-md: Registered sensor subdevice: isp_mipi_cam 2-006a (1)
[   10.241443] mx8-img-md: created link [mxc_isi.0] =&amp;gt; [mxc_isi.0.capture]
[   10.285198] mx8-img-md: created link [mxc-mipi-csi2.0] =&amp;gt; [mxc_isi.0]
[   10.304164] mx8-img-md: created link [mxc_isi.1] =&amp;gt; [mxc_isi.1.capture]
[   10.323244] mx8-img-md: created link [mxc-mipi-csi2.0] =&amp;gt; [mxc_isi.1]
[   10.364732] ------------[ cut here ]------------
[   10.369366] WARNING: CPU: 0 PID: 337 at drivers/media/mc/mc-entity.c:1021 media_create_pad_link+0x8c/0x220
[   10.379044] Modules linked in: flexcan(+) can_dev snd_soc_fsl_sai(+) snd_soc_fsl_audmix imx8_media_dev(C+) snd_soc_fsl_asrc snd_soc_fsl_utils snd_soc_fsl_esai caam error imx_dsp_rproc fuse
[   10.395873] CPU: 0 PID: 337 Comm: (udev-worker) Tainted: G         C         6.1.22 #51
[   10.403888] Hardware name: Freescale i.MX8QM MEK (DT)
[   10.408945] pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[   10.415911] pc : media_create_pad_link+0x8c/0x220
[   10.420629] lr : media_create_pad_link+0x58/0x220
[   10.425338] sp : ffff80000c1db6f0
[   10.428655] x29: ffff80000c1db6f0 x28: ffff000811dcd080 x27: ffff0008119e0880
[   10.435805] x26: 0000000000000004 x25: 0000000000000040 x24: ffff00081a5d6650
[   10.442954] x23: 0000000000000002 x22: 0000000000000002 x21: 0000000000000003
[   10.450096] x20: ffff000811dcd080 x19: ffff0008119e0880 x18: 0000000000000006
[   10.457245] x17: 730a323d6461705f x16: 6b6e697320323d64 x15: 61705f656372756f
[   10.464386] x14: 7320383639333836 x13: 383d736461705f6d x12: 756e3e2d6b6e6973
[   10.471527] x11: 20323d736461705f x10: 0000000000000a70 x9 : ffff8000081e329c
[   10.478668] x8 : ffff0008155655d0 x7 : 0000000000000000 x6 : 0000000000000015
[   10.485809] x5 : ffff0008ff32ea18 x4 : ffff0008ff32ea18 x3 : 0000000000000000
[   10.492950] x2 : 0000000000000000 x1 : ffff000815564b00 x0 : 0000000000000002
[   10.500092] Call trace:
[   10.502535]  media_create_pad_link+0x8c/0x220
[   10.506903]  subdev_notifier_complete+0x4ac/0x6c0 [imx8_media_dev]
[   10.513106]  v4l2_async_nf_try_complete+0x84/0x9c
[   10.517823]  __v4l2_async_nf_register+0xe8/0x140
[   10.522444]  v4l2_async_nf_register+0x4c/0x74
[   10.526805]  mxc_md_probe+0x674/0xa40 [imx8_media_dev]
[   10.531957]  platform_probe+0x70/0xcc
[   10.535623]  really_probe+0xc8/0x3e0
[   10.539203]  __driver_probe_device+0x84/0x190
[   10.543564]  driver_probe_device+0x44/0x120
[   10.547751]  __driver_attach+0xfc/0x204
[   10.551591]  bus_for_each_dev+0x7c/0xe0
[   10.555431]  driver_attach+0x2c/0x40
[   10.559010]  bus_add_driver+0x184/0x240
[   10.562850]  driver_register+0x80/0x13c
[   10.566690]  __platform_driver_register+0x30/0x3c
[   10.571399]  mxc_md_driver_init+0x28/0x1000 [imx8_media_dev]
[   10.577071]  do_one_initcall+0x60/0x2d0
[   10.580911]  do_init_module+0x50/0x1f0
[   10.584664]  load_module+0x1c44/0x2024
[   10.588418]  __do_sys_finit_module+0xac/0x12c
[   10.592779]  __arm64_sys_finit_module+0x28/0x34
[   10.597313]  invoke_syscall+0x50/0x120
[   10.601066]  el0_svc_common.constprop.0+0xd4/0xf4
[   10.605775]  do_el0_svc+0x34/0xd0
[   10.609093]  el0_svc+0x2c/0x84
[   10.612154]  el0t_64_sync_handler+0xf4/0x120
[   10.616426]  el0t_64_sync+0x18c/0x190
[   10.620093] ---[ end trace 0000000000000000 ]---
[   10.636501] mx8-img-md: subdev_notifier_complete error exit
[   10.642194] mxc-md bus@58000000:camera: Sensor register failed
[   10.648142] mxc-md: probe of bus@58000000:camera failed with error -22&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;The causes of the exception are as follows.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;drivers/media/mc/mc-entity.c:1035&lt;/P&gt;&lt;LI-CODE lang="c"&gt;WARN_ON(source_pad &amp;gt;= source-&amp;gt;num_pads) ||&lt;/LI-CODE&gt;&lt;P&gt;This is because source_pad=2, source-&amp;gt;num_pads=2.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;[ question 2 ]&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I think gmsl-max9286.c is virtual channel 4ch. With this 4ch setting, no exception occurs, but is it okay to use the 4ch setting even with 2ch output?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;All suggestions welcome.&amp;nbsp;&lt;BR /&gt;&lt;SPAN&gt;Best regards.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Sep 2023 00:17:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/iMX8QM-MIPI-CSI2-virtual-channel-setting/m-p/1731714#M213370</guid>
      <dc:creator>aso</dc:creator>
      <dc:date>2023-09-29T00:17:38Z</dc:date>
    </item>
    <item>
      <title>Re: iMX8QM MIPI CSI2 virtual channel setting</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/iMX8QM-MIPI-CSI2-virtual-channel-setting/m-p/1732933#M213487</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/102266"&gt;@aso&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;I hope you are doing well.&lt;/P&gt;
&lt;P&gt;Have you disabled&amp;nbsp;mipi_csi_1 and&amp;nbsp;i2c_mipi_csi1 nodes also?&lt;/P&gt;
&lt;P&gt;There seems to be some issue with the configuration of source pad mappings.&lt;/P&gt;
&lt;P&gt;Please share the full device tree.&lt;/P&gt;
&lt;P&gt;Thanks &amp;amp; Regards,&lt;BR /&gt;Dhruvit Vasavada&lt;/P&gt;</description>
      <pubDate>Tue, 03 Oct 2023 07:36:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/iMX8QM-MIPI-CSI2-virtual-channel-setting/m-p/1732933#M213487</guid>
      <dc:creator>Dhruvit</dc:creator>
      <dc:date>2023-10-03T07:36:27Z</dc:date>
    </item>
    <item>
      <title>Re: iMX8QM MIPI CSI2 virtual channel setting</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/iMX8QM-MIPI-CSI2-virtual-channel-setting/m-p/1733437#M213531</link>
      <description>&lt;P&gt;Hi, &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/201299"&gt;@Dhruvit&lt;/a&gt;&lt;/P&gt;&lt;P&gt;Thank you for your reply.&lt;BR /&gt;Yes, it's disabled.&lt;BR /&gt;I have attached a dts file, so please check it.&lt;/P&gt;&lt;P&gt;Best regards.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Oct 2023 01:48:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/iMX8QM-MIPI-CSI2-virtual-channel-setting/m-p/1733437#M213531</guid>
      <dc:creator>aso</dc:creator>
      <dc:date>2023-10-04T01:48:55Z</dc:date>
    </item>
    <item>
      <title>Re: iMX8QM MIPI CSI2 virtual channel setting</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/iMX8QM-MIPI-CSI2-virtual-channel-setting/m-p/1734124#M213592</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/102266"&gt;@aso&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;I hope you are doing well.&lt;/P&gt;
&lt;P&gt;There seem to be redundant nodes of&amp;nbsp;mipi_csi_0 in shared dts.&lt;/P&gt;
&lt;P&gt;It looks like virtual channels are hardcoded to 1 or 4 in&amp;nbsp;imx8-media-dev.c driver.&lt;/P&gt;
&lt;P&gt;mipi_vc = (mipi_csi2-&amp;gt;vchannel) ? &lt;STRONG&gt;4&lt;/STRONG&gt; : 1;&lt;/P&gt;
&lt;P&gt;One can try changing it in&lt;A href="https://github.com/nxp-imx/linux-imx/blob/lf-6.1.y/drivers/staging/media/imx/imx8-media-dev.c#L525C1-L526C1" target="_self"&gt;&amp;nbsp;/drivers/staging/media/imx/imx8-media-dev.c&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Thanks &amp;amp; Regards,&lt;BR /&gt;Dhruvit Vasavada&lt;/P&gt;</description>
      <pubDate>Thu, 05 Oct 2023 08:58:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/iMX8QM-MIPI-CSI2-virtual-channel-setting/m-p/1734124#M213592</guid>
      <dc:creator>Dhruvit</dc:creator>
      <dc:date>2023-10-05T08:58:33Z</dc:date>
    </item>
    <item>
      <title>Re: iMX8QM MIPI CSI2 virtual channel setting</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/iMX8QM-MIPI-CSI2-virtual-channel-setting/m-p/1736074#M213748</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi,&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://community.nxp.com/t5/user/viewprofilepage/user-id/201299" target="_blank"&gt;@Dhruvit&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Thanks for your support.&lt;BR /&gt;I modified imx8-media-dev.c and succeeded in avoiding the exception.&lt;/P&gt;&lt;P&gt;Now I started Linux and started debugging the sensor driver, but camera capture fails.&lt;BR /&gt;I'll post this issue in a separate thread.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Best regards.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Oct 2023 23:09:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/iMX8QM-MIPI-CSI2-virtual-channel-setting/m-p/1736074#M213748</guid>
      <dc:creator>aso</dc:creator>
      <dc:date>2023-10-09T23:09:54Z</dc:date>
    </item>
  </channel>
</rss>

