1 From a36565341b0b144ea37c4793793e3c835cc6458d Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 Date: Thu, 10 Jun 2021 17:42:47 +0100
4 Subject: [PATCH] dtoverlays: Add overlay for Sony IMX258 image sensor
6 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
8 arch/arm/boot/dts/overlays/Makefile | 1 +
9 arch/arm/boot/dts/overlays/README | 18 +++
10 arch/arm/boot/dts/overlays/imx258-overlay.dts | 148 ++++++++++++++++++
11 3 files changed, 167 insertions(+)
12 create mode 100644 arch/arm/boot/dts/overlays/imx258-overlay.dts
14 --- a/arch/arm/boot/dts/overlays/Makefile
15 +++ b/arch/arm/boot/dts/overlays/Makefile
16 @@ -98,6 +98,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \
24 --- a/arch/arm/boot/dts/overlays/README
25 +++ b/arch/arm/boot/dts/overlays/README
26 @@ -1872,6 +1872,24 @@ Params: rotation Mounting
27 vcm Configure a VCM focus drive on the sensor.
31 +Info: Sony IMX258 camera module.
32 + Uses Unicam 1, which is the standard camera connector on most Pi
34 +Load: dtoverlay=imx258,<param>=<val>
35 +Params: rotation Mounting rotation of the camera sensor (0 or
37 + orientation Sensor orientation (0 = front, 1 = rear,
38 + 2 = external, default external)
39 + media-controller Configure use of Media Controller API for
40 + configuring the sensor (default on)
41 + cam0 Adopt the default configuration for CAM0 on a
42 + Compute Module (CSI0, i2c_vc, and cam0_reg).
43 + vcm Configure a VCM focus drive on the sensor.
44 + 4lane Enable 4 CSI2 lanes. This requires a Compute
45 + Module (1, 3, or 4).
49 Info: Sony IMX290 camera module.
50 Uses Unicam 1, which is the standard camera connector on most Pi
52 +++ b/arch/arm/boot/dts/overlays/imx258-overlay.dts
54 +// SPDX-License-Identifier: GPL-2.0-only
55 +// Definitions for IMX258 camera module on VC I2C bus
59 +#include <dt-bindings/gpio/gpio.h>
62 + compatible = "brcm,bcm2835";
71 + clk_frag: fragment@3 {
72 + target = <&cam1_clk>;
73 + cam_clk: __overlay__ {
74 + clock-frequency = <24000000>;
80 + target = <&i2c0mux>;
86 + reg_frag: fragment@5 {
87 + target = <&cam1_reg>;
88 + cam_reg: __overlay__ {
89 + regulator-name = "imx258_vana";
90 + startup-delay-us = <300000>;
91 + regulator-min-microvolt = <2700000>;
92 + regulator-max-microvolt = <2700000>;
96 + i2c_frag: fragment@100 {
97 + target = <&i2c_csi_dsi>;
99 + #address-cells = <1>;
103 + imx258: imx258@10 {
104 + compatible = "sony,imx258";
108 + clocks = <&cam1_clk>;
109 + clock-names = "xclk";
111 + vana-supply = <&cam1_reg>; /* 2.8v */
112 + vdig-supply = <&cam_dummy_reg>; /* 1.05v */
113 + vif-supply = <&cam_dummy_reg>; /* 1.8v */
119 + imx258_0: endpoint {
120 + remote-endpoint = <&csi_ep>;
122 + clock-noncontinuous;
124 + /bits/ 64 <633600000
131 + compatible = "adi,ad5398";
133 + status = "disabled";
134 + VANA-supply = <&cam1_reg>;
139 + csi_frag: fragment@101 {
143 + brcm,media-controller;
147 + remote-endpoint = <&imx258_0>;
149 + clock-noncontinuous;
156 + target = <&imx258_0>;
158 + data-lanes = <1 2>;
159 + link-frequencies = /bits/ 64 <633600000
165 + target = <&imx258_0>;
167 + data-lanes = <1 2 3 4>;
169 + /bits/ 64 <633600000 320000000>;
174 + target = <&csi_ep>;
176 + data-lanes = <1 2>;
181 + target = <&csi_ep>;
183 + data-lanes = <1 2 3 4>;
188 + rotation = <&imx258>,"rotation:0";
189 + orientation = <&imx258>,"orientation:0";
190 + media-controller = <&csi>,"brcm,media-controller?";
191 + cam0 = <&i2c_frag>, "target:0=",<&i2c_vc>,
192 + <&csi_frag>, "target:0=",<&csi0>,
193 + <&clk_frag>, "target:0=",<&cam0_clk>,
194 + <®_frag>, "target:0=",<&cam0_reg>,
195 + <&imx258>, "clocks:0=",<&cam0_clk>,
196 + <&imx258>, "vana-supply:0=",<&cam0_reg>;
197 + vcm = <&vcm>, "status=okay",
198 + <&imx258>,"lens-focus:0=", <&vcm>;
199 + 4lane = <0>, "-102+103-104+105";