1 From 7f67a45ee7c008c3d8e45fde6fa9c4287fb3bc9e Mon Sep 17 00:00:00 2001
2 From: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
3 Date: Thu, 20 Jul 2023 13:18:34 +0200
4 Subject: [PATCH] overlays: Add overlay for the OV64A40 Arducam Camera Module
6 Arducam have integrated an Omnivision OV64A40 with a ROHM BU64754 VCM
7 with a Raspberry Pi compatible cable pinout.
9 Provide an overlay to support the module.
11 Also add support to the camera mux overlays.
13 Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
14 Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
16 arch/arm/boot/dts/overlays/Makefile | 1 +
17 arch/arm/boot/dts/overlays/README | 25 +++++
18 .../dts/overlays/camera-mux-2port-overlay.dts | 32 +++++++
19 .../dts/overlays/camera-mux-4port-overlay.dts | 64 +++++++++++++
20 .../arm/boot/dts/overlays/ov64a40-overlay.dts | 91 +++++++++++++++++++
21 arch/arm/boot/dts/overlays/ov64a40.dtsi | 34 +++++++
22 6 files changed, 247 insertions(+)
23 create mode 100644 arch/arm/boot/dts/overlays/ov64a40-overlay.dts
24 create mode 100644 arch/arm/boot/dts/overlays/ov64a40.dtsi
26 --- a/arch/arm/boot/dts/overlays/Makefile
27 +++ b/arch/arm/boot/dts/overlays/Makefile
28 @@ -175,6 +175,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \
36 --- a/arch/arm/boot/dts/overlays/README
37 +++ b/arch/arm/boot/dts/overlays/README
38 @@ -817,6 +817,7 @@ Params: cam0-arducam-64mp Select A
39 cam0-imx708 Select IMX708 for camera on port 0
40 cam0-ov2311 Select OV2311 for camera on port 0
41 cam0-ov5647 Select OV5647 for camera on port 0
42 + cam0-ov64a40 Select OV64A40 for camera on port 0
43 cam0-ov7251 Select OV7251 for camera on port 0
44 cam0-ov9281 Select OV9281 for camera on port 0
45 cam0-imx290-clk-freq Set clock frequency for an IMX290 on port 0
46 @@ -829,6 +830,7 @@ Params: cam0-arducam-64mp Select A
47 cam1-imx708 Select IMX708 for camera on port 1
48 cam1-ov2311 Select OV2311 for camera on port 1
49 cam1-ov5647 Select OV5647 for camera on port 1
50 + cam1-ov64a40 Select OV64A40 for camera on port 1
51 cam1-ov7251 Select OV7251 for camera on port 1
52 cam1-ov9281 Select OV9281 for camera on port 1
53 cam1-imx290-clk-freq Set clock frequency for an IMX290 on port 1
54 @@ -850,6 +852,7 @@ Params: cam0-arducam-64mp Select A
55 cam0-imx708 Select IMX708 for camera on port 0
56 cam0-ov2311 Select OV2311 for camera on port 0
57 cam0-ov5647 Select OV5647 for camera on port 0
58 + cam0-ov64a40 Select OV64A40 for camera on port 0
59 cam0-ov7251 Select OV7251 for camera on port 0
60 cam0-ov9281 Select OV9281 for camera on port 0
61 cam0-imx290-clk-freq Set clock frequency for an IMX290 on port 0
62 @@ -862,6 +865,7 @@ Params: cam0-arducam-64mp Select A
63 cam1-imx708 Select IMX708 for camera on port 1
64 cam1-ov2311 Select OV2311 for camera on port 1
65 cam1-ov5647 Select OV5647 for camera on port 1
66 + cam1-ov64a40 Select OV64A40 for camera on port 1
67 cam1-ov7251 Select OV7251 for camera on port 1
68 cam1-ov9281 Select OV9281 for camera on port 1
69 cam1-imx290-clk-freq Set clock frequency for an IMX290 on port 1
70 @@ -874,6 +878,7 @@ Params: cam0-arducam-64mp Select A
71 cam2-imx708 Select IMX708 for camera on port 2
72 cam2-ov2311 Select OV2311 for camera on port 2
73 cam2-ov5647 Select OV5647 for camera on port 2
74 + cam2-ov64a40 Select OV64A40 for camera on port 2
75 cam2-ov7251 Select OV7251 for camera on port 2
76 cam2-ov9281 Select OV9281 for camera on port 2
77 cam2-imx290-clk-freq Set clock frequency for an IMX290 on port 2
78 @@ -886,6 +891,7 @@ Params: cam0-arducam-64mp Select A
79 cam3-imx708 Select IMX708 for camera on port 3
80 cam3-ov2311 Select OV2311 for camera on port 3
81 cam3-ov5647 Select OV5647 for camera on port 3
82 + cam3-ov64a40 Select OV64A40 for camera on port 3
83 cam3-ov7251 Select OV7251 for camera on port 3
84 cam3-ov9281 Select OV9281 for camera on port 3
85 cam3-imx290-clk-freq Set clock frequency for an IMX290 on port 3
86 @@ -3222,6 +3228,25 @@ Params: rotation Mounting
87 vcm Configure a VCM focus drive on the sensor.
91 +Info: Arducam OV64A40 camera module.
92 + Uses Unicam 1, which is the standard camera connector on most Pi
94 +Load: dtoverlay=ov64a40,<param>=<val>
95 +Params: rotation Mounting rotation of the camera sensor (0 or
97 + orientation Sensor orientation (0 = front, 1 = rear,
98 + 2 = external, default external)
99 + media-controller Configure use of Media Controller API for
100 + configuring the sensor (default on)
101 + cam0 Adopt the default configuration for CAM0 on a
102 + Compute Module (CSI0, i2c_vc, and cam0_reg).
103 + vcm Select lens driver state. Default is enabled,
104 + but vcm=off will disable.
105 + link-frequency Allowable link frequency values to use in Hz:
106 + 456000000 (default), 360000000
110 Info: Omnivision OV7251 camera module.
111 Uses Unicam 1, which is the standard camera connector on most Pi
112 --- a/arch/arm/boot/dts/overlays/camera-mux-2port-overlay.dts
113 +++ b/arch/arm/boot/dts/overlays/camera-mux-2port-overlay.dts
119 + #define cam_node ov64a40_0
120 + #define cam_endpoint ov64a40_0_ep
121 + #define vcm_node ov64a40_0_vcm
122 + #define cam1_clk clk_24mhz
123 + #include "ov64a40.dtsi"
125 + #undef cam_endpoint
136 + #define cam_node ov64a40_1
137 + #define cam_endpoint ov64a40_1_ep
138 + #define vcm_node ov64a40_1_vcm
139 + #define cam1_clk clk_24mhz
140 + #include "ov64a40.dtsi"
142 + #undef cam_endpoint
149 cam0-ov2311 = <&mux_in0>, "remote-endpoint:0=",<&ov2311_0_ep>,
150 <&ov2311_0_ep>, "remote-endpoint:0=",<&mux_in0>,
151 <&ov2311_0>, "status=okay";
152 + cam0-ov64a40 = <&mux_in0>, "remote-endpoint:0=",<&ov64a40_0_ep>,
153 + <&ov64a40_0_ep>, "remote-endpoint:0=",<&mux_in0>,
154 + <&mux_in0>, "clock-noncontinuous?",
155 + <&ov64a40_0>, "status=okay",
156 + <&ov64a40_0_vcm>, "status=okay",
157 + <&ov64a40_0>,"lens-focus:0=", <&ov64a40_0_vcm>;
159 cam1-arducam-64mp = <&mux_in1>, "remote-endpoint:0=",<&arducam_64mp_1_ep>,
160 <&arducam_64mp_1_ep>, "remote-endpoint:0=",<&mux_in1>,
162 cam1-ov2311 = <&mux_in1>, "remote-endpoint:0=",<&ov2311_1_ep>,
163 <&ov2311_1_ep>, "remote-endpoint:0=",<&mux_in1>,
164 <&ov2311_1>, "status=okay";
165 + cam1-ov64a40 = <&mux_in1>, "remote-endpoint:0=",<&ov64a40_1_ep>,
166 + <&ov64a40_1_ep>, "remote-endpoint:0=",<&mux_in1>,
167 + <&mux_in1>, "clock-noncontinuous?",
168 + <&ov64a40_1>, "status=okay",
169 + <&ov64a40_1_vcm>, "status=okay",
170 + <&ov64a40_1>,"lens-focus:0=", <&ov64a40_1_vcm>;
172 cam0-imx290-clk-freq = <&clk_imx290>,"clock-frequency:0",
173 <&imx290_0>,"clock-frequency:0";
174 --- a/arch/arm/boot/dts/overlays/camera-mux-4port-overlay.dts
175 +++ b/arch/arm/boot/dts/overlays/camera-mux-4port-overlay.dts
181 + #define cam_node ov64a40_0
182 + #define cam_endpoint ov64a40_0_ep
183 + #define vcm_node ov64a40_0_vcm
184 + #define cam1_clk clk_24mhz
185 + #include "ov64a40.dtsi"
187 + #undef cam_endpoint
198 + #define cam_node ov64a40_1
199 + #define cam_endpoint ov64a40_1_ep
200 + #define vcm_node ov64a40_1_vcm
201 + #define cam1_clk clk_24mhz
202 + #include "ov64a40.dtsi"
204 + #undef cam_endpoint
215 + #define cam_node ov64a40_2
216 + #define cam_endpoint ov64a40_2_ep
217 + #define vcm_node ov64a40_2_vcm
218 + #define cam1_clk clk_24mhz
219 + #include "ov64a40.dtsi"
221 + #undef cam_endpoint
232 + #define cam_node ov64a40_3
233 + #define cam_endpoint ov64a40_3_ep
234 + #define vcm_node ov64a40_3_vcm
235 + #define cam1_clk clk_24mhz
236 + #include "ov64a40.dtsi"
238 + #undef cam_endpoint
245 cam0-ov2311 = <&mux_in0>, "remote-endpoint:0=",<&ov2311_0_ep>,
246 <&ov2311_0_ep>, "remote-endpoint:0=",<&mux_in0>,
247 <&ov2311_0>, "status=okay";
248 + cam0-ov64a40 = <&mux_in0>, "remote-endpoint:0=",<&ov64a40_0_ep>,
249 + <&ov64a40_0_ep>, "remote-endpoint:0=",<&mux_in0>,
250 + <&mux_in0>, "clock-noncontinuous?",
251 + <&ov64a40_0>, "status=okay",
252 + <&ov64a40_0_vcm>, "status=okay",
253 + <&ov64a40_0>,"lens-focus:0=", <&ov64a40_0_vcm>;
255 cam1-arducam-64mp = <&mux_in1>, "remote-endpoint:0=",<&arducam_64mp_1_ep>,
256 <&arducam_64mp_1_ep>, "remote-endpoint:0=",<&mux_in1>,
258 cam1-ov2311 = <&mux_in1>, "remote-endpoint:0=",<&ov2311_1_ep>,
259 <&ov2311_1_ep>, "remote-endpoint:0=",<&mux_in1>,
260 <&ov2311_1>, "status=okay";
261 + cam1-ov64a40 = <&mux_in1>, "remote-endpoint:0=",<&ov64a40_1_ep>,
262 + <&ov64a40_1_ep>, "remote-endpoint:0=",<&mux_in1>,
263 + <&mux_in1>, "clock-noncontinuous?",
264 + <&ov64a40_1>, "status=okay",
265 + <&ov64a40_1_vcm>, "status=okay",
266 + <&ov64a40_1>,"lens-focus:0=", <&ov64a40_1_vcm>;
268 cam2-arducam-64mp = <&mux_in2>, "remote-endpoint:0=",<&arducam_64mp_2_ep>,
269 <&arducam_64mp_2_ep>, "remote-endpoint:0=",<&mux_in2>,
271 cam2-ov2311 = <&mux_in2>, "remote-endpoint:0=",<&ov2311_2_ep>,
272 <&ov2311_2_ep>, "remote-endpoint:0=",<&mux_in2>,
273 <&ov2311_2>, "status=okay";
274 + cam2-ov64a40 = <&mux_in2>, "remote-endpoint:0=",<&ov64a40_2_ep>,
275 + <&ov64a40_2_ep>, "remote-endpoint:0=",<&mux_in2>,
276 + <&mux_in2>, "clock-noncontinuous?",
277 + <&ov64a40_2>, "status=okay",
278 + <&ov64a40_2_vcm>, "status=okay",
279 + <&ov64a40_2>,"lens-focus:0=", <&ov64a40_2_vcm>;
281 cam3-arducam-64mp = <&mux_in3>, "remote-endpoint:0=",<&arducam_64mp_3_ep>,
282 <&arducam_64mp_3_ep>, "remote-endpoint:0=",<&mux_in3>,
284 cam3-ov2311 = <&mux_in3>, "remote-endpoint:0=",<&ov2311_3_ep>,
285 <&ov2311_3_ep>, "remote-endpoint:0=",<&mux_in3>,
286 <&ov2311_3>, "status=okay";
287 + cam3-ov64a40 = <&mux_in3>, "remote-endpoint:0=",<&ov64a40_3_ep>,
288 + <&ov64a40_3_ep>, "remote-endpoint:0=",<&mux_in3>,
289 + <&mux_in3>, "clock-noncontinuous?",
290 + <&ov64a40_3>, "status=okay",
291 + <&ov64a40_3_vcm>, "status=okay",
292 + <&ov64a40_3>,"lens-focus:0=", <&ov64a40_3_vcm>;
294 cam0-imx290-clk-freq = <&clk_imx290>,"clock-frequency:0",
295 <&imx290_0>,"clock-frequency:0";
297 +++ b/arch/arm/boot/dts/overlays/ov64a40-overlay.dts
299 +// SPDX-License-Identifier: GPL-2.0-only
300 +// Definitions for OV64A40 camera module on VC I2C bus
305 + compatible = "brcm,bcm2835";
307 + i2c_frag: fragment@0 {
308 + target = <&i2c_csi_dsi>;
310 + #address-cells = <1>;
314 + #include "ov64a40.dtsi"
318 + csi_frag: fragment@1 {
322 + brcm,media-controller;
326 + remote-endpoint = <&cam_endpoint>;
328 + data-lanes = <1 2>;
335 + target = <&i2c0if>;
341 + clk_frag: fragment@3 {
342 + target = <&cam1_clk>;
344 + clock-frequency = <24000000>;
350 + target = <&i2c0mux>;
357 + target = <&cam_node>;
359 + lens-focus = <&vcm_node>;
364 + rotation = <&cam_node>,"rotation:0";
365 + orientation = <&cam_node>,"orientation:0";
366 + media-controller = <&csi>,"brcm,media-controller?";
367 + cam0 = <&i2c_frag>, "target:0=",<&i2c_csi_dsi0>,
368 + <&csi_frag>, "target:0=",<&csi0>,
369 + <&clk_frag>, "target:0=",<&cam0_clk>,
370 + <&cam_node>, "clocks:0=",<&cam0_clk>,
371 + <&cam_node>, "avdd-supply:0=",<&cam0_reg>,
372 + <&vcm_node>, "vdd-supply:0=",<&cam0_reg>;
373 + vcm = <&vcm_node>, "status",
375 + link-frequency = <&cam_endpoint>,"link-frequencies#0";
384 + remote-endpoint = <&csi_ep>;
391 +++ b/arch/arm/boot/dts/overlays/ov64a40.dtsi
393 +// Fragment that configures an OV64A40
395 +cam_node: ov64a40@36 {
396 + compatible = "ovti,ov64a40";
398 + status = "disabled";
400 + clocks = <&cam1_clk>;
401 + clock-names = "xclk";
403 + avdd-supply = <&cam1_reg>; /* 2.8v */
404 + dovdd-supply = <&cam_dummy_reg>;/* 1.8v */
405 + dvdd-supply = <&cam_dummy_reg>; /* 1.1v */
411 + cam_endpoint: endpoint {
414 + data-lanes = <1 2>;
416 + /bits/ 64 <456000000>;
421 +vcm_node: bu64754@76 {
422 + compatible = "rohm,bu64754";
424 + status = "disabled";
425 + vdd-supply = <&cam1_reg>;