1 From 57250281004e141dff4662d1abb3f31982ec01ee Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 Date: Tue, 19 May 2020 13:35:17 +0100
4 Subject: [PATCH] dtoverlays: Add an overlay for the Sony IMX290
7 Adds an overlay to configure the IMX290 image sensor.
9 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
11 arch/arm/boot/dts/overlays/Makefile | 1 +
12 arch/arm/boot/dts/overlays/README | 16 ++
13 arch/arm/boot/dts/overlays/imx290-overlay.dts | 32 ++++
14 .../boot/dts/overlays/imx290_327-overlay.dtsi | 145 ++++++++++++++++++
15 4 files changed, 194 insertions(+)
16 create mode 100644 arch/arm/boot/dts/overlays/imx290-overlay.dts
17 create mode 100644 arch/arm/boot/dts/overlays/imx290_327-overlay.dtsi
19 --- a/arch/arm/boot/dts/overlays/Makefile
20 +++ b/arch/arm/boot/dts/overlays/Makefile
21 @@ -85,6 +85,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \
29 --- a/arch/arm/boot/dts/overlays/README
30 +++ b/arch/arm/boot/dts/overlays/README
31 @@ -1430,6 +1430,22 @@ Load: dtoverlay=imx219
36 +Info: Sony IMX290 camera module.
37 + Uses Unicam 1, which is the standard camera connector on most Pi
38 + variants. NB This currently uses 4 CSI2 data lanes and therefore will
40 +Load: dtoverlay=imx290,<param>
41 +Params: 4lane Enable 4 CSI2 lanes. This requires a Compute
42 + Module (1, 3, or 4).
43 + clock-frequency Sets the clock frequency to match that used on
45 + Modules from Vision Components use 37.125MHz
46 + (the default), whilst those from Innomaker use
48 + mono Denote that the module is a mono sensor.
52 Info: Sony IMX477 camera module.
53 Uses Unicam 1, which is the standard camera connector on most Pi
55 +++ b/arch/arm/boot/dts/overlays/imx290-overlay.dts
57 +// SPDX-License-Identifier: GPL-2.0-only
58 +// Definitions for IMX290 camera module on VC I2C bus
62 +#include <dt-bindings/gpio/gpio.h>
63 +#include "imx290_327-overlay.dtsi"
66 + compatible = "brcm,bcm2835";
68 + // Fragment numbers deliberately high to avoid conflicts with the
69 + // included imx290_327 overlay file.
74 + compatible = "sony,imx290";
81 + compatible = "sony,imx290-mono";
86 + mono = <0>, "-101+102";
90 +++ b/arch/arm/boot/dts/overlays/imx290_327-overlay.dtsi
92 +// SPDX-License-Identifier: GPL-2.0-only
93 +// Partial definitions for IMX290 or IMX327 camera module on VC I2C bus
94 +// The compatible string should be set in an overlay that then includes this one
98 +#include <dt-bindings/gpio/gpio.h>
101 + compatible = "brcm,bcm2835";
104 + target = <&i2c_csi_dsi>;
106 + #address-cells = <1>;
110 + imx290: imx290@1a {
114 + clocks = <&imx290_clk>;
115 + clock-names = "xclk";
116 + clock-frequency = <37125000>;
118 + vdda-supply = <&imx290_vdda>; /* 2.8v */
119 + vdddo-supply = <&imx290_vdddo>; /* 1.8v */
120 + vddd-supply = <&imx290_vddd>; /* 1.5v */
123 + imx290_0: endpoint {
124 + remote-endpoint = <&csi1_ep>;
138 + csi1_ep: endpoint {
139 + remote-endpoint = <&imx290_0>;
146 + target = <&i2c0if>;
155 + imx290_vdda: fixedregulator@0 {
156 + compatible = "regulator-fixed";
157 + regulator-name = "imx290_vdda";
158 + regulator-min-microvolt = <2800000>;
159 + regulator-max-microvolt = <2800000>;
160 + gpio = <&gpio 41 GPIO_ACTIVE_HIGH>;
161 + enable-active-high;
163 + imx290_vdddo: fixedregulator@1 {
164 + compatible = "regulator-fixed";
165 + regulator-name = "imx290_vdddo";
166 + regulator-min-microvolt = <1800000>;
167 + regulator-max-microvolt = <1800000>;
169 + imx290_vddd: fixedregulator@2 {
170 + compatible = "regulator-fixed";
171 + regulator-name = "imx290_vddd";
172 + regulator-min-microvolt = <1500000>;
173 + regulator-max-microvolt = <1500000>;
176 + imx290_clk: camera-clk {
177 + compatible = "fixed-clock";
178 + #clock-cells = <0>;
179 + clock-frequency = <37125000>;
185 + target = <&i2c0mux>;
192 + target-path="/__overrides__";
194 + cam0-pwdn-ctrl = <&imx290_vdda>,"gpio:0";
195 + cam0-pwdn = <&imx290_vdda>,"gpio:4";
200 + target = <&imx290_0>;
202 + data-lanes = <1 2>;
204 + /bits/ 64 <445500000 297000000>;
209 + target = <&imx290_0>;
211 + data-lanes = <1 2 3 4>;
213 + /bits/ 64 <222750000 148500000>;
218 + target = <&csi1_ep>;
220 + data-lanes = <1 2>;
225 + target = <&csi1_ep>;
227 + data-lanes = <1 2 3 4>;
232 + 4lane = <0>, "-6+7-8+9";
233 + clock-frequency = <&imx290_clk>,"clock-frequency:0",
234 + <&imx290>,"clock-frequency:0";