IMX8MM with 2 cameras (one MIPI CSI interface)

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

IMX8MM with 2 cameras (one MIPI CSI interface)

2,110 Views
btarnowski
Contributor III

Hi all. The project uses 2 cameras on the one MIPI-CSI peripheral. This CPU (IMX8MM) has only one interface but there is idea to connect two cameras through the MUX. The concept is below.
For now the I2C is going to be not connected through the MUX (the previous version idea below on the diagram)

Camera BlockDiagram simple.png

The first question is how to prepare DeviceTree? The doubled nodes CSI_BRIDGE & MIPI_CSI concept is not working (like below).

btarnowski_0-1675174935810.png

It gives the message at startup time

 

[    1.679447] mx6s-csi 32e20000.csi_bridge_1: initialising
[    1.685330] mx6s-csi 32e20000.csi_bridge_2: initialising
[    1.690680] mx6s-csi 32e20000.csi_bridge_2: can't request region for resource                                                                       [mem 0x32e20000-0x32e20fff]
[    1.700263] mx6s-csi 32e20000.csi_bridge_2: Failed platform resources map

 


So the question is: How to get the one CSI_BRIDE and MIPI_CSI with two cameras as a ports & endpoints?

Labels (1)
0 Kudos
Reply
6 Replies

263 Views
ajita02
Contributor IV

Hi @btarnowski ,

I want to implement same thing. Can you share your working dts here?

Thanks & Regards,
Ajita

0 Kudos
Reply

2,087 Views
btarnowski
Contributor III

Yes, IMX8MM has only 1 camera interface. The idea is to have 2 modules (the same drivers) probed for different I2C camera address with different state of MUX. Hardware uses this one Video Switch
https://www.mouser.pl/ProductDetail/Diodes-Incorporated/PI3WVR626XEBEX?qs=GedFDFLaBXEHauao1u%252BPaQ...
It works staticly. I can change the DeviceTree (I2C camera sensor address) and my driver can set the proper state of MUX line.
Rest of work depends on Linux DeviceTree and driver implementation.
So now Im working to find correct DeviceTree to implement 2 nodes of cameras for one CSI Bridge & MIPI PHY

0 Kudos
Reply

2,083 Views
joanxie
NXP TechSupport
NXP TechSupport

could you share your whole dts file and logfile with me?

0 Kudos
Reply

2,078 Views
btarnowski
Contributor III

For now I tested this one approach

 

    os02g10_1: os02g10@3c {
        compatible = "ovti,os02g10";
        reg = <0x3c>;
        status = "okay";
        pinctrl-names = "rockchip,camera_default", "rockchip,camera_sleep";
        pinctrl-0 = <&pinctrl_mipi_csi>;
        pinctrl-1 = <&pinctrl_mipi_csi>;
        pwdn-gpios = <&gpio2 16 GPIO_ACTIVE_HIGH>;
        reset-gpios = <&gpio2 13 GPIO_ACTIVE_HIGH>;
        muxoe-gpios = <&gpio2 14 GPIO_ACTIVE_LOW>;
        muxsel-gpios = <&gpio2 15 GPIO_ACTIVE_LOW>;
        mclk = <24000000>;
        mclk_source = <0>;
        rockchip,camera-module-index = <1>;
        rockchip,camera-module-facing = "back";
        rockchip,camera-module-name = "OS02G10 camera";
        rockchip,camera-module-lens-name = "1//2.9 inch 15*";
        rockchip,camera-hdr-mode = <0>;
        mipi_csi;

        port {
            os02g10_1_ep: endpoint {
                remote-endpoint = <&mipi_sensor_1_ep>;
            };
        };
    };

    os02g10_2: os02g10@3d {
        compatible = "ovti,os02g10";
        reg = <0x3d>;
        status = "okay";
        pinctrl-names = "rockchip,camera_default", "rockchip,camera_sleep";
        pinctrl-0 = <&pinctrl_mipi_csi>;
        pinctrl-1 = <&pinctrl_mipi_csi>;
        pwdn-gpios = <&gpio2 16 GPIO_ACTIVE_HIGH>;
        reset-gpios = <&gpio2 13 GPIO_ACTIVE_HIGH>;
        muxoe-gpios = <&gpio2 14 GPIO_ACTIVE_LOW>;
        muxsel-gpios = <&gpio2 15 GPIO_ACTIVE_LOW>;
        mclk = <24000000>;
        mclk_source = <0>;
        rockchip,camera-module-index = <1>;
        rockchip,camera-module-facing = "back";
        rockchip,camera-module-name = "OS02G10 camera";
        rockchip,camera-module-lens-name = "1//2.9 inch 15*";
        rockchip,camera-hdr-mode = <0>;
        mipi_csi;

        port {
            os02g10_2_ep: endpoint {
                remote-endpoint = <&mipi_sensor_1_ep>;
            };
        };
    };
};

&csi_bridge_1 {
    fsl,mipi-mode;
    fsl,two-8bit-sensor-mode;
    status = "okay";
    port {
        csi1_ep: endpoint {
            remote-endpoint = <&csi_mipi_1_ep>;
        };
    };
};

&mipi_csi_1 {
    status = "okay";
    port {
        #address-cells = <1>;
        #size-cells = <0>;

        mipi_sensor_1_ep: endpoint@1 {
            remote-endpoint-0 = <&os02g10_1_ep>;
            remote-endpoint-1 = <&os02g10_2_ep>;
            data-lanes = <2>;
            csis-hs-settle = <17>;
            csis-clk-settle = <0>;
            csis-wclk;
        };

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

 

 but  this piece of DTS makes strange behavior

 

            remote-endpoint-0 = <&os02g10_1_ep>;
            remote-endpoint-1 = <&os02g10_2_ep>;

 

  and all time until infinity Im getting the message in the log

 

[   38.173643] cpu cpu0: dev_pm_opp_set_rate: switching OPP: 1600000000 Hz --> 1200000000 Hz
[   38.181913] cpu cpu0: _set_opp_voltage: voltages (mV): 850000 850000 850000
[   38.189796] cpu cpu0: dev_pm_opp_set_rate: switching OPP: 1200000000 Hz --> 1600000000 Hz
[   38.198013] cpu cpu0: _set_opp_voltage: voltages (mV): 950000 950000 950000
[   38.215852] cpu cpu0: dev_pm_opp_set_rate: switching OPP: 1600000000 Hz --> 1200000000 Hz
[   38.224129] cpu cpu0: _set_opp_voltage: voltages (mV): 850000 850000 850000
[   38.232498] cpu cpu0: dev_pm_opp_set_rate: switching OPP: 1200000000 Hz --> 1600000000 Hz
[   38.240721] cpu cpu0: _set_opp_voltage: voltages (mV): 950000 950000 950000
[   38.260166] cpu cpu0: dev_pm_opp_set_rate: switching OPP: 1600000000 Hz --> 1200000000 Hz
[   38.268482] cpu cpu0: _set_opp_voltage: voltages (mV): 850000 850000 850000
[   38.275973] cpu cpu0: dev_pm_opp_set_rate: switching OPP: 1200000000 Hz --> 1600000000 Hz
[   38.284198] cpu cpu0: _set_opp_voltage: voltages (mV): 950000 950000 950000
[   38.301811] cpu cpu0: dev_pm_opp_set_rate: switching OPP: 1600000000 Hz --> 1200000000 Hz
[   38.310086] cpu cpu0: _set_opp_voltage: voltages (mV): 850000 850000 850000
[   38.317811] cpu cpu0: dev_pm_opp_set_rate: switching OPP: 1200000000 Hz --> 1600000000 Hz
[   38.326048] cpu cpu0: _set_opp_voltage: voltages (mV): 950000 950000 950000
[   38.343833] cpu cpu0: dev_pm_opp_set_rate: switching OPP: 1600000000 Hz --> 1200000000 Hz
[   38.352089] cpu cpu0: _set_opp_voltage: voltages (mV): 850000 850000 850000
[   38.360449] cpu cpu0: dev_pm_opp_set_rate: switching OPP: 1200000000 Hz --> 1600000000 Hz
[   38.368715] cpu cpu0: _set_opp_voltage: voltages (mV): 950000 950000 950000
[   38.387646] cpu cpu0: dev_pm_opp_set_rate: switching OPP: 1600000000 Hz --> 1200000000 Hz
[   38.395942] cpu cpu0: _set_opp_voltage: voltages (mV): 850000 850000 850000
[   38.404800] cpu cpu0: dev_pm_opp_set_rate: switching OPP: 1200000000 Hz --> 1600000000 Hz
[   38.413046] cpu cpu0: _set_opp_voltage: voltages (mV): 950000 950000 950000
[   38.431393] cpu cpu0: dev_pm_opp_set_rate: switching OPP: 1600000000 Hz --> 1200000000 Hz

 


Still working on solution to get 2 video devices for both cameras with one MIPI-CSI peripheral

0 Kudos
Reply

2,064 Views
joanxie
NXP TechSupport
NXP TechSupport

my understanding is that you want to connect two camera with the different I2C, then use the mux to switch two camera, but you don't use these two camera in the same time, just use this mux to switch these two camera, you can choose which camera you want to use currently, am I right? and pls share the whole dts file and logfile with me, don't just copy part of them, let me double check it

0 Kudos
Reply

2,092 Views
joanxie
NXP TechSupport
NXP TechSupport

"For now the I2C is going to be not connected through the MUX"

> how did you connect dual camera to the imx8mm now? imx8mp mipi csi couldn't support dual camera in the same time

0 Kudos
Reply