Skip to content

Commit 07926d8

Browse files
author
Jacopo Mondi
committed
overlays: Add overlay for the OV64A40 Arducam Camera Module
Arducam have integrated an Omnivision OV64A40 with a ROHM BU64754 VCM with a Raspberry Pi compatible cable pinout. Provide an overlay to support the module. Also add support to the camera mux overlays. Signed-off-by: Jacopo Mondi <[email protected]> Signed-off-by: Kieran Bingham <[email protected]>
1 parent aeb4981 commit 07926d8

File tree

6 files changed

+247
-0
lines changed

6 files changed

+247
-0
lines changed

arch/arm/boot/dts/overlays/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \
175175
mz61581.dtbo \
176176
ov2311.dtbo \
177177
ov5647.dtbo \
178+
ov64a40.dtbo \
178179
ov7251.dtbo \
179180
ov9281.dtbo \
180181
papirus.dtbo \

arch/arm/boot/dts/overlays/README

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -817,6 +817,7 @@ Params: cam0-arducam-64mp Select Arducam64MP for camera on port 0
817817
cam0-imx708 Select IMX708 for camera on port 0
818818
cam0-ov2311 Select OV2311 for camera on port 0
819819
cam0-ov5647 Select OV5647 for camera on port 0
820+
cam0-ov64a40 Select OV64A40 for camera on port 0
820821
cam0-ov7251 Select OV7251 for camera on port 0
821822
cam0-ov9281 Select OV9281 for camera on port 0
822823
cam0-imx290-clk-freq Set clock frequency for an IMX290 on port 0
@@ -829,6 +830,7 @@ Params: cam0-arducam-64mp Select Arducam64MP for camera on port 0
829830
cam1-imx708 Select IMX708 for camera on port 1
830831
cam1-ov2311 Select OV2311 for camera on port 1
831832
cam1-ov5647 Select OV5647 for camera on port 1
833+
cam1-ov64a40 Select OV64A40 for camera on port 1
832834
cam1-ov7251 Select OV7251 for camera on port 1
833835
cam1-ov9281 Select OV9281 for camera on port 1
834836
cam1-imx290-clk-freq Set clock frequency for an IMX290 on port 1
@@ -850,6 +852,7 @@ Params: cam0-arducam-64mp Select Arducam64MP for camera on port 0
850852
cam0-imx708 Select IMX708 for camera on port 0
851853
cam0-ov2311 Select OV2311 for camera on port 0
852854
cam0-ov5647 Select OV5647 for camera on port 0
855+
cam0-ov64a40 Select OV64A40 for camera on port 0
853856
cam0-ov7251 Select OV7251 for camera on port 0
854857
cam0-ov9281 Select OV9281 for camera on port 0
855858
cam0-imx290-clk-freq Set clock frequency for an IMX290 on port 0
@@ -862,6 +865,7 @@ Params: cam0-arducam-64mp Select Arducam64MP for camera on port 0
862865
cam1-imx708 Select IMX708 for camera on port 1
863866
cam1-ov2311 Select OV2311 for camera on port 1
864867
cam1-ov5647 Select OV5647 for camera on port 1
868+
cam1-ov64a40 Select OV64A40 for camera on port 1
865869
cam1-ov7251 Select OV7251 for camera on port 1
866870
cam1-ov9281 Select OV9281 for camera on port 1
867871
cam1-imx290-clk-freq Set clock frequency for an IMX290 on port 1
@@ -874,6 +878,7 @@ Params: cam0-arducam-64mp Select Arducam64MP for camera on port 0
874878
cam2-imx708 Select IMX708 for camera on port 2
875879
cam2-ov2311 Select OV2311 for camera on port 2
876880
cam2-ov5647 Select OV5647 for camera on port 2
881+
cam2-ov64a40 Select OV64A40 for camera on port 2
877882
cam2-ov7251 Select OV7251 for camera on port 2
878883
cam2-ov9281 Select OV9281 for camera on port 2
879884
cam2-imx290-clk-freq Set clock frequency for an IMX290 on port 2
@@ -886,6 +891,7 @@ Params: cam0-arducam-64mp Select Arducam64MP for camera on port 0
886891
cam3-imx708 Select IMX708 for camera on port 3
887892
cam3-ov2311 Select OV2311 for camera on port 3
888893
cam3-ov5647 Select OV5647 for camera on port 3
894+
cam3-ov64a40 Select OV64A40 for camera on port 3
889895
cam3-ov7251 Select OV7251 for camera on port 3
890896
cam3-ov9281 Select OV9281 for camera on port 3
891897
cam3-imx290-clk-freq Set clock frequency for an IMX290 on port 3
@@ -3222,6 +3228,25 @@ Params: rotation Mounting rotation of the camera sensor (0 or
32223228
vcm Configure a VCM focus drive on the sensor.
32233229

32243230

3231+
Name: ov64a40
3232+
Info: Arducam OV64A40 camera module.
3233+
Uses Unicam 1, which is the standard camera connector on most Pi
3234+
variants.
3235+
Load: dtoverlay=ov64a40,<param>=<val>
3236+
Params: rotation Mounting rotation of the camera sensor (0 or
3237+
180, default 0)
3238+
orientation Sensor orientation (0 = front, 1 = rear,
3239+
2 = external, default external)
3240+
media-controller Configure use of Media Controller API for
3241+
configuring the sensor (default on)
3242+
cam0 Adopt the default configuration for CAM0 on a
3243+
Compute Module (CSI0, i2c_vc, and cam0_reg).
3244+
vcm Select lens driver state. Default is enabled,
3245+
but vcm=off will disable.
3246+
link-frequency Allowable link frequency values to use in Hz:
3247+
456000000 (default), 360000000
3248+
3249+
32253250
Name: ov7251
32263251
Info: Omnivision OV7251 camera module.
32273252
Uses Unicam 1, which is the standard camera connector on most Pi

arch/arm/boot/dts/overlays/camera-mux-2port-overlay.dts

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,16 @@
189189
#undef cam_node
190190
#undef cam_endpoint
191191
#undef cam1_clk
192+
193+
#define cam_node ov64a40_0
194+
#define cam_endpoint ov64a40_0_ep
195+
#define vcm_node ov64a40_0_vcm
196+
#define cam1_clk clk_24mhz
197+
#include "ov64a40.dtsi"
198+
#undef cam_node
199+
#undef cam_endpoint
200+
#undef vcm_node
201+
#undef cam1_clk
192202
};
193203

194204
i2c@1 {
@@ -289,6 +299,16 @@
289299
#undef cam_node
290300
#undef cam_endpoint
291301
#undef cam1_clk
302+
303+
#define cam_node ov64a40_1
304+
#define cam_endpoint ov64a40_1_ep
305+
#define vcm_node ov64a40_1_vcm
306+
#define cam1_clk clk_24mhz
307+
#include "ov64a40.dtsi"
308+
#undef cam_node
309+
#undef cam_endpoint
310+
#undef vcm_node
311+
#undef cam1_clk
292312
};
293313
};
294314
};
@@ -450,6 +470,12 @@
450470
cam0-ov2311 = <&mux_in0>, "remote-endpoint:0=",<&ov2311_0_ep>,
451471
<&ov2311_0_ep>, "remote-endpoint:0=",<&mux_in0>,
452472
<&ov2311_0>, "status=okay";
473+
cam0-ov64a40 = <&mux_in0>, "remote-endpoint:0=",<&ov64a40_0_ep>,
474+
<&ov64a40_0_ep>, "remote-endpoint:0=",<&mux_in0>,
475+
<&mux_in0>, "clock-noncontinuous?",
476+
<&ov64a40_0>, "status=okay",
477+
<&ov64a40_0_vcm>, "status=okay",
478+
<&ov64a40_0>,"lens-focus:0=", <&ov64a40_0_vcm>;
453479

454480
cam1-arducam-64mp = <&mux_in1>, "remote-endpoint:0=",<&arducam_64mp_1_ep>,
455481
<&arducam_64mp_1_ep>, "remote-endpoint:0=",<&mux_in1>,
@@ -496,6 +522,12 @@
496522
cam1-ov2311 = <&mux_in1>, "remote-endpoint:0=",<&ov2311_1_ep>,
497523
<&ov2311_1_ep>, "remote-endpoint:0=",<&mux_in1>,
498524
<&ov2311_1>, "status=okay";
525+
cam1-ov64a40 = <&mux_in1>, "remote-endpoint:0=",<&ov64a40_1_ep>,
526+
<&ov64a40_1_ep>, "remote-endpoint:0=",<&mux_in1>,
527+
<&mux_in1>, "clock-noncontinuous?",
528+
<&ov64a40_1>, "status=okay",
529+
<&ov64a40_1_vcm>, "status=okay",
530+
<&ov64a40_1>,"lens-focus:0=", <&ov64a40_1_vcm>;
499531

500532
cam0-imx290-clk-freq = <&clk_imx290>,"clock-frequency:0",
501533
<&imx290_0>,"clock-frequency:0";

arch/arm/boot/dts/overlays/camera-mux-4port-overlay.dts

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,16 @@
247247
#undef cam_node
248248
#undef cam_endpoint
249249
#undef cam1_clk
250+
251+
#define cam_node ov64a40_0
252+
#define cam_endpoint ov64a40_0_ep
253+
#define vcm_node ov64a40_0_vcm
254+
#define cam1_clk clk_24mhz
255+
#include "ov64a40.dtsi"
256+
#undef cam_node
257+
#undef cam_endpoint
258+
#undef vcm_node
259+
#undef cam1_clk
250260
};
251261

252262
i2c@1 {
@@ -347,6 +357,16 @@
347357
#undef cam_node
348358
#undef cam_endpoint
349359
#undef cam1_clk
360+
361+
#define cam_node ov64a40_1
362+
#define cam_endpoint ov64a40_1_ep
363+
#define vcm_node ov64a40_1_vcm
364+
#define cam1_clk clk_24mhz
365+
#include "ov64a40.dtsi"
366+
#undef cam_node
367+
#undef cam_endpoint
368+
#undef vcm_node
369+
#undef cam1_clk
350370
};
351371

352372
i2c@2 {
@@ -447,6 +467,16 @@
447467
#undef cam_node
448468
#undef cam_endpoint
449469
#undef cam1_clk
470+
471+
#define cam_node ov64a40_2
472+
#define cam_endpoint ov64a40_2_ep
473+
#define vcm_node ov64a40_2_vcm
474+
#define cam1_clk clk_24mhz
475+
#include "ov64a40.dtsi"
476+
#undef cam_node
477+
#undef cam_endpoint
478+
#undef vcm_node
479+
#undef cam1_clk
450480
};
451481

452482
i2c@3 {
@@ -547,6 +577,16 @@
547577
#undef cam_node
548578
#undef cam_endpoint
549579
#undef cam1_clk
580+
581+
#define cam_node ov64a40_3
582+
#define cam_endpoint ov64a40_3_ep
583+
#define vcm_node ov64a40_3_vcm
584+
#define cam1_clk clk_24mhz
585+
#include "ov64a40.dtsi"
586+
#undef cam_node
587+
#undef cam_endpoint
588+
#undef vcm_node
589+
#undef cam1_clk
550590
};
551591
};
552592
};
@@ -725,6 +765,12 @@
725765
cam0-ov2311 = <&mux_in0>, "remote-endpoint:0=",<&ov2311_0_ep>,
726766
<&ov2311_0_ep>, "remote-endpoint:0=",<&mux_in0>,
727767
<&ov2311_0>, "status=okay";
768+
cam0-ov64a40 = <&mux_in0>, "remote-endpoint:0=",<&ov64a40_0_ep>,
769+
<&ov64a40_0_ep>, "remote-endpoint:0=",<&mux_in0>,
770+
<&mux_in0>, "clock-noncontinuous?",
771+
<&ov64a40_0>, "status=okay",
772+
<&ov64a40_0_vcm>, "status=okay",
773+
<&ov64a40_0>,"lens-focus:0=", <&ov64a40_0_vcm>;
728774

729775
cam1-arducam-64mp = <&mux_in1>, "remote-endpoint:0=",<&arducam_64mp_1_ep>,
730776
<&arducam_64mp_1_ep>, "remote-endpoint:0=",<&mux_in1>,
@@ -771,6 +817,12 @@
771817
cam1-ov2311 = <&mux_in1>, "remote-endpoint:0=",<&ov2311_1_ep>,
772818
<&ov2311_1_ep>, "remote-endpoint:0=",<&mux_in1>,
773819
<&ov2311_1>, "status=okay";
820+
cam1-ov64a40 = <&mux_in1>, "remote-endpoint:0=",<&ov64a40_1_ep>,
821+
<&ov64a40_1_ep>, "remote-endpoint:0=",<&mux_in1>,
822+
<&mux_in1>, "clock-noncontinuous?",
823+
<&ov64a40_1>, "status=okay",
824+
<&ov64a40_1_vcm>, "status=okay",
825+
<&ov64a40_1>,"lens-focus:0=", <&ov64a40_1_vcm>;
774826

775827
cam2-arducam-64mp = <&mux_in2>, "remote-endpoint:0=",<&arducam_64mp_2_ep>,
776828
<&arducam_64mp_2_ep>, "remote-endpoint:0=",<&mux_in2>,
@@ -817,6 +869,12 @@
817869
cam2-ov2311 = <&mux_in2>, "remote-endpoint:0=",<&ov2311_2_ep>,
818870
<&ov2311_2_ep>, "remote-endpoint:0=",<&mux_in2>,
819871
<&ov2311_2>, "status=okay";
872+
cam2-ov64a40 = <&mux_in2>, "remote-endpoint:0=",<&ov64a40_2_ep>,
873+
<&ov64a40_2_ep>, "remote-endpoint:0=",<&mux_in2>,
874+
<&mux_in2>, "clock-noncontinuous?",
875+
<&ov64a40_2>, "status=okay",
876+
<&ov64a40_2_vcm>, "status=okay",
877+
<&ov64a40_2>,"lens-focus:0=", <&ov64a40_2_vcm>;
820878

821879
cam3-arducam-64mp = <&mux_in3>, "remote-endpoint:0=",<&arducam_64mp_3_ep>,
822880
<&arducam_64mp_3_ep>, "remote-endpoint:0=",<&mux_in3>,
@@ -863,6 +921,12 @@
863921
cam3-ov2311 = <&mux_in3>, "remote-endpoint:0=",<&ov2311_3_ep>,
864922
<&ov2311_3_ep>, "remote-endpoint:0=",<&mux_in3>,
865923
<&ov2311_3>, "status=okay";
924+
cam3-ov64a40 = <&mux_in3>, "remote-endpoint:0=",<&ov64a40_3_ep>,
925+
<&ov64a40_3_ep>, "remote-endpoint:0=",<&mux_in3>,
926+
<&mux_in3>, "clock-noncontinuous?",
927+
<&ov64a40_3>, "status=okay",
928+
<&ov64a40_3_vcm>, "status=okay",
929+
<&ov64a40_3>,"lens-focus:0=", <&ov64a40_3_vcm>;
866930

867931
cam0-imx290-clk-freq = <&clk_imx290>,"clock-frequency:0",
868932
<&imx290_0>,"clock-frequency:0";
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
// SPDX-License-Identifier: GPL-2.0-only
2+
// Definitions for OV64A40 camera module on VC I2C bus
3+
/dts-v1/;
4+
/plugin/;
5+
6+
/{
7+
compatible = "brcm,bcm2835";
8+
9+
i2c_frag: fragment@0 {
10+
target = <&i2c_csi_dsi>;
11+
__overlay__ {
12+
#address-cells = <1>;
13+
#size-cells = <0>;
14+
status = "okay";
15+
16+
#include "ov64a40.dtsi"
17+
};
18+
};
19+
20+
csi_frag: fragment@1 {
21+
target = <&csi1>;
22+
csi: __overlay__ {
23+
status = "okay";
24+
brcm,media-controller;
25+
26+
port{
27+
csi_ep: endpoint{
28+
remote-endpoint = <&cam_endpoint>;
29+
clock-lanes = <0>;
30+
data-lanes = <1 2>;
31+
};
32+
};
33+
};
34+
};
35+
36+
fragment@2 {
37+
target = <&i2c0if>;
38+
__overlay__ {
39+
status = "okay";
40+
};
41+
};
42+
43+
clk_frag: fragment@3 {
44+
target = <&cam1_clk>;
45+
__overlay__ {
46+
clock-frequency = <24000000>;
47+
status = "okay";
48+
};
49+
};
50+
51+
fragment@4 {
52+
target = <&i2c0mux>;
53+
__overlay__ {
54+
status = "okay";
55+
};
56+
};
57+
58+
fragment@5 {
59+
target = <&cam_node>;
60+
__overlay__ {
61+
lens-focus = <&vcm_node>;
62+
};
63+
};
64+
65+
__overrides__ {
66+
rotation = <&cam_node>,"rotation:0";
67+
orientation = <&cam_node>,"orientation:0";
68+
media-controller = <&csi>,"brcm,media-controller?";
69+
cam0 = <&i2c_frag>, "target:0=",<&i2c_csi_dsi0>,
70+
<&csi_frag>, "target:0=",<&csi0>,
71+
<&clk_frag>, "target:0=",<&cam0_clk>,
72+
<&cam_node>, "clocks:0=",<&cam0_clk>,
73+
<&cam_node>, "avdd-supply:0=",<&cam0_reg>,
74+
<&vcm_node>, "vdd-supply:0=",<&cam0_reg>;
75+
vcm = <&vcm_node>, "status",
76+
<0>, "=5";
77+
link-frequency = <&cam_endpoint>,"link-frequencies#0";
78+
};
79+
};
80+
81+
&cam_node {
82+
status = "okay";
83+
};
84+
85+
&cam_endpoint {
86+
remote-endpoint = <&csi_ep>;
87+
};
88+
89+
&vcm_node {
90+
status = "okay";
91+
};
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// Fragment that configures an OV64A40
2+
3+
cam_node: ov64a40@36 {
4+
compatible = "ovti,ov64a40";
5+
reg = <0x36>;
6+
status = "disabled";
7+
8+
clocks = <&cam1_clk>;
9+
clock-names = "xclk";
10+
11+
avdd-supply = <&cam1_reg>; /* 2.8v */
12+
dovdd-supply = <&cam_dummy_reg>;/* 1.8v */
13+
dvdd-supply = <&cam_dummy_reg>; /* 1.1v */
14+
15+
rotation = <180>;
16+
orientation = <2>;
17+
18+
port {
19+
cam_endpoint: endpoint {
20+
bus-type = <4>;
21+
clock-lanes = <0>;
22+
data-lanes = <1 2>;
23+
link-frequencies =
24+
/bits/ 64 <456000000>;
25+
};
26+
};
27+
};
28+
29+
vcm_node: bu64754@76 {
30+
compatible = "rohm,bu64754";
31+
reg = <0x76>;
32+
status = "disabled";
33+
vdd-supply = <&cam1_reg>;
34+
};

0 commit comments

Comments
 (0)