MIPI can support video streaming over 1, 2, 3 and 4 lanes. On i.MX6 Sabre boards, the OV5640 camera supports 1 or 2 lanes and the NXP Linux Kernel uses 2 lanes as default.
In order to use only one lane, follow the steps below:
1 - Change the board Device Tree on Linux Kernel.
On file <linux kernel folder>/arch/arm/boot/dts/imx6qdl-sabresd.dtsi, find the entry "&mipi_csi" and change lanes from 2 to 1.
2 - Configure OV5640 to use only one lane instead of two.
On file <linux kernel folder>/drivers/media/platform/mxc/capture/ov5640_mipi.c, change the register 0x300e value from 0x45 to 0x05. This register setup is located at struct ov5640_init_setting_30fps_VGA.
3 - Build the kernel and device tree files.
4 - Test the camera.
Unit test can be used to test the video capture:
/unit_tests/mxc_v4l2_overlay.out -di /dev/video1 -ow 1024 -oh 768 -m 1
5 - Checking if it's really using one lane.
MIPI_CSI_PHY_STATE resgister (address 0x021D_C014) provides the status of all data and clock lanes. During video streaming using 2 lanes, the register value constantly changes its value between 0x0000_0300 and 0x0000_0330. When using only one lane, this register value constantly changes its value between 0x0000_0300 and 0x0000_0310.
To read the register value during the stream, run the video test with &:
/unit_tests/mxc_v4l2_overlay.out -di /dev/video1 -ow 1024 -oh 768 -m 1 &
Now, run the memtool:
/unit_tests/memtool -32 0x021dc014 1
i.MX6DL running mxc_v4l2_overlay.out with only one lane: