Skip to content

Commit 8386108

Browse files
committed
dtoverlays: Add overlay for IMX662
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
1 parent ceb3d4c commit 8386108

File tree

4 files changed

+176
-0
lines changed

4 files changed

+176
-0
lines changed

arch/arm/boot/dts/overlays/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \
149149
imx500.dtbo \
150150
imx500-pi5.dtbo \
151151
imx519.dtbo \
152+
imx662.dtbo \
152153
imx708.dtbo \
153154
interludeaudio-analog.dtbo \
154155
interludeaudio-digital.dtbo \

arch/arm/boot/dts/overlays/README

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3114,6 +3114,34 @@ Params: rotation Mounting rotation of the camera sensor (0 or
31143114
but vcm=off will disable.
31153115

31163116

3117+
Name: imx662
3118+
Info: Sony IMX662 camera module.
3119+
Uses Unicam 1, which is the standard camera connector on most Pi
3120+
variants.
3121+
Load: dtoverlay=imx662,<param>
3122+
Params: 4lane Enable 4 CSI2 lanes. This requires a Compute
3123+
Module (1, 3, 4, or 5) or Pi 5.
3124+
clock-frequency Sets the clock frequency to match that used on
3125+
the board. Default 24MHz
3126+
mono Denote that the module is a mono sensor.
3127+
orientation Sensor orientation (0 = front, 1 = rear,
3128+
2 = external, default external)
3129+
rotation Mounting rotation of the camera sensor (0 or
3130+
180, default 0)
3131+
media-controller Configure use of Media Controller API for
3132+
configuring the sensor (default on)
3133+
cam0 Adopt the default configuration for CAM0 on a
3134+
Compute Module (CSI0, i2c_vc, and cam0_reg).
3135+
vcm Enable a VCM focus drive on the sensor.
3136+
link-frequency Link frequency to use in Hz. Valid values of
3137+
297000000, 360000000, 445500000,
3138+
594000000 (default), 720000000, 891000000,
3139+
1039500000, and 1188000000.
3140+
Values above 594000000 are unlikely to work on
3141+
Pi0-4, and above 720000000 are not guaranteed to
3142+
work on Pi5.
3143+
3144+
31173145
Name: imx708
31183146
Info: Sony IMX708 camera module.
31193147
Uses Unicam 1, which is the standard camera connector on most Pi
Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
// SPDX-License-Identifier: GPL-2.0-only
2+
// Definitions for IMX662 camera module on VC I2C bus
3+
/dts-v1/;
4+
/plugin/;
5+
6+
#include <dt-bindings/gpio/gpio.h>
7+
8+
/{
9+
compatible = "brcm,bcm2835";
10+
11+
fragment@0 {
12+
target = <&i2c0if>;
13+
__overlay__ {
14+
status = "okay";
15+
};
16+
};
17+
18+
clk_frag: fragment@1 {
19+
target = <&cam1_clk>;
20+
clk: __overlay__ {
21+
status = "okay";
22+
clock-frequency = <24000000>;
23+
};
24+
};
25+
26+
fragment@2 {
27+
target = <&i2c0mux>;
28+
__overlay__ {
29+
status = "okay";
30+
};
31+
};
32+
33+
reg_frag: fragment@3 {
34+
target = <&cam1_reg>;
35+
cam_reg: __overlay__ {
36+
startup-delay-us = <300000>;
37+
};
38+
};
39+
40+
i2c_frag: fragment@100 {
41+
target = <&i2c_csi_dsi>;
42+
__overlay__ {
43+
#address-cells = <1>;
44+
#size-cells = <0>;
45+
status = "okay";
46+
47+
#include "imx662.dtsi"
48+
49+
vcm: ad5398@c {
50+
compatible = "adi,ad5398";
51+
reg = <0x0c>;
52+
status = "disabled";
53+
VANA-supply = <&cam1_reg>;
54+
};
55+
};
56+
};
57+
58+
csi_frag: fragment@101 {
59+
target = <&csi1>;
60+
csi: __overlay__ {
61+
status = "okay";
62+
63+
port {
64+
csi_ep: endpoint {
65+
remote-endpoint = <&cam_endpoint>;
66+
clock-lanes = <0>;
67+
data-lanes = <1 2>;
68+
clock-noncontinuous;
69+
};
70+
};
71+
};
72+
};
73+
74+
fragment@102 {
75+
target = <&csi1>;
76+
__dormant__ {
77+
compatible = "brcm,bcm2835-unicam-legacy";
78+
};
79+
};
80+
81+
fragment@201 {
82+
target = <&csi_ep>;
83+
__dormant__ {
84+
data-lanes = <1 2 3 4>;
85+
};
86+
};
87+
88+
fragment@202 {
89+
target = <&cam_endpoint>;
90+
__dormant__ {
91+
data-lanes = <1 2 3 4>;
92+
};
93+
};
94+
95+
__overrides__ {
96+
rotation = <&cam_node>,"rotation:0";
97+
orientation = <&cam_node>,"orientation:0";
98+
media-controller = <0>,"!102";
99+
cam0 = <&i2c_frag>, "target:0=",<&i2c_csi_dsi0>,
100+
<&csi_frag>, "target:0=",<&csi0>,
101+
<&clk_frag>, "target:0=",<&cam0_clk>,
102+
<&cam_node>, "clocks:0=",<&cam0_clk>,
103+
<&reg_frag>, "target:0=",<&cam0_reg>,
104+
<&cam_node>, "VANA-supply:0=",<&cam0_reg>,
105+
<&vcm>, "VANA-supply:0=", <&cam0_reg>;
106+
vcm = <&vcm>, "status=okay",
107+
<&cam_node>,"lens-focus:0=", <&vcm>;
108+
4lane = <0>, "+201+202";
109+
clock-frequency = <&clk>,"clock-frequency:0";
110+
link-frequency = <&cam_endpoint>,"link-frequencies#0";
111+
mono = <&cam_node>,"compatible=sony,imx662aamr";
112+
};
113+
};
114+
115+
&cam_node {
116+
status = "okay";
117+
};
118+
119+
&cam_endpoint {
120+
remote-endpoint = <&csi_ep>;
121+
};
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// Fragment that configures an imx662
2+
3+
cam_node: imx662@1a {
4+
compatible = "sony,imx662aaqr";
5+
reg = <0x1a>;
6+
status = "disabled";
7+
8+
clocks = <&cam1_clk>;
9+
10+
avdd-supply = <&cam1_reg>; /* 2.8v */
11+
dvdd-supply = <&cam_dummy_reg>; /* 1.8v */
12+
ovdd-supply = <&cam_dummy_reg>;/* 1.2v */
13+
14+
rotation = <180>;
15+
orientation = <2>;
16+
17+
port {
18+
cam_endpoint: endpoint {
19+
clock-lanes = <0>;
20+
data-lanes = <1 2>;
21+
clock-noncontinuous;
22+
link-frequencies =
23+
/bits/ 64 <594000000>;
24+
};
25+
};
26+
};

0 commit comments

Comments
 (0)