Skip to content

Commit

Permalink
dtoverlays: Add overlays for the IMX708 image sensor
Browse files Browse the repository at this point in the history
New overlay to support the Sony IMX708 image sensor.
This includes a VCM for lens control.
Also adds support to the camera mux overlays.

Signed-off-by: Dave Stevenson <[email protected]>
  • Loading branch information
6by9 authored and popcornmix committed Mar 14, 2023
1 parent 1a6543e commit fa45fc7
Show file tree
Hide file tree
Showing 6 changed files with 259 additions and 0 deletions.
1 change: 1 addition & 0 deletions arch/arm/boot/dts/overlays/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \
imx462.dtbo \
imx477.dtbo \
imx519.dtbo \
imx708.dtbo \
iqaudio-codec.dtbo \
iqaudio-dac.dtbo \
iqaudio-dacplus.dtbo \
Expand Down
23 changes: 23 additions & 0 deletions arch/arm/boot/dts/overlays/README
Original file line number Diff line number Diff line change
Expand Up @@ -716,6 +716,7 @@ Params: cam0-imx219 Select IMX219 for camera on port 0
cam0-imx258 Select IMX258 for camera on port 0
cam0-imx290 Select IMX290 for camera on port 0
cam0-imx477 Select IMX477 for camera on port 0
cam0-imx708 Select IMX708 for camera on port 0
cam0-ov2311 Select OV2311 for camera on port 0
cam0-ov5647 Select OV5647 for camera on port 0
cam0-ov7251 Select OV7251 for camera on port 0
Expand All @@ -725,6 +726,7 @@ Params: cam0-imx219 Select IMX219 for camera on port 0
cam1-imx258 Select IMX258 for camera on port 1
cam1-imx290 Select IMX290 for camera on port 1
cam1-imx477 Select IMX477 for camera on port 1
cam1-imx708 Select IMX708 for camera on port 1
cam1-ov2311 Select OV2311 for camera on port 1
cam1-ov5647 Select OV5647 for camera on port 1
cam1-ov7251 Select OV7251 for camera on port 1
Expand All @@ -741,6 +743,7 @@ Params: cam0-imx219 Select IMX219 for camera on port 0
cam0-imx258 Select IMX258 for camera on port 0
cam0-imx290 Select IMX290 for camera on port 0
cam0-imx477 Select IMX477 for camera on port 0
cam0-imx708 Select IMX708 for camera on port 0
cam0-ov2311 Select OV2311 for camera on port 0
cam0-ov5647 Select OV5647 for camera on port 0
cam0-ov7251 Select OV7251 for camera on port 0
Expand All @@ -750,6 +753,7 @@ Params: cam0-imx219 Select IMX219 for camera on port 0
cam1-imx258 Select IMX258 for camera on port 1
cam1-imx290 Select IMX290 for camera on port 1
cam1-imx477 Select IMX477 for camera on port 1
cam1-imx708 Select IMX708 for camera on port 1
cam1-ov2311 Select OV2311 for camera on port 1
cam1-ov5647 Select OV5647 for camera on port 1
cam1-ov7251 Select OV7251 for camera on port 1
Expand All @@ -759,6 +763,7 @@ Params: cam0-imx219 Select IMX219 for camera on port 0
cam2-imx258 Select IMX258 for camera on port 2
cam2-imx290 Select IMX290 for camera on port 2
cam2-imx477 Select IMX477 for camera on port 2
cam2-imx708 Select IMX708 for camera on port 2
cam2-ov2311 Select OV2311 for camera on port 2
cam2-ov5647 Select OV5647 for camera on port 2
cam2-ov7251 Select OV7251 for camera on port 2
Expand All @@ -768,6 +773,7 @@ Params: cam0-imx219 Select IMX219 for camera on port 0
cam3-imx258 Select IMX258 for camera on port 3
cam3-imx290 Select IMX290 for camera on port 3
cam3-imx477 Select IMX477 for camera on port 3
cam3-imx708 Select IMX708 for camera on port 3
cam3-ov2311 Select OV2311 for camera on port 3
cam3-ov5647 Select OV5647 for camera on port 3
cam3-ov7251 Select OV7251 for camera on port 3
Expand Down Expand Up @@ -2348,6 +2354,23 @@ Params: rotation Mounting rotation of the camera sensor (0 or
Compute Module (CSI0, i2c_vc, and cam0_reg).


Name: imx708
Info: Sony IMX708 camera module.
Uses Unicam 1, which is the standard camera connector on most Pi
variants.
Load: dtoverlay=imx708,<param>=<val>
Params: rotation Mounting rotation of the camera sensor (0 or
180, default 180)
orientation Sensor orientation (0 = front, 1 = rear,
2 = external, default external)
vcm Select lens driver state. Default is enabled,
but vcm=off will disable.
media-controller Configure use of Media Controller API for
configuring the sensor (default on)
cam0 Adopt the default configuration for CAM0 on a
Compute Module (CSI0, i2c_vc, and cam0_reg).


Name: iqaudio-codec
Info: Configures the IQaudio Codec audio card
Load: dtoverlay=iqaudio-codec
Expand Down
32 changes: 32 additions & 0 deletions arch/arm/boot/dts/overlays/camera-mux-2port-overlay.dts
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,16 @@
#undef cam_endpoint
#undef cam1_clk

#define cam_node imx708_0
#define cam_endpoint imx708_0_ep
#define vcm_node imx708_0_vcm
#define cam1_clk clk_24mhz
#include "imx708.dtsi"
#undef cam_node
#undef cam_endpoint
#undef vcm_node
#undef cam1_clk

#define cam_node ov5647_0
#define cam_endpoint ov5647_0_ep
#define cam1_clk clk_25mhz
Expand Down Expand Up @@ -182,6 +192,16 @@
#undef cam_endpoint
#undef cam1_clk

#define cam_node imx708_1
#define cam_endpoint imx708_1_ep
#define vcm_node imx708_1_vcm
#define cam1_clk clk_24mhz
#include "imx708.dtsi"
#undef cam_node
#undef cam_endpoint
#undef vcm_node
#undef cam1_clk

#define cam_node ov5647_1
#define cam_endpoint ov5647_1_ep
#define cam1_clk clk_25mhz
Expand Down Expand Up @@ -353,6 +373,12 @@
<&imx477_0_ep>, "remote-endpoint:0=",<&mux_in0>,
<&mux_in0>, "clock-noncontinuous?",
<&imx477_0>, "status=okay";
cam0-imx708 = <&mux_in0>, "remote-endpoint:0=",<&imx708_0_ep>,
<&imx708_0_ep>, "remote-endpoint:0=",<&mux_in0>,
<&mux_in0>, "clock-noncontinuous?",
<&imx708_0>, "status=okay",
<&imx708_0_vcm>, "status=okay",
<&imx708_0>,"lens-focus:0=", <&imx708_0_vcm>;
cam0-ov5647 = <&mux_in0>, "remote-endpoint:0=",<&ov5647_0_ep>,
<&ov5647_0_ep>, "remote-endpoint:0=",<&mux_in0>,
<&ov5647_0>, "status=okay";
Expand Down Expand Up @@ -381,6 +407,12 @@
<&imx477_1_ep>, "remote-endpoint:0=",<&mux_in1>,
<&mux_in1>, "clock-noncontinuous?",
<&imx477_1>, "status=okay";
cam1-imx708 = <&mux_in1>, "remote-endpoint:0=",<&imx708_1_ep>,
<&imx708_1_ep>, "remote-endpoint:0=",<&mux_in1>,
<&mux_in1>, "clock-noncontinuous?",
<&imx708_1>, "status=okay",
<&imx708_1_vcm>, "status=okay",
<&imx708_1>,"lens-focus:0=", <&imx708_1_vcm>;
cam1-ov5647 = <&mux_in1>, "remote-endpoint:0=",<&ov5647_1_ep>,
<&ov5647_1_ep>, "remote-endpoint:0=",<&mux_in1>,
<&ov5647_1>, "status=okay";
Expand Down
64 changes: 64 additions & 0 deletions arch/arm/boot/dts/overlays/camera-mux-4port-overlay.dts
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,16 @@
#undef cam_endpoint
#undef cam1_clk

#define cam_node imx708_0
#define cam_endpoint imx708_0_ep
#define vcm_node imx708_0_vcm
#define cam1_clk clk_24mhz
#include "imx708.dtsi"
#undef cam_node
#undef cam_endpoint
#undef vcm_node
#undef cam1_clk

#define cam_node ov5647_0
#define cam_endpoint ov5647_0_ep
#define cam1_clk clk_25mhz
Expand Down Expand Up @@ -240,6 +250,16 @@
#undef cam_endpoint
#undef cam1_clk

#define cam_node imx708_1
#define cam_endpoint imx708_1_ep
#define vcm_node imx708_1_vcm
#define cam1_clk clk_24mhz
#include "imx708.dtsi"
#undef cam_node
#undef cam_endpoint
#undef vcm_node
#undef cam1_clk

#define cam_node ov5647_1
#define cam_endpoint ov5647_1_ep
#define cam1_clk clk_25mhz
Expand Down Expand Up @@ -310,6 +330,16 @@
#undef cam_endpoint
#undef cam1_clk

#define cam_node imx708_2
#define cam_endpoint imx708_2_ep
#define vcm_node imx708_2_vcm
#define cam1_clk clk_24mhz
#include "imx708.dtsi"
#undef cam_node
#undef cam_endpoint
#undef vcm_node
#undef cam1_clk

#define cam_node ov5647_2
#define cam_endpoint ov5647_2_ep
#define cam1_clk clk_25mhz
Expand Down Expand Up @@ -380,6 +410,16 @@
#undef cam_endpoint
#undef cam1_clk

#define cam_node imx708_3
#define cam_endpoint imx708_3_ep
#define vcm_node imx708_3_vcm
#define cam1_clk clk_24mhz
#include "imx708.dtsi"
#undef cam_node
#undef cam_endpoint
#undef vcm_node
#undef cam1_clk

#define cam_node ov5647_3
#define cam_endpoint ov5647_3_ep
#define cam1_clk clk_25mhz
Expand Down Expand Up @@ -568,6 +608,12 @@
<&imx477_0_ep>, "remote-endpoint:0=",<&mux_in0>,
<&mux_in0>, "clock-noncontinuous?",
<&imx477_0>, "status=okay";
cam0-imx708 = <&mux_in0>, "remote-endpoint:0=",<&imx708_0_ep>,
<&imx708_0_ep>, "remote-endpoint:0=",<&mux_in0>,
<&mux_in0>, "clock-noncontinuous?",
<&imx708_0>, "status=okay",
<&imx708_0_vcm>, "status=okay",
<&imx708_0>,"lens-focus:0=", <&imx708_0_vcm>;
cam0-ov5647 = <&mux_in0>, "remote-endpoint:0=",<&ov5647_0_ep>,
<&ov5647_0_ep>, "remote-endpoint:0=",<&mux_in0>,
<&ov5647_0>, "status=okay";
Expand Down Expand Up @@ -596,6 +642,12 @@
<&imx477_1_ep>, "remote-endpoint:0=",<&mux_in1>,
<&mux_in1>, "clock-noncontinuous?",
<&imx477_1>, "status=okay";
cam1-imx708 = <&mux_in1>, "remote-endpoint:0=",<&imx708_1_ep>,
<&imx708_1_ep>, "remote-endpoint:0=",<&mux_in1>,
<&mux_in1>, "clock-noncontinuous?",
<&imx708_1>, "status=okay",
<&imx708_1_vcm>, "status=okay",
<&imx708_1>,"lens-focus:0=", <&imx708_1_vcm>;
cam1-ov5647 = <&mux_in1>, "remote-endpoint:0=",<&ov5647_1_ep>,
<&ov5647_1_ep>, "remote-endpoint:0=",<&mux_in1>,
<&ov5647_1>, "status=okay";
Expand Down Expand Up @@ -624,6 +676,12 @@
<&imx477_2_ep>, "remote-endpoint:0=",<&mux_in2>,
<&mux_in2>, "clock-noncontinuous?",
<&imx477_2>, "status=okay";
cam2-imx708 = <&mux_in2>, "remote-endpoint:0=",<&imx708_2_ep>,
<&imx708_2_ep>, "remote-endpoint:0=",<&mux_in2>,
<&mux_in2>, "clock-noncontinuous?",
<&imx708_2>, "status=okay",
<&imx708_2_vcm>, "status=okay",
<&imx708_2>,"lens-focus:0=", <&imx708_2_vcm>;
cam2-ov5647 = <&mux_in2>, "remote-endpoint:0=",<&ov5647_2_ep>,
<&ov5647_2_ep>, "remote-endpoint:0=",<&mux_in2>,
<&ov5647_2>, "status=okay";
Expand Down Expand Up @@ -652,6 +710,12 @@
<&imx477_3_ep>, "remote-endpoint:0=",<&mux_in3>,
<&mux_in3>, "clock-noncontinuous?",
<&imx477_3>, "status=okay";
cam3-imx708 = <&mux_in3>, "remote-endpoint:0=",<&imx708_3_ep>,
<&imx708_3_ep>, "remote-endpoint:0=",<&mux_in3>,
<&mux_in3>, "clock-noncontinuous?",
<&imx708_3>, "status=okay",
<&imx708_3_vcm>, "status=okay",
<&imx708_3>,"lens-focus:0=", <&imx708_3_vcm>;
cam3-ov5647 = <&mux_in3>, "remote-endpoint:0=",<&ov5647_3_ep>,
<&ov5647_3_ep>, "remote-endpoint:0=",<&mux_in3>,
<&ov5647_3>, "status=okay";
Expand Down
104 changes: 104 additions & 0 deletions arch/arm/boot/dts/overlays/imx708-overlay.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
// SPDX-License-Identifier: GPL-2.0-only
// Definitions for IMX708 camera module on VC I2C bus
/dts-v1/;
/plugin/;

#include <dt-bindings/gpio/gpio.h>

/{
compatible = "brcm,bcm2835";

fragment@0 {
target = <&i2c0if>;
__overlay__ {
status = "okay";
};
};

clk_frag: fragment@1 {
target = <&cam1_clk>;
__overlay__ {
status = "okay";
clock-frequency = <24000000>;
};
};

fragment@2 {
target = <&i2c0mux>;
__overlay__ {
status = "okay";
};
};

reg_frag: fragment@3 {
target = <&cam1_reg>;
cam_reg: __overlay__ {
startup-delay-us = <70000>;
off-on-delay-us = <30000>;
regulator-min-microvolt = <2700000>;
regulator-max-microvolt = <2700000>;
};
};

fragment@4 {
target = <&cam_node>;
__overlay__ {
lens-focus = <&vcm_node>;
};
};

i2c_frag: fragment@100 {
target = <&i2c_csi_dsi>;
__overlay__ {
#address-cells = <1>;
#size-cells = <0>;
status = "okay";

#include "imx708.dtsi"
};
};

csi_frag: fragment@101 {
target = <&csi1>;
csi: __overlay__ {
status = "okay";
brcm,media-controller;

port {
csi_ep: endpoint {
remote-endpoint = <&cam_endpoint>;
clock-lanes = <0>;
data-lanes = <1 2>;
clock-noncontinuous;
};
};
};
};

__overrides__ {
rotation = <&cam_node>,"rotation:0";
orientation = <&cam_node>,"orientation:0";
media-controller = <&csi>,"brcm,media-controller?";
cam0 = <&i2c_frag>, "target:0=",<&i2c_vc>,
<&csi_frag>, "target:0=",<&csi0>,
<&clk_frag>, "target:0=",<&cam0_clk>,
<&reg_frag>, "target:0=",<&cam0_reg>,
<&cam_node>, "clocks:0=",<&cam0_clk>,
<&cam_node>, "VANA1-supply:0=",<&cam0_reg>,
<&vcm_node>, "VDD-supply:0=",<&cam0_reg>;
vcm = <&vcm_node>, "status",
<0>, "=4";
};
};

&cam_node {
status = "okay";
};

&cam_endpoint {
remote-endpoint = <&csi_ep>;
};

&vcm_node {
status = "okay";
};
Loading

0 comments on commit fa45fc7

Please sign in to comment.