IMX8MP CSI port 2 configuration

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

IMX8MP CSI port 2 configuration

Jump to solution
1,629 Views
Vilius
Contributor II

Greetings,

I was wondering what is the correct way to setup the IMX8MP CSI port 2 as a single camera interface with 4 lanes?

I have tried similar stuff to this as we are running a compulab bsp.
https://github.com/compulab-yokneam/linux-compulab/blob/bca57e9940b5454a8c77a3a1bf50bc2a23c6c68e/arc...

But seems like something is not getting wired correctly and the subdev device in v4l2 is not getting brought up. 

When running on CSI1, I get the expected result of (and the expected media graph):

root@ucm-imx8m-plus:~# v4l2-ctl --list-devices
 ():
        /dev/v4l-subdev0
        /dev/v4l-subdev1
        /dev/v4l-subdev2
 (csi0):
        /dev/v4l-subdev3
FSL Capture Media Device (platform:32c00000.bus:camera):
        /dev/media1
VIV (platform:viv0):
        /dev/video2
vsi_v4l2dec (platform:vsi_v4l2dec):
        /dev/video1
vsi_v4l2enc (platform:vsi_v4l2enc):
        /dev/video0
viv_media (platform:vvcam-video.0):
        /dev/media0

and dmesg output of:

[ 8.715165] mx8-img-md: Registered sensor subdevice: imx67x 4-001a (1) [ 8.720058] enter isp_mi_stop [ 8.722050] mx8-img-md: created link [imx67x 4-001a] => [mxc-mipi-csi2.0] [ 8.731969] mxc-md 32c00000.bus:camera: mxc_md_create_links

But when using a DTB for CSI port 2, then I dont get the subdevices linked/registered.

So my question is what is important to get the subdevice up and running? And how are they getting linked? Does the CSI port 2 require ISP2? Does the registers change or what? 

Tags (4)
0 Kudos
Reply
1 Solution
1,485 Views
Vilius
Contributor II
This DTB works, ensure you load the kernel modules in the correct order.

View solution in original post

0 Kudos
Reply
3 Replies
1,579 Views
Manuel_Salas
NXP TechSupport
NXP TechSupport

Hello @Vilius 

I hope you are doing very well.

 

Please take a look to the imx8mp-frdm-ap1302-dual.dts.

 

Best regards,

Salas.

0 Kudos
Reply
1,562 Views
Vilius
Contributor II

Well, like I mentioned, I have looked into other dtbs with csi port 2, but even checking the one you linked, I still have yet to get the media graph setup correctly.

DTB snippet of what I'm currently trying to use

&i2c5 {
       pinctrl-0 = <&pinctrl_i2c5>;
       scl-gpios = <&gpio3 26>;
       sda-gpios = <&gpio3 27>;
       status = "okay";
   
       /delete-node/ ov5640_mipi@3c;
       imx_camera: camera_mipi@1a {
               compatible = "framos,imx67x";
               reg = <0x1a>;
               pinctrl-names = "default";
               pinctrl-0 = <&pinctrl_csi_mclk>;
               clocks = <&clk IMX8MP_CLK_IPP_DO_CLKO2>;
               clock-names = "csi_mclk";
               csi_id = <1>;
               en-gpios = <&gpio1 0 GPIO_ACTIVE_LOW>;
               rst-gpios = <&gpio1 1 GPIO_ACTIVE_LOW>;
               mipi_csi;
               status = "okay";
               port {
                       camera_mipi_1_ep: endpoint {
                               remote-endpoint = <&mipi_csi1_ep>;
                               data-lanes = <1 2 3 4>;
                               clock-lanes = <0>;
                               max-pixel-frequency = /bits/ 64 <266000000>;
                       };
               };
       };
};

&mipi_csi_0 {
       status = "disabled";
};

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

&isi_0 {
       status = "disabled";
};

&isi_1 {
       status = "disabled";
};

&isp_0 {
       status = "okay";
};

 

0 Kudos
Reply
1,486 Views
Vilius
Contributor II
This DTB works, ensure you load the kernel modules in the correct order.
0 Kudos
Reply