How to enable dual OV5645 on DB410c

Hi!
On my Dragonboard 410c I’m trying to enable the two OV5645 of this board:
“96Boards MIPI Adapter with Dual OV5645”

This document:


should be helpful, but I’m wondering how to revert (part of) this patch “dts: Disable camera sensors in dtsi” on Debian 19.01 kernel:

Please check commit “dts: Disable camera sensors in dtsi” in the kernel. This patch assumes that two OV5645 camera sensors are connected on the board (one per CSI2 channel) and disables them. To enable a camera please revert (part of) this patch.

Any suggestion will be highly appreciated.

You basically need to enable the related csi/sensor nodes (status="ok" instead of status="disabled").

You can find an example for ov5640 sensor enabling:
https://git.linaro.org/people/loic.poulain/linux.git/commit/?h=qcomlt-4.14-ov5640&id=c70858439a733582e0af2420b0fd069e139726f4

For you it’s even easier, since ov5645 is already the default compatible string.

An other solution, without having to rebuild, is to execute the enable-ov5645.sh script, part of dt-update project: https://github.com/96boards/dt-update

On DB410c:

git clone https://github.com/96boards/dt-update
cd dt-update
make && make install
./script/db410c/enable-ov5645.sh

Yes, this part of the docs are not very clear… and there is already a bug report about that.

Note that in both cases (direct kernel changes or using dt-update) I think only a single camera will be enabled. To enable dual camera I think you also need to update the status of camera_front and port@1 using one of these mechanisms.

Hi @Loic, @danielt
OK, I understand. Let me try these solutions and feedback.
Thanks for your prompt replies!

After studying both solutions, finally I decided to modify the apq8016-sbc.dtsi file because I’m not sure how to modify the enable-ov5645.sh script to enable the 2nd ov5645.
After generating the new boot img and use it to update the boot partition of the sd card, now the second ov5645 is enabled. By executing:
sudo media-ctl -d /dev/media0 -p, it appears as:
- entity 89: ov5645 4-003a (1 pad, 1 link) ...

According to https://www.96boards.org/documentation/consumer/dragonboard/dragonboard410c/guides/camera-module.md.html,
I can configure the first ov5645 with the following command:

sudo media-ctl -d /dev/media0 -l '"msm_csiphy0":1->"msm_csid0":0[1],"msm_csid0":1->"msm_ispif0":0[1],"msm_ispif0":1->"msm_vfe0_rdi0":0[1]'
sudo media-ctl -d /dev/media0 -V '"ov5645 4-003b":0[fmt:UYVY8_2X8/1920x1080 field:none],"msm_csiphy0":0[fmt:UYVY8_2X8/1920x1080 field:none],"msm_csid0":0[fmt:UYVY8_2X8/1920x1080 field:none],"msm_ispif0":0[fmt:UYVY8_2X8/1920x1080 field:none],"msm_vfe0_rdi0":0[fmt:UYVY8_2X8/1920x1080 field:none]'

And then I can actually take a snap shot using gst-launch-1.0.

For the 2nd ov5645, the following commands are used to configure:

sudo media-ctl -d /dev/media0 -l '"msm_csiphy1":1->"msm_csid1":0[1],"msm_csid1":1->"msm_ispif1":0[1],"msm_ispif1":1->"msm_vfe0_rdi1":0[1]'
sudo media-ctl -d /dev/media0 -V '"ov5645 4-003a":0[fmt:UYVY8_2X8/1920x1080 field:none],"msm_csiphy1":0[fmt:UYVY8_2X8/1920x1080 field:none],"msm_csid1":0[fmt:UYVY8_2X8/1920x1080 field:none],"msm_ispif1":0[fmt:UYVY8_2X8/1920x1080 field:none],"msm_vfe0_rdi1":0[fmt:UYVY8_2X8/1920x1080 field:none]'

and take a snap shot:

gst-launch-1.0 v4l2src device=/dev/video1 num-buffers=1 ! 'video/x-raw,format=UYVY,width=1920,height=1080' ! jpegenc ! filesink location=image02.jpg

It’s great to solve this issue. Many thanks to the great help from @Loic and @danielt!

1 Like