Skip to content

Commit

Permalink
imx: cortexa7: support camera on TechNexion PICO-PI-IMX7D
Browse files Browse the repository at this point in the history
Enable device packages required for camera support and add relevant device
tree nodes.

The drivers probe and connect properly, but I wasn't able to get a
successfull capture yet, ov5645 driver doesn't support built-in MJPG
format yet.

To set up the capture, you need to set up the links and formats across
the pipeline, for example:

media-ctl -d /dev/media1 -l "'ov5645 3-003c':0 -> 'csis-30750000.mipi-csi':0[1]"
media-ctl -d /dev/media1 -l "'csis-30750000.mipi-csi':1 -> 'csi-mux':1[1]"
media-ctl -d /dev/media1 -l "'csi-mux':2 -> 'csi':0[1]"
media-ctl -d /dev/media1 -l "'csi':1 -> 'csi capture':0[1]"

media-ctl -d /dev/media1 -V "'ov5645 3-003c':0 [fmt:UYVY8_1X16/1920x1080 field:none]"
media-ctl -d /dev/media1 -V "'csis-30750000.mipi-csi':0 [fmt:UYVY8_1X16/1920x1080 field:none]"
media-ctl -d /dev/media1 -V "'csis-30750000.mipi-csi':1 [fmt:UYVY8_1X16/1920x1080 field:none]"
media-ctl -d /dev/media1 -V "'csi-mux':1 [fmt:UYVY8_1X16/1920x1080 field:none]"
media-ctl -d /dev/media1 -V "'csi-mux':2 [fmt:UYVY8_1X16/1920x1080 field:none]"
media-ctl -d /dev/media1 -V "'csi':0 [fmt:UYVY8_1X16/1920x1080 field:none]"
media-ctl -d /dev/media1 -V "'csi':1 [fmt:UYVY8_1X16/1920x1080 field:none]"

Signed-off-by: Lech Perczak <[email protected]>
  • Loading branch information
Leo-PL committed Jan 14, 2025
1 parent c0d034f commit 20566ab
Show file tree
Hide file tree
Showing 2 changed files with 88 additions and 1 deletion.
4 changes: 3 additions & 1 deletion target/linux/imx/image/cortexa7.mk
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ define Device/technexion_imx7d-pico-pi
DEVICE_PACKAGES := kmod-sound-core kmod-sound-soc-imx kmod-sound-soc-imx-sgtl5000 \
kmod-can kmod-can-flexcan kmod-can-raw kmod-leds-gpio \
kmod-input-touchscreen-edt-ft5x06 kmod-usb-hid kmod-btsdio \
kmod-brcmfmac brcmfmac-firmware-4339-sdio cypress-nvram-4339-sdio
kmod-brcmfmac brcmfmac-firmware-4339-sdio cypress-nvram-4339-sdio \
kmod-mux-mmio kmod-video-imx7-csi kmod-video-imx-mipi-csis kmod-video-mux \
kmod-video-pxp kmod-video-ov5645
FILESYSTEMS := squashfs
IMAGES := combined.bin sysupgrade.bin
IMAGE/combined.bin := append-rootfs | pad-extra 128k | imx-sdcard-raw-uboot
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
From e27f93355164be4a637280966cc2de08c32e39ba Mon Sep 17 00:00:00 2001
From: Lech Perczak <[email protected]>
Date: Wed, 11 May 2022 21:02:05 +0200
Subject: [PATCH] dts: imx7d-pico-pi: add OV5645 camera support

Signed-off-by: Lech Perczak <[email protected]>
---
arch/arm/boot/dts/nxp/imx/imx7d-pico-pi.dts | 58 +++++++++++++++++++++++++++++
1 file changed, 58 insertions(+)

Index: linux-5.15.138/arch/arm/boot/dts/nxp/imx/imx7d-pico-pi.dts
===================================================================
--- linux-5.15.138.orig/arch/arm/boot/dts/nxp/imx/imx7d-pico-pi.dts
+++ linux-5.15.138/arch/arm/boot/dts/nxp/imx/imx7d-pico-pi.dts
@@ -71,6 +71,33 @@
touchscreen-size-x = <800>;
touchscreen-size-y = <480>;
};
+
+ ov5645_mipi: camera@3c {
+ compatible = "ovti,ov5645";
+ reg = <0x3c>;
+
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_mipi_csi>;
+
+ clocks = <&clks IMX7D_CLKO1_ROOT_DIV>;
+ clock-names = "xclk";
+ clock-frequency = <24000000>;
+
+ enable-gpios = <&gpio1 4 GPIO_ACTIVE_HIGH>;
+ reset-gpios = <&gpio1 5 GPIO_ACTIVE_LOW>;
+
+ vdda-supply = <&reg_2p5v>;
+ vdddo-supply = <&reg_vref_1v8>;
+ vddd-supply = <&reg_vref_1v8>;
+
+ port {
+ ov5640_mipi_ep: endpoint {
+ remote-endpoint = <&mipi_sensor_ep>;
+ clock-lanes = <0>;
+ data-lanes = <1 2>;
+ };
+ };
+ };
};

&iomuxc {
@@ -101,5 +128,36 @@
MX7D_PAD_EPDC_DATA13__GPIO2_IO13 0x14
>;
};
+};
+
+&iomuxc_lpsr {
+ pinctrl_mipi_csi: mipicsigrp-1 {
+ fsl,pins = <
+ MX7D_PAD_LPSR_GPIO1_IO04__GPIO1_IO4 0x15
+ MX7D_PAD_LPSR_GPIO1_IO05__GPIO1_IO5 0x15
+ MX7D_PAD_LPSR_GPIO1_IO02__CCM_CLKO1 0x7d
+ >;
+ };
+};
+
+&csi {
+ status = "okay";
+};
+
+&mipi_csi {
+ clock-frequency = <24000000>;
+ status = "okay";
+
+ ports {
+ port@0 {
+ mipi_sensor_ep: endpoint1 {
+ remote-endpoint = <&ov5640_mipi_ep>;
+ data-lanes = <1 2>;
+ };
+ };
+ };
+};

+&video_mux {
+ status = "okay";
};

0 comments on commit 20566ab

Please sign in to comment.