How To set MIPI Clock in IMX8M Nano?

cancel
Showing results for 
Search instead for 
Did you mean: 

How To set MIPI Clock in IMX8M Nano?

136 Views
milav_soni
Contributor III

Hello Guys,

I want to set MIPI Clock in imx8m nano Board.

Can you please help me with how I can add frequency to the Device Tree File?

And what is the meaning of "link-frequencies" in the following snapshot?

  ov5640: ov5640_mipi@3c {
                compatible = "ovti,ov5640";
                reg = <0x36>;
                pinctrl-names = "default";
                pinctrl-0 = <&pinctrl_csi_pwn>, <&pinctrl_csi_rst>;
                clocks = <&clk IMX8MN_CLK_CLKO1>;
                clock-names = "xclk";
                assigned-clocks = <&clk IMX8MN_CLK_CLKO1>;
                assigned-clock-parents = <&clk IMX8MN_CLK_24M>;
                assigned-clock-rates = <27000000>;
                csi_id = <0>;
                xclk-gpios = <&gpio2 9 GPIO_ACTIVE_HIGH>;
                reset-gpios = <&gpio1 11 GPIO_ACTIVE_HIGH>;
                mclk = <27000000>;
                mclk_source = <0>;
                mipi_csi;
                status = "okay";
                port {
                        ov5640_ep: endpoint {
                                remote-endpoint = <&mipi1_sensor_ep>;
                                data-lanes = <1 2 3 4>;
                                clocks-lanes = <0>;
                                link-frequencies = /bits/ 64 <496000000>;
                        };
                };
        };
&mipi_csi_1 {
        #address-cells = <1>;
        #size-cells = <0>;
        status = "okay";
        port@0 {
                reg = <0>;
                mipi1_sensor_ep: endpoint {
                        remote-endpoint = <&ov5640_ep>;
                        data-lanes = <4>;
                        link-frequencies = /bits/ 64 <496000000>; //extra
                        csis-hs-settle = <13>; //orig
                        csis-clk-settle = <2>; //orig
                        csis-wclk;
                };
        };
};

 

Following is the imx8mn.dtsi file snapshot.

 mipi_csi_1: csi@32e30000 {
                        compatible = "fsl,imx8mn-mipi-csi";
                        reg = <0x0 0x32e30000 0x0 0x10000>;
                        interrupts = <GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>;
                        clock-frequency = <333000000>;
                        clocks = <&clk IMX8MN_CLK_CAMERA_PIXEL>,
                                 <&clk IMX8MN_CLK_DISP_AXI_ROOT>,
                                 <&clk IMX8MN_CLK_DISP_APB_ROOT>;
                        clock-names = "mipi_clk", "disp_axi", "disp_apb";
                        assigned-clocks = <&clk IMX8MN_CLK_CAMERA_PIXEL>;
                        assigned-clock-parents = <&clk IMX8MN_SYS_PLL2_1000M>;
                        assigned-clock-rates = <333000000>;
                        bus-width = <4>;
                        csi-gpr = <&mipi2csi_gasket>;
                        power-domains = <&mipi_pd>;
                        resets = <&mipi_csi_resets>;
                        status = "disabled";
                };

 

please help me out with how I can update the MIPI D−PHY Clock Rate?

Thank You

Labels (1)
0 Kudos
3 Replies

122 Views
Qmiller
NXP Employee
NXP Employee

What the value of clock do you want to generate?

0 Kudos

119 Views
milav_soni
Contributor III

Hello @Qmiller 

Thank You for your Reply.

Actually, I want to know what is the meaning of link frequencies in the following section?

  ov5640: ov5640_mipi@3c {
                compatible = "ovti,ov5640";
                reg = <0x36>;
                pinctrl-names = "default";
                pinctrl-0 = <&pinctrl_csi_pwn>, <&pinctrl_csi_rst>;
                clocks = <&clk IMX8MN_CLK_CLKO1>;
                clock-names = "xclk";
                assigned-clocks = <&clk IMX8MN_CLK_CLKO1>;
                assigned-clock-parents = <&clk IMX8MN_CLK_24M>;
                assigned-clock-rates = <27000000>;
                csi_id = <0>;
                xclk-gpios = <&gpio2 9 GPIO_ACTIVE_HIGH>;
                reset-gpios = <&gpio1 11 GPIO_ACTIVE_HIGH>;
                mclk = <27000000>;
                mclk_source = <0>;
                mipi_csi;
                status = "okay";
                port {
                        ov5640_ep: endpoint {
                                remote-endpoint = <&mipi1_sensor_ep>;
                                data-lanes = <1 2 3 4>;
                                clocks-lanes = <0>;
                                link-frequencies = /bits/ 64 <496000000>;  --> What is the menaing of this?
                        };
                };
        };

&mipi_csi_1 {
        #address-cells = <1>;
        #size-cells = <0>;
        status = "okay";
        port@0 {
                reg = <0>;
                mipi1_sensor_ep: endpoint {
                        remote-endpoint = <&ov5640_ep>;
                        data-lanes = <4>;
                        link-frequencies = /bits/ 64 <496000000>; //extra
                        csis-hs-settle = <13>; //orig
                        csis-clk-settle = <2>; //orig
                        csis-wclk;
                };
        };
};

Is link frequencies mean pixel frequency? or else bandwidth?

Another thing I want to know is that, Is my camera MIPI rate and imx8m nano MIPI rate are the same or not?

The camera set the following values,

  1. Pixel clock:- 82.8 Mhz
  2. Data rate per lane:- 206Mpbs/lane
  3. MIPI Clock Rate:- 103 Mhz

Can you please help me out?

Thank You

 

0 Kudos

108 Views
Qmiller
NXP Employee
NXP Employee

For the meaning of camera dts node, you can find answers in Documentation/devicetree/bindings/media/video-interfaces.txt

 

 Is my camera MIPI rate and imx8m nano MIPI rate are the same or not?

-->Not same but the MIPI  support this rate.

 

0 Kudos