summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Krummenacher <max.krummenacher@toradex.com>2023-04-06 15:19:57 +0200
committerMax Krummenacher <max.krummenacher@toradex.com>2023-04-13 10:53:08 +0200
commit5f86bd241684c4000c15f466eb020f1e738c7871 (patch)
tree6fa7c6fb4eb322e7c5a17063dc814b190723afe9
parent2cd1acc84996005bf41d9261cd54b2c308b5d03e (diff)
verdin-am62: add ov5640 camera overlay
Use media-ctl to set the format of the source node and gst-launch-1.0 to start and consume the video stream. media-ctl --set-v4l2 '"ov5640 4-003c":0 [fmt:UYVY8_1X16/640x480@1/30]' gst-launch-1.0 v4l2src device=/dev/video0 num-buffers=30 ! \ video/x-raw,width=640,height=480, format=YUY2 ! waylandsink sync=false [B media-ctl --set-v4l2 '"ov5640 4-003c":0 [fmt:UYVY8_1X16/720x480@1/30]' gst-launch-1.0 v4l2src device=/dev/video0 num-buffers=30 ! \ video/x-raw,width=720,height=480, format=YUY2 ! waylandsink sync=false media-ctl --set-v4l2 '"ov5640 4-003c":0 [fmt:UYVY8_1X16/1280x720@1/30]' gst-launch-1.0 v4l2src device=/dev/video0 num-buffers=30 ! \ video/x-raw,width=1280,height=720, format=YUY2 ! waylandsink sync=false media-ctl --set-v4l2 '"ov5640 4-003c":0 [fmt:UYVY8_1X16/1920x1080@1/15]' gst-launch-1.0 v4l2src device=/dev/video0 num-buffers=30 ! \ video/x-raw,width=1920,height=1080, format=YUY2 ! waylandsink sync=false media-ctl --set-v4l2 '"ov5640 4-003c":0 [fmt:UYVY8_1X16/2592x1944@1/15]' gst-launch-1.0 v4l2src device=/dev/video0 num-buffers=30 ! \ video/x-raw,width=2592,height=1944, format=YUY2 ! waylandsink sync=false root@verdin-am62-14917625:~# media-ctl --set-v4l2 '"ov5640 4-003c":0 [fmt:UYVY8_1X16/640x480@1/30]' root@verdin-am62-14917625:~# gst-launch-1.0 v4l2src device=/dev/video0 num-buffers=30 ! \ video/x-raw,width=640,height=480, format=YUY2 ! waylandsink sync=false -v Setting pipeline to PAUSED ... Pipeline is live and does not need PREROLL ... Pipeline is PREROLLED ... Setting pipeline to PLAYING ... New clock: GstSystemClock /GstPipeline:pipeline0/GstV4l2Src:v4l2src0.GstPad:src: caps = video/x-raw, width=(int)640, height=(int)480, format=(string)YUY2, framerate=(fraction)120/1, interlace-mode=(string)progressive, colorimetry=(string)2:4:16:1 /GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps = video/x-raw, width=(int)640, height=(int)480, format=(string)YUY2, framerate=(fraction)120/1, interlace-mode=(string)progressive, colorimetry=(string)2:4:16:1 /GstPipeline:pipeline0/GstWaylandSink:waylandsink0.GstPad:sink: caps = video/x-raw, width=(int)640, height=(int)480, format=(string)YUY2, framerate=(fraction)120/1, interlace-mode=(string)progressive, colorimetry=(string)2:4:16:1 /GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:sink: caps = video/x-raw, width=(int)640, height=(int)480, format=(string)YUY2, framerate=(fraction)120/1, interlace-mode=(string)progressive, colorimetry=(string)2:4:16:1 Redistribute latency... Got EOS from element "pipeline0". Execution ended after 0:00:01.011434424 Setting pipeline to NULL ... Freeing pipeline ... root@verdin-am62-14917625:~# Related-to: ELB-5082 Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
-rw-r--r--overlays/Makefile1
-rw-r--r--overlays/verdin-am62_ov5640_overlay.dts60
2 files changed, 61 insertions, 0 deletions
diff --git a/overlays/Makefile b/overlays/Makefile
index 7a843a3..f26a4e2 100644
--- a/overlays/Makefile
+++ b/overlays/Makefile
@@ -52,6 +52,7 @@ dtb-y += colibri-imx7_spidev_overlay.dtbo
dtb-y += colibri-imx7_vga-640x480_overlay.dtbo
dtb-y += verdin-am62_mezzanine_panel-cap-touch-10inch-lvds_overlay.dtbo
dtb-y += verdin-am62_mezzanine_panel-lvds-dual-channel-1080p_overlay.dtbo
+dtb-y += verdin-am62_ov5640_overlay.dtbo
dtb-y += verdin-am62_spidev_overlay.dtbo
dtb-y += verdin-imx8mm_nau8822-btl_overlay.dtbo
dtb-y += verdin-imx8mm_spidev_overlay.dtbo
diff --git a/overlays/verdin-am62_ov5640_overlay.dts b/overlays/verdin-am62_ov5640_overlay.dts
new file mode 100644
index 0000000..50d5efc
--- /dev/null
+++ b/overlays/verdin-am62_ov5640_overlay.dts
@@ -0,0 +1,60 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/*
+ * Copyright 2023 Toradex
+ */
+
+// CSI Camera Module 5MP OV5640
+
+/dts-v1/;
+/plugin/;
+
+#include <dt-bindings/gpio/gpio.h>
+
+/ {
+ compatible = "toradex,verdin-am62";
+};
+
+&{/} {
+ clk_ov5640_osc: ov5640-xclk {
+ compatible = "fixed-clock";
+ #clock-cells = <0>;
+ clock-frequency = <24000000>;
+ };
+};
+
+&main_i2c3 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ status = "okay";
+
+ ov5640_csi_cam: camera@3c {
+ compatible = "ovti,ov5640";
+ reg = <0x3c>;
+
+ clocks = <&clk_ov5640_osc>;
+ clock-names = "xclk";
+ /* VERDIN GPIO 6 */
+ powerdown-gpios = <&main_gpio0 36 GPIO_ACTIVE_HIGH>;
+ /* VERDIN GPIO 5 */
+ reset-gpios = <&main_gpio0 40 GPIO_ACTIVE_LOW>;
+
+ port {
+ csi2_cam0: endpoint {
+ remote-endpoint = <&csi2rx0_in_sensor>;
+ clock-lanes = <0>;
+ data-lanes = <1 2>;
+ };
+ };
+ };
+};
+
+&csi0_port0 {
+ status = "okay";
+
+ csi2rx0_in_sensor: endpoint {
+ remote-endpoint = <&csi2_cam0>;
+ bus-type = <4>; /* CSI2 DPHY. */
+ clock-lanes = <0>;
+ data-lanes = <1 2>;
+ };
+};