Skip to content
Snippets Groups Projects
Commit ec6136f7 authored by Gianfranco Mariotti's avatar Gianfranco Mariotti
Browse files

[D18] add OV5640 CSI camera support

* enabled at u-boot: seco_config tool CSI0, CSI1 peripherals
* on carrier B79: CSD18REVB + CSC47REVA + CSC19REVB (CSI CN39)
* Test details:
  root@seco-imx8mp-d18:~# dmesg | grep -i ov5640
  ...
  mx8-img-md: Registered sensor subdevice: ov5640 2-003c (1)
  mx8-img-md: Registered sensor subdevice: ov5640 1-003c (2)
  mx8-img-md: created link [ov5640 2-003c] => [mxc-mipi-csi2.0]
  mx8-img-md: created link [ov5640 1-003c] => [mxc-mipi-csi2.1]
  root@seco-imx8mp-d18:~# v4l2-ctl --list-devices
  ...
  mxc-isi-cap (platform:32e00000.isi:cap_devic):
    /dev/video2
  ...
  mxc-isi-cap (platform:32e02000.isi:cap_devic):
    /dev/video3
  ...
  root@seco-imx8mp-d18:~# gst-launch-1.0 -v v4l2src device=/dev/video2 ! waylandsink
  root@seco-imx8mp-d18:~# gst-launch-1.0 -v v4l2src device=/dev/video3 ! waylandsink
parent 9d79b139
No related branches found
No related tags found
1 merge request!114[D18] add OV5640 CSI camera support
......@@ -31,8 +31,10 @@ dtbo-$(CONFIG_ARCH_MXC) += \
seco-imx8mp-d18-edp-lvds-wvga.dtbo\
seco-imx8mp-d18-hdmi-edp.dtbo\
seco-imx8mp-d18-hdmi-lvds-fhd.dtbo\
seco-imx8mp-d18-ov5640-csi0.dtbo\
seco-imx8mp-d18-ov5640-csi1.dtbo\
seco-imx8mp-d18-audio-btsco.dtbo\
seco-imx8mn-c72-edp.dtbo\
seco-imx8mn-c72-edp.dtbo
# seco-imx8qm-c26-dp.dtbo\
# seco-imx8qm-c26-lvds-single.dtbo\
......
/*
* Copyright 2021 SECO
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#include <dt-bindings/clock/imx8mp-clock.h>
#include <dt-bindings/gpio/gpio.h>
/dts-v1/;
/plugin/;
/ {
compatible = "fsl,imx8mp-evk", "seco,imx8mp-d18", "fsl,imx8mp";
/* __________________________________________________________________________
* | |
* | CAMERA CSI0 |
* |__________________________________________________________________________|
*/
fragment@0 {
target = <&i2c3>;
__overlay__ {
ov5640_0: ov5640_mipi@3c {
compatible = "ovti,ov5640";
reg = <0x3c>;
clocks = <&clk IMX8MP_CLK_IPP_DO_CLKO2>;
clock-names = "xclk";
assigned-clocks = <&clk IMX8MP_CLK_IPP_DO_CLKO2>;
assigned-clock-parents = <&clk IMX8MP_CLK_24M>;
assigned-clock-rates = <24000000>;
csi_id = <0>;
powerdown-gpios = <&pca6416 1 GPIO_ACTIVE_HIGH>;
reset-gpios = <&pca6416 3 GPIO_ACTIVE_LOW>;
mclk = <24000000>;
mclk_source = <0>;
mipi_csi;
status = "okay";
port {
ov5640_mipi_0_ep: endpoint {
remote-endpoint = <&mipi_csi0_ep>;
data-lanes = <1 2>;
clock-lanes = <0>;
};
};
};
};
};
fragment@1 {
target = <&mipi_csi_0>;
__overlay__ {
status = "okay";
port@0 {
reg = <0>;
mipi_csi0_ep: endpoint {
remote-endpoint = <&ov5640_mipi_0_ep>;
data-lanes = <2>;
csis-hs-settle = <13>;
csis-clk-settle = <2>;
csis-wclk;
};
};
};
};
fragment@2 {
target = <&cameradev>;
__overlay__ {
status = "okay";
};
};
fragment@3 {
target = <&isi_0>;
__overlay__ {
status = "okay";
cap_device {
status = "okay";
};
m2m_device {
status = "okay";
};
};
};
};
/*
* Copyright 2021 SECO
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#include <dt-bindings/clock/imx8mp-clock.h>
#include <dt-bindings/gpio/gpio.h>
/dts-v1/;
/plugin/;
/ {
compatible = "fsl,imx8mp-evk", "seco,imx8mp-d18", "fsl,imx8mp";
/* __________________________________________________________________________
* | |
* | CAMERA CSI0 |
* |__________________________________________________________________________|
*/
fragment@0 {
target = <&i2c2>;
__overlay__ {
ov5640_1: ov5640_mipi@3c {
compatible = "ovti,ov5640";
reg = <0x3c>;
clocks = <&clk IMX8MP_CLK_IPP_DO_CLKO2>;
clock-names = "xclk";
assigned-clocks = <&clk IMX8MP_CLK_IPP_DO_CLKO2>;
assigned-clock-parents = <&clk IMX8MP_CLK_24M>;
assigned-clock-rates = <24000000>;
csi_id = <0>;
powerdown-gpios = <&pca6416 0 GPIO_ACTIVE_HIGH>;
reset-gpios = <&pca6416 2 GPIO_ACTIVE_LOW>;
mclk = <24000000>;
mclk_source = <0>;
mipi_csi;
status = "okay";
port {
ov5640_mipi_1_ep: endpoint {
remote-endpoint = <&mipi_csi1_ep>;
data-lanes = <1 2>;
clock-lanes = <0>;
};
};
};
};
};
fragment@1 {
target = <&mipi_csi_1>;
__overlay__ {
status = "okay";
port@1 {
reg = <1>;
mipi_csi1_ep: endpoint {
remote-endpoint = <&ov5640_mipi_1_ep>;
data-lanes = <2>;
csis-hs-settle = <13>;
csis-clk-settle = <2>;
csis-wclk;
};
};
};
};
fragment@2 {
target = <&cameradev>;
__overlay__ {
status = "okay";
};
};
fragment@3 {
target = <&isi_1>;
__overlay__ {
status = "okay";
cap_device {
status = "okay";
};
};
};
};
......@@ -524,6 +524,8 @@ CONFIG_MEDIA_SUPPORT=y
CONFIG_MEDIA_CAMERA_SUPPORT=y
CONFIG_MEDIA_ANALOG_TV_SUPPORT=y
CONFIG_MEDIA_DIGITAL_TV_SUPPORT=y
CONFIG_MEDIA_CONTROLLER=y
CONFIG_VIDEO_V4L2_SUBDEV_API=y
CONFIG_MEDIA_SDR_SUPPORT=y
CONFIG_MEDIA_PLATFORM_SUPPORT=y
# CONFIG_DVB_NET is not set
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment