openwrt/target/linux/bcm27xx/patches-5.15/950-0827-dtoverlays-Add-overlay-for-Sony-IMX258-image-sensor.patch

202 lines
5.1 KiB
Diff
Raw Normal View History

From a36565341b0b144ea37c4793793e3c835cc6458d Mon Sep 17 00:00:00 2001
From: Dave Stevenson <dave.stevenson@raspberrypi.com>
Date: Thu, 10 Jun 2021 17:42:47 +0100
Subject: [PATCH] dtoverlays: Add overlay for Sony IMX258 image sensor
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
---
arch/arm/boot/dts/overlays/Makefile | 1 +
arch/arm/boot/dts/overlays/README | 18 +++
arch/arm/boot/dts/overlays/imx258-overlay.dts | 148 ++++++++++++++++++
3 files changed, 167 insertions(+)
create mode 100644 arch/arm/boot/dts/overlays/imx258-overlay.dts
--- a/arch/arm/boot/dts/overlays/Makefile
+++ b/arch/arm/boot/dts/overlays/Makefile
@@ -98,6 +98,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \
i2s-gpio28-31.dtbo \
ilitek251x.dtbo \
imx219.dtbo \
+ imx258.dtbo \
imx290.dtbo \
imx378.dtbo \
imx477.dtbo \
--- a/arch/arm/boot/dts/overlays/README
+++ b/arch/arm/boot/dts/overlays/README
@@ -1872,6 +1872,24 @@ Params: rotation Mounting
vcm Configure a VCM focus drive on the sensor.
+Name: imx258
+Info: Sony IMX258 camera module.
+ Uses Unicam 1, which is the standard camera connector on most Pi
+ variants.
+Load: dtoverlay=imx258,<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)
+ 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).
+ vcm Configure a VCM focus drive on the sensor.
+ 4lane Enable 4 CSI2 lanes. This requires a Compute
+ Module (1, 3, or 4).
+
+
Name: imx290
Info: Sony IMX290 camera module.
Uses Unicam 1, which is the standard camera connector on most Pi
--- /dev/null
+++ b/arch/arm/boot/dts/overlays/imx258-overlay.dts
@@ -0,0 +1,148 @@
+// SPDX-License-Identifier: GPL-2.0-only
+// Definitions for IMX258 camera module on VC I2C bus
+/dts-v1/;
+/plugin/;
+
+#include <dt-bindings/gpio/gpio.h>
+
+/{
+ compatible = "brcm,bcm2835";
+
+ fragment@2 {
+ target = <&i2c0if>;
+ __overlay__ {
+ status = "okay";
+ };
+ };
+
+ clk_frag: fragment@3 {
+ target = <&cam1_clk>;
+ cam_clk: __overlay__ {
+ clock-frequency = <24000000>;
+ status = "okay";
+ };
+ };
+
+ fragment@4 {
+ target = <&i2c0mux>;
+ __overlay__ {
+ status = "okay";
+ };
+ };
+
+ reg_frag: fragment@5 {
+ target = <&cam1_reg>;
+ cam_reg: __overlay__ {
+ regulator-name = "imx258_vana";
+ startup-delay-us = <300000>;
+ regulator-min-microvolt = <2700000>;
+ regulator-max-microvolt = <2700000>;
+ };
+ };
+
+ i2c_frag: fragment@100 {
+ target = <&i2c_csi_dsi>;
+ __overlay__ {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ status = "okay";
+
+ imx258: imx258@10 {
+ compatible = "sony,imx258";
+ reg = <0x10>;
+ status = "okay";
+
+ clocks = <&cam1_clk>;
+ clock-names = "xclk";
+
+ vana-supply = <&cam1_reg>; /* 2.8v */
+ vdig-supply = <&cam_dummy_reg>; /* 1.05v */
+ vif-supply = <&cam_dummy_reg>; /* 1.8v */
+
+ rotation = <180>;
+ orientation = <2>;
+
+ port {
+ imx258_0: endpoint {
+ remote-endpoint = <&csi_ep>;
+ clock-lanes = <0>;
+ clock-noncontinuous;
+ link-frequencies =
+ /bits/ 64 <633600000
+ 320000000>;
+ };
+ };
+ };
+
+ vcm: ad5398@0c {
+ compatible = "adi,ad5398";
+ reg = <0x0c>;
+ status = "disabled";
+ VANA-supply = <&cam1_reg>;
+ };
+ };
+ };
+
+ csi_frag: fragment@101 {
+ target = <&csi1>;
+ csi: __overlay__ {
+ status = "okay";
+ brcm,media-controller;
+
+ port {
+ csi_ep: endpoint {
+ remote-endpoint = <&imx258_0>;
+ clock-lanes = <0>;
+ clock-noncontinuous;
+ };
+ };
+ };
+ };
+
+ fragment@102 {
+ target = <&imx258_0>;
+ __overlay__ {
+ data-lanes = <1 2>;
+ link-frequencies = /bits/ 64 <633600000
+ 320000000>;
+ };
+ };
+
+ fragment@103 {
+ target = <&imx258_0>;
+ __dormant__ {
+ data-lanes = <1 2 3 4>;
+ link-frequencies =
+ /bits/ 64 <633600000 320000000>;
+ };
+ };
+
+ fragment@104 {
+ target = <&csi_ep>;
+ __overlay__ {
+ data-lanes = <1 2>;
+ };
+ };
+
+ fragment@105 {
+ target = <&csi_ep>;
+ __dormant__ {
+ data-lanes = <1 2 3 4>;
+ };
+ };
+
+ __overrides__ {
+ rotation = <&imx258>,"rotation:0";
+ orientation = <&imx258>,"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>,
+ <&imx258>, "clocks:0=",<&cam0_clk>,
+ <&imx258>, "vana-supply:0=",<&cam0_reg>;
+ vcm = <&vcm>, "status=okay",
+ <&imx258>,"lens-focus:0=", <&vcm>;
+ 4lane = <0>, "-102+103-104+105";
+ };
+};