Dear @igorpadykov ,
I would like to re-launch this question since I'm in the context of ISP-IMX and there's certain definition of number of lanes within units/isi/include/isi_common.h :
#define ISI_MIPI_OFF 0x80000000 //!< MIPI is disabled
#define ISI_MIPI_4LANES 0x00000004
#define ISI_MIPI_2LANES 0x00000002
...
#define ISI_MIPI_LANES 0x00000060
Which then are used in each sensor ISP based driver, for example :
pIsiSensorCaps->MipiLanes = ISI_MIPI_4LANES;
And escalated to units/isi/source/isi.c :
struct vvcam_csi_lane_cfg csi_lane_cfg;
csi_lane_cfg.mipi_lane_num = Caps.MipiLanes;
result = ioctl(pHalCtx->csi_fd,VVCSI_IOC_S_LANE_CFG,&csi_lane_cfg);
if (result != 0)
{
TRACE( ISI_ERROR, "%s: Set csi mipi lane Error\n", __func__);
return ( RET_FAILURE );
}
Also, I have confusion of the relationship of the number of lanes defined in above units/isi/include/isi_common.h and ones defined in device-tree as your suggestion, for example:
imx296_0: imx296_mipi@1a {
compatible = "sony,imx296_mipi_vvcam";
...
port {
imx296_mipi_0_ep: endpoint {
data-lanes = <1>;
clock-lanes = <0>;
remote-endpoint = <&mipi_csi0_ep>;
};
};
};
Are they both programmed in the following register ?
MIPI_CSIx_CSIS_COMMON_CTRL.png
Last thing, since 1-lane definition is missing in above units/isi/include/isi_common.h, I plan to add it as following :
#define ISI_MIPI_OFF 0x80000000 //!< MIPI is disabled
#define ISI_MIPI_4LANES 0x00000004
#define ISI_MIPI_2LANES 0x00000002
#define ISI_MIPI_1LANE 0x00000001 // My definition
What do you think ?
Thanks in advance,
Khang.