1 From f833b2697388eed0eae00fd2a027178d4beee6ec 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 0770/1085] overlays: Add overlay for the OV64A40 Arducam
7 Arducam have integrated an Omnivision OV64A40 with a ROHM BU64754 VCM
8 with a Raspberry Pi compatible cable pinout.
10 Provide an overlay to support the module.
12 Also add support to the camera mux overlays.
14 Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
15 Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
17 arch/arm/boot/dts/overlays/Makefile | 1 +
18 arch/arm/boot/dts/overlays/README | 25 +++++
19 .../dts/overlays/camera-mux-2port-overlay.dts | 32 +++++++
20 .../dts/overlays/camera-mux-4port-overlay.dts | 64 +++++++++++++
21 .../arm/boot/dts/overlays/ov64a40-overlay.dts | 91 +++++++++++++++++++
22 arch/arm/boot/dts/overlays/ov64a40.dtsi | 34 +++++++
23 6 files changed, 247 insertions(+)
24 create mode 100644 arch/arm/boot/dts/overlays/ov64a40-overlay.dts
25 create mode 100644 arch/arm/boot/dts/overlays/ov64a40.dtsi
27 --- a/arch/arm/boot/dts/overlays/Makefile
28 +++ b/arch/arm/boot/dts/overlays/Makefile
29 @@ -175,6 +175,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \
37 --- a/arch/arm/boot/dts/overlays/README
38 +++ b/arch/arm/boot/dts/overlays/README
39 @@ -817,6 +817,7 @@ Params: cam0-arducam-64mp Select A
40 cam0-imx708 Select IMX708 for camera on port 0
41 cam0-ov2311 Select OV2311 for camera on port 0
42 cam0-ov5647 Select OV5647 for camera on port 0
43 + cam0-ov64a40 Select OV64A40 for camera on port 0
44 cam0-ov7251 Select OV7251 for camera on port 0
45 cam0-ov9281 Select OV9281 for camera on port 0
46 cam0-imx290-clk-freq Set clock frequency for an IMX290 on port 0
47 @@ -829,6 +830,7 @@ Params: cam0-arducam-64mp Select A
48 cam1-imx708 Select IMX708 for camera on port 1
49 cam1-ov2311 Select OV2311 for camera on port 1
50 cam1-ov5647 Select OV5647 for camera on port 1
51 + cam1-ov64a40 Select OV64A40 for camera on port 1
52 cam1-ov7251 Select OV7251 for camera on port 1
53 cam1-ov9281 Select OV9281 for camera on port 1
54 cam1-imx290-clk-freq Set clock frequency for an IMX290 on port 1
55 @@ -850,6 +852,7 @@ Params: cam0-arducam-64mp Select A
56 cam0-imx708 Select IMX708 for camera on port 0
57 cam0-ov2311 Select OV2311 for camera on port 0
58 cam0-ov5647 Select OV5647 for camera on port 0
59 + cam0-ov64a40 Select OV64A40 for camera on port 0
60 cam0-ov7251 Select OV7251 for camera on port 0
61 cam0-ov9281 Select OV9281 for camera on port 0
62 cam0-imx290-clk-freq Set clock frequency for an IMX290 on port 0
63 @@ -862,6 +865,7 @@ Params: cam0-arducam-64mp Select A
64 cam1-imx708 Select IMX708 for camera on port 1
65 cam1-ov2311 Select OV2311 for camera on port 1
66 cam1-ov5647 Select OV5647 for camera on port 1
67 + cam1-ov64a40 Select OV64A40 for camera on port 1
68 cam1-ov7251 Select OV7251 for camera on port 1
69 cam1-ov9281 Select OV9281 for camera on port 1
70 cam1-imx290-clk-freq Set clock frequency for an IMX290 on port 1
71 @@ -874,6 +878,7 @@ Params: cam0-arducam-64mp Select A
72 cam2-imx708 Select IMX708 for camera on port 2
73 cam2-ov2311 Select OV2311 for camera on port 2
74 cam2-ov5647 Select OV5647 for camera on port 2
75 + cam2-ov64a40 Select OV64A40 for camera on port 2
76 cam2-ov7251 Select OV7251 for camera on port 2
77 cam2-ov9281 Select OV9281 for camera on port 2
78 cam2-imx290-clk-freq Set clock frequency for an IMX290 on port 2
79 @@ -886,6 +891,7 @@ Params: cam0-arducam-64mp Select A
80 cam3-imx708 Select IMX708 for camera on port 3
81 cam3-ov2311 Select OV2311 for camera on port 3
82 cam3-ov5647 Select OV5647 for camera on port 3
83 + cam3-ov64a40 Select OV64A40 for camera on port 3
84 cam3-ov7251 Select OV7251 for camera on port 3
85 cam3-ov9281 Select OV9281 for camera on port 3
86 cam3-imx290-clk-freq Set clock frequency for an IMX290 on port 3
87 @@ -3222,6 +3228,25 @@ Params: rotation Mounting
88 vcm Configure a VCM focus drive on the sensor.
92 +Info: Arducam OV64A40 camera module.
93 + Uses Unicam 1, which is the standard camera connector on most Pi
95 +Load: dtoverlay=ov64a40,<param>=<val>
96 +Params: rotation Mounting rotation of the camera sensor (0 or
98 + orientation Sensor orientation (0 = front, 1 = rear,
99 + 2 = external, default external)
100 + media-controller Configure use of Media Controller API for
101 + configuring the sensor (default on)
102 + cam0 Adopt the default configuration for CAM0 on a
103 + Compute Module (CSI0, i2c_vc, and cam0_reg).
104 + vcm Select lens driver state. Default is enabled,
105 + but vcm=off will disable.
106 + link-frequency Allowable link frequency values to use in Hz:
107 + 456000000 (default), 360000000
111 Info: Omnivision OV7251 camera module.
112 Uses Unicam 1, which is the standard camera connector on most Pi
113 --- a/arch/arm/boot/dts/overlays/camera-mux-2port-overlay.dts
114 +++ b/arch/arm/boot/dts/overlays/camera-mux-2port-overlay.dts
120 + #define cam_node ov64a40_0
121 + #define cam_endpoint ov64a40_0_ep
122 + #define vcm_node ov64a40_0_vcm
123 + #define cam1_clk clk_24mhz
124 + #include "ov64a40.dtsi"
126 + #undef cam_endpoint
137 + #define cam_node ov64a40_1
138 + #define cam_endpoint ov64a40_1_ep
139 + #define vcm_node ov64a40_1_vcm
140 + #define cam1_clk clk_24mhz
141 + #include "ov64a40.dtsi"
143 + #undef cam_endpoint
150 cam0-ov2311 = <&mux_in0>, "remote-endpoint:0=",<&ov2311_0_ep>,
151 <&ov2311_0_ep>, "remote-endpoint:0=",<&mux_in0>,
152 <&ov2311_0>, "status=okay";
153 + cam0-ov64a40 = <&mux_in0>, "remote-endpoint:0=",<&ov64a40_0_ep>,
154 + <&ov64a40_0_ep>, "remote-endpoint:0=",<&mux_in0>,
155 + <&mux_in0>, "clock-noncontinuous?",
156 + <&ov64a40_0>, "status=okay",
157 + <&ov64a40_0_vcm>, "status=okay",
158 + <&ov64a40_0>,"lens-focus:0=", <&ov64a40_0_vcm>;
160 cam1-arducam-64mp = <&mux_in1>, "remote-endpoint:0=",<&arducam_64mp_1_ep>,
161 <&arducam_64mp_1_ep>, "remote-endpoint:0=",<&mux_in1>,
163 cam1-ov2311 = <&mux_in1>, "remote-endpoint:0=",<&ov2311_1_ep>,
164 <&ov2311_1_ep>, "remote-endpoint:0=",<&mux_in1>,
165 <&ov2311_1>, "status=okay";
166 + cam1-ov64a40 = <&mux_in1>, "remote-endpoint:0=",<&ov64a40_1_ep>,
167 + <&ov64a40_1_ep>, "remote-endpoint:0=",<&mux_in1>,
168 + <&mux_in1>, "clock-noncontinuous?",
169 + <&ov64a40_1>, "status=okay",
170 + <&ov64a40_1_vcm>, "status=okay",
171 + <&ov64a40_1>,"lens-focus:0=", <&ov64a40_1_vcm>;
173 cam0-imx290-clk-freq = <&clk_imx290>,"clock-frequency:0",
174 <&imx290_0>,"clock-frequency:0";
175 --- a/arch/arm/boot/dts/overlays/camera-mux-4port-overlay.dts
176 +++ b/arch/arm/boot/dts/overlays/camera-mux-4port-overlay.dts
182 + #define cam_node ov64a40_0
183 + #define cam_endpoint ov64a40_0_ep
184 + #define vcm_node ov64a40_0_vcm
185 + #define cam1_clk clk_24mhz
186 + #include "ov64a40.dtsi"
188 + #undef cam_endpoint
199 + #define cam_node ov64a40_1
200 + #define cam_endpoint ov64a40_1_ep
201 + #define vcm_node ov64a40_1_vcm
202 + #define cam1_clk clk_24mhz
203 + #include "ov64a40.dtsi"
205 + #undef cam_endpoint
216 + #define cam_node ov64a40_2
217 + #define cam_endpoint ov64a40_2_ep
218 + #define vcm_node ov64a40_2_vcm
219 + #define cam1_clk clk_24mhz
220 + #include "ov64a40.dtsi"
222 + #undef cam_endpoint
233 + #define cam_node ov64a40_3
234 + #define cam_endpoint ov64a40_3_ep
235 + #define vcm_node ov64a40_3_vcm
236 + #define cam1_clk clk_24mhz
237 + #include "ov64a40.dtsi"
239 + #undef cam_endpoint
246 cam0-ov2311 = <&mux_in0>, "remote-endpoint:0=",<&ov2311_0_ep>,
247 <&ov2311_0_ep>, "remote-endpoint:0=",<&mux_in0>,
248 <&ov2311_0>, "status=okay";
249 + cam0-ov64a40 = <&mux_in0>, "remote-endpoint:0=",<&ov64a40_0_ep>,
250 + <&ov64a40_0_ep>, "remote-endpoint:0=",<&mux_in0>,
251 + <&mux_in0>, "clock-noncontinuous?",
252 + <&ov64a40_0>, "status=okay",
253 + <&ov64a40_0_vcm>, "status=okay",
254 + <&ov64a40_0>,"lens-focus:0=", <&ov64a40_0_vcm>;
256 cam1-arducam-64mp = <&mux_in1>, "remote-endpoint:0=",<&arducam_64mp_1_ep>,
257 <&arducam_64mp_1_ep>, "remote-endpoint:0=",<&mux_in1>,
259 cam1-ov2311 = <&mux_in1>, "remote-endpoint:0=",<&ov2311_1_ep>,
260 <&ov2311_1_ep>, "remote-endpoint:0=",<&mux_in1>,
261 <&ov2311_1>, "status=okay";
262 + cam1-ov64a40 = <&mux_in1>, "remote-endpoint:0=",<&ov64a40_1_ep>,
263 + <&ov64a40_1_ep>, "remote-endpoint:0=",<&mux_in1>,
264 + <&mux_in1>, "clock-noncontinuous?",
265 + <&ov64a40_1>, "status=okay",
266 + <&ov64a40_1_vcm>, "status=okay",
267 + <&ov64a40_1>,"lens-focus:0=", <&ov64a40_1_vcm>;
269 cam2-arducam-64mp = <&mux_in2>, "remote-endpoint:0=",<&arducam_64mp_2_ep>,
270 <&arducam_64mp_2_ep>, "remote-endpoint:0=",<&mux_in2>,
272 cam2-ov2311 = <&mux_in2>, "remote-endpoint:0=",<&ov2311_2_ep>,
273 <&ov2311_2_ep>, "remote-endpoint:0=",<&mux_in2>,
274 <&ov2311_2>, "status=okay";
275 + cam2-ov64a40 = <&mux_in2>, "remote-endpoint:0=",<&ov64a40_2_ep>,
276 + <&ov64a40_2_ep>, "remote-endpoint:0=",<&mux_in2>,
277 + <&mux_in2>, "clock-noncontinuous?",
278 + <&ov64a40_2>, "status=okay",
279 + <&ov64a40_2_vcm>, "status=okay",
280 + <&ov64a40_2>,"lens-focus:0=", <&ov64a40_2_vcm>;
282 cam3-arducam-64mp = <&mux_in3>, "remote-endpoint:0=",<&arducam_64mp_3_ep>,
283 <&arducam_64mp_3_ep>, "remote-endpoint:0=",<&mux_in3>,
285 cam3-ov2311 = <&mux_in3>, "remote-endpoint:0=",<&ov2311_3_ep>,
286 <&ov2311_3_ep>, "remote-endpoint:0=",<&mux_in3>,
287 <&ov2311_3>, "status=okay";
288 + cam3-ov64a40 = <&mux_in3>, "remote-endpoint:0=",<&ov64a40_3_ep>,
289 + <&ov64a40_3_ep>, "remote-endpoint:0=",<&mux_in3>,
290 + <&mux_in3>, "clock-noncontinuous?",
291 + <&ov64a40_3>, "status=okay",
292 + <&ov64a40_3_vcm>, "status=okay",
293 + <&ov64a40_3>,"lens-focus:0=", <&ov64a40_3_vcm>;
295 cam0-imx290-clk-freq = <&clk_imx290>,"clock-frequency:0",
296 <&imx290_0>,"clock-frequency:0";
298 +++ b/arch/arm/boot/dts/overlays/ov64a40-overlay.dts
300 +// SPDX-License-Identifier: GPL-2.0-only
301 +// Definitions for OV64A40 camera module on VC I2C bus
306 + compatible = "brcm,bcm2835";
308 + i2c_frag: fragment@0 {
309 + target = <&i2c_csi_dsi>;
311 + #address-cells = <1>;
315 + #include "ov64a40.dtsi"
319 + csi_frag: fragment@1 {
323 + brcm,media-controller;
327 + remote-endpoint = <&cam_endpoint>;
329 + data-lanes = <1 2>;
336 + target = <&i2c0if>;
342 + clk_frag: fragment@3 {
343 + target = <&cam1_clk>;
345 + clock-frequency = <24000000>;
351 + target = <&i2c0mux>;
358 + target = <&cam_node>;
360 + lens-focus = <&vcm_node>;
365 + rotation = <&cam_node>,"rotation:0";
366 + orientation = <&cam_node>,"orientation:0";
367 + media-controller = <&csi>,"brcm,media-controller?";
368 + cam0 = <&i2c_frag>, "target:0=",<&i2c_csi_dsi0>,
369 + <&csi_frag>, "target:0=",<&csi0>,
370 + <&clk_frag>, "target:0=",<&cam0_clk>,
371 + <&cam_node>, "clocks:0=",<&cam0_clk>,
372 + <&cam_node>, "avdd-supply:0=",<&cam0_reg>,
373 + <&vcm_node>, "vdd-supply:0=",<&cam0_reg>;
374 + vcm = <&vcm_node>, "status",
376 + link-frequency = <&cam_endpoint>,"link-frequencies#0";
385 + remote-endpoint = <&csi_ep>;
392 +++ b/arch/arm/boot/dts/overlays/ov64a40.dtsi
394 +// Fragment that configures an OV64A40
396 +cam_node: ov64a40@36 {
397 + compatible = "ovti,ov64a40";
399 + status = "disabled";
401 + clocks = <&cam1_clk>;
402 + clock-names = "xclk";
404 + avdd-supply = <&cam1_reg>; /* 2.8v */
405 + dovdd-supply = <&cam_dummy_reg>;/* 1.8v */
406 + dvdd-supply = <&cam_dummy_reg>; /* 1.1v */
412 + cam_endpoint: endpoint {
415 + data-lanes = <1 2>;
417 + /bits/ 64 <456000000>;
422 +vcm_node: bu64754@76 {
423 + compatible = "rohm,bu64754";
425 + status = "disabled";
426 + vdd-supply = <&cam1_reg>;