AnsweredAssumed Answered

How to determine MIPI CSI-2 hs_settle in i.MX8M?

Question asked by Benson Huang on Apr 12, 2018
Latest reply on Nov 19, 2018 by joachim Jaehn

Hi,

 

We are using i.MX8M to develop MIPI CSI-2 camera device.

In mxc-mipi-csi2_yav.c, mipi_csi2_set_fmt will assign hs_settle and send_level according to the resolution.

    if (fmt->format.width * fmt->format.height > 720 * 480) {
        csi2dev->hs_settle = rxhs_settle[1];
        csi2dev->send_level = 0x300;
    } else {
        csi2dev->hs_settle = rxhs_settle[0];
    }

 

But in 4.9.51_imx8m_ga, we can see i.MX8Q hs_settle is calculated by the formula not by the rxhs_settle table.

https://source.codeaurora.org/external/imx/linux-imx/tree/drivers/media/platform/imx8/mxc-mipi-csi2.c?h=imx_4.9.51_imx8m_ga

/* 0~ 80Mbps: 0xB * 80~250Mbps: 0x8 * 250~1.5Gbps: 0x6*/static u8 rxhs_settle[3] = {0xB, 0x8, 0x6};/**************************************** * rxhs-settle calculate * UI = 1000 / mipi csi phy clock * THS-SETTLE_mim = 85ns + 6 * UI * THS-SETTLE_max = 145ns +10 * UI * PRG_RXHS_SETTLE =  THS-SETTLE / (Tperiod of RxClk_ESC) + 1 ****************************************/static int calc_hs_settle(struct mxc_mipi_csi2_dev *csi2dev, u32 dphy_clk){     u32 esc_rate;     u32 hs_settle;     u32 rxhs_settle;      esc_rate = clk_get_rate(csi2dev->clk_esc) / 1000000;     hs_settle = 115 + 8 * 1000 / dphy_clk;     rxhs_settle = hs_settle / (1000 / esc_rate) - 1;     return rxhs_settle;}

I have the following questions.

1. How to determine hs_settle for i.MX8M?

2. What does rxhs_settle table mean?

3. In calc_hs_settle, rxhs_settle formula is different with the comment. Which one is correct? (+1 or -1)

4. In IMX8MDQLQRM.pdf, page 2046 mentions CSI2_1_S_PRG_RXHS_SETTLE and page 2059 mentions CSI2_2_S_PRG_RXHS_SETTLE. What does 1/2 mean? Does CSI2_1 mean the first CSI? Do we need to set different hs_settle value for these two CSIs?

 

Thanks!!

Outcomes