linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] arm64: dts: imx8mp: add imx8mp-venice-gw74xx-imx219 overlay for rpi v2 camera
@ 2023-07-11 22:15 Tim Harvey
  2023-07-13 18:52 ` Fabio Estevam
  2023-09-19 12:29 ` Shawn Guo
  0 siblings, 2 replies; 4+ messages in thread
From: Tim Harvey @ 2023-07-11 22:15 UTC (permalink / raw)
  To: Shawn Guo, devicetree, linux-kernel, linux-arm-kernel
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, NXP Linux Team,
	Tim Harvey

Add support for the RaspberryPi Camera v2 which is an IMX219 8MP module:
 - https://datasheets.raspberrypi.com/camera/camera-v2-schematics.pdf
 - has its own on-board 24MHz osc so no clock required from baseboard
 - pin 11 enables 1.8V and 2.8V LDO which is connected to
   GW74xx MIPI_GPIO4 (IMX8MP GPIO1_IO4) so we use this as a gpio

Support is added via a device-tree overlay.

The IMX219 supports RAW8/RAW10 image formats.

Example configuration:
media-ctl -l "'imx219 3-0010':0->'csis-32e40000.csi':0[1]"
media-ctl -v -V "'imx219 3-0010':0 [fmt:SRGGB8/640x480 field:none]"
media-ctl -v -V "'crossbar':0 [fmt:SRGGB8/640x480 field:none]"
media-ctl -v -V "'mxc_isi.0':0 [fmt:SRGGB8/640x480 field:none]"
v4l2-ctl --set-fmt-video=width=640,height=480,pixelformat=RGGB
v4l2-ctl --stream-mmap --stream-to=frame.raw --stream-count=1
convert -size 640x480 -depth 8 gray:frame.raw frame.png
gst-launch-1.0 v4l2src ! \
  video/x-bayer,format=rggb,width=640,height=480,framerate=10/1 ! \
  bayer2rgb ! fbdevsink

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
---
 arch/arm64/boot/dts/freescale/Makefile        |  2 +
 .../imx8mp-venice-gw74xx-imx219.dtso          | 80 +++++++++++++++++++
 2 files changed, 82 insertions(+)
 create mode 100644 arch/arm64/boot/dts/freescale/imx8mp-venice-gw74xx-imx219.dtso

diff --git a/arch/arm64/boot/dts/freescale/Makefile b/arch/arm64/boot/dts/freescale/Makefile
index 60a69e114442..9dc3c1be1899 100644
--- a/arch/arm64/boot/dts/freescale/Makefile
+++ b/arch/arm64/boot/dts/freescale/Makefile
@@ -156,6 +156,7 @@ imx8mm-venice-gw73xx-0x-rpidsi-dtbs	:= imx8mm-venice-gw73xx-0x.dtb imx8mm-venice
 imx8mm-venice-gw73xx-0x-rs232-rts-dtbs	:= imx8mm-venice-gw73xx-0x.dtb imx8mm-venice-gw73xx-0x-rs232-rts.dtbo
 imx8mm-venice-gw73xx-0x-rs422-dtbs	:= imx8mm-venice-gw73xx-0x.dtb imx8mm-venice-gw73xx-0x-rs422.dtbo
 imx8mm-venice-gw73xx-0x-rs485-dtbs	:= imx8mm-venice-gw73xx-0x.dtb imx8mm-venice-gw73xx-0x-rs485.dtbo
+imx8mp-venice-gw74xx-imx219-dtbs	:= imx8mp-venice-gw74xx.dtb imx8mp-venice-gw74xx-imx219.dtbo
 imx8mp-venice-gw74xx-rpidsi-dtbs	:= imx8mp-venice-gw74xx.dtb imx8mp-venice-gw74xx-rpidsi.dtbo
 
 dtb-$(CONFIG_ARCH_MXC) += imx8mm-venice-gw72xx-0x-imx219.dtb
@@ -168,6 +169,7 @@ dtb-$(CONFIG_ARCH_MXC) += imx8mm-venice-gw73xx-0x-rpidsi.dtb
 dtb-$(CONFIG_ARCH_MXC) += imx8mm-venice-gw73xx-0x-rs232-rts.dtb
 dtb-$(CONFIG_ARCH_MXC) += imx8mm-venice-gw73xx-0x-rs422.dtb
 dtb-$(CONFIG_ARCH_MXC) += imx8mm-venice-gw73xx-0x-rs485.dtb
+dtb-$(CONFIG_ARCH_MXC) += imx8mp-venice-gw74xx-imx219.dtb
 dtb-$(CONFIG_ARCH_MXC) += imx8mp-venice-gw74xx-rpidsi.dtb
 
 dtb-$(CONFIG_ARCH_S32) += s32g274a-evb.dtb
diff --git a/arch/arm64/boot/dts/freescale/imx8mp-venice-gw74xx-imx219.dtso b/arch/arm64/boot/dts/freescale/imx8mp-venice-gw74xx-imx219.dtso
new file mode 100644
index 000000000000..270a9114da97
--- /dev/null
+++ b/arch/arm64/boot/dts/freescale/imx8mp-venice-gw74xx-imx219.dtso
@@ -0,0 +1,80 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright 2023 Gateworks Corporation
+ */
+
+#include <dt-bindings/gpio/gpio.h>
+
+#include "imx8mp-pinfunc.h"
+
+/dts-v1/;
+/plugin/;
+
+&{/} {
+	compatible = "gw,imx8mp-gw74xx", "fsl,imx8mp";
+
+	reg_cam: regulator-cam {
+		pinctrl-names = "default";
+		pinctrl-0 = <&pinctrl_reg_cam>;
+		compatible = "regulator-fixed";
+		regulator-name = "reg_cam";
+		gpio = <&gpio1 4 GPIO_ACTIVE_HIGH>;
+		enable-active-high;
+		regulator-min-microvolt = <1800000>;
+		regulator-max-microvolt = <1800000>;
+	};
+
+	cam24m: cam24m {
+		compatible = "fixed-clock";
+		#clock-cells = <0>;
+		clock-frequency = <24000000>;
+		clock-output-names = "cam24m";
+	};
+};
+
+&i2c4 {
+	#address-cells = <1>;
+	#size-cells = <0>;
+
+	imx219: sensor@10 {
+		compatible = "sony,imx219";
+		reg = <0x10>;
+		clocks = <&cam24m>;
+		VDIG-supply = <&reg_cam>;
+
+		port {
+			/* MIPI CSI-2 bus endpoint */
+			imx219_to_mipi_csi2: endpoint {
+				remote-endpoint = <&mipi_csi_0_in>;
+				clock-lanes = <0>;
+				data-lanes = <1 2>;
+				link-frequencies = /bits/ 64 <456000000>;
+			};
+		};
+	};
+};
+
+&isi_0 {
+	status = "okay";
+};
+
+&mipi_csi_0 {
+	status = "okay";
+
+	ports {
+		port@0 {
+			mipi_csi_0_in: endpoint {
+				remote-endpoint = <&imx219_to_mipi_csi2>;
+				data-lanes = <1 2>;
+			};
+		};
+	};
+};
+
+&iomuxc {
+	pinctrl_reg_cam: regcamgrp {
+		fsl,pins = <
+			MX8MP_IOMUXC_GPIO1_IO04__GPIO1_IO04	0x41
+		>;
+	};
+};
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] arm64: dts: imx8mp: add imx8mp-venice-gw74xx-imx219 overlay for rpi v2 camera
  2023-07-11 22:15 [PATCH] arm64: dts: imx8mp: add imx8mp-venice-gw74xx-imx219 overlay for rpi v2 camera Tim Harvey
@ 2023-07-13 18:52 ` Fabio Estevam
  2023-08-14 17:55   ` Tim Harvey
  2023-09-19 12:29 ` Shawn Guo
  1 sibling, 1 reply; 4+ messages in thread
From: Fabio Estevam @ 2023-07-13 18:52 UTC (permalink / raw)
  To: Tim Harvey
  Cc: Shawn Guo, devicetree, linux-kernel, linux-arm-kernel,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Sascha Hauer,
	Pengutronix Kernel Team, NXP Linux Team

On Tue, Jul 11, 2023 at 7:15 PM Tim Harvey <tharvey@gateworks.com> wrote:
>
> Add support for the RaspberryPi Camera v2 which is an IMX219 8MP module:
>  - https://datasheets.raspberrypi.com/camera/camera-v2-schematics.pdf
>  - has its own on-board 24MHz osc so no clock required from baseboard
>  - pin 11 enables 1.8V and 2.8V LDO which is connected to
>    GW74xx MIPI_GPIO4 (IMX8MP GPIO1_IO4) so we use this as a gpio
>
> Support is added via a device-tree overlay.
>
> The IMX219 supports RAW8/RAW10 image formats.
>
> Example configuration:
> media-ctl -l "'imx219 3-0010':0->'csis-32e40000.csi':0[1]"
> media-ctl -v -V "'imx219 3-0010':0 [fmt:SRGGB8/640x480 field:none]"
> media-ctl -v -V "'crossbar':0 [fmt:SRGGB8/640x480 field:none]"
> media-ctl -v -V "'mxc_isi.0':0 [fmt:SRGGB8/640x480 field:none]"
> v4l2-ctl --set-fmt-video=width=640,height=480,pixelformat=RGGB
> v4l2-ctl --stream-mmap --stream-to=frame.raw --stream-count=1
> convert -size 640x480 -depth 8 gray:frame.raw frame.png
> gst-launch-1.0 v4l2src ! \
>   video/x-bayer,format=rggb,width=640,height=480,framerate=10/1 ! \
>   bayer2rgb ! fbdevsink
>
> Signed-off-by: Tim Harvey <tharvey@gateworks.com>

Reviewed-by: Fabio Estevam <festevam@gmail.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] arm64: dts: imx8mp: add imx8mp-venice-gw74xx-imx219 overlay for rpi v2 camera
  2023-07-13 18:52 ` Fabio Estevam
@ 2023-08-14 17:55   ` Tim Harvey
  0 siblings, 0 replies; 4+ messages in thread
From: Tim Harvey @ 2023-08-14 17:55 UTC (permalink / raw)
  To: Shawn Guo
  Cc: devicetree, linux-kernel, linux-arm-kernel, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Sascha Hauer,
	Pengutronix Kernel Team, NXP Linux Team, Fabio Estevam

On Thu, Jul 13, 2023 at 11:52 AM Fabio Estevam <festevam@gmail.com> wrote:
>
> On Tue, Jul 11, 2023 at 7:15 PM Tim Harvey <tharvey@gateworks.com> wrote:
> >
> > Add support for the RaspberryPi Camera v2 which is an IMX219 8MP module:
> >  - https://datasheets.raspberrypi.com/camera/camera-v2-schematics.pdf
> >  - has its own on-board 24MHz osc so no clock required from baseboard
> >  - pin 11 enables 1.8V and 2.8V LDO which is connected to
> >    GW74xx MIPI_GPIO4 (IMX8MP GPIO1_IO4) so we use this as a gpio
> >
> > Support is added via a device-tree overlay.
> >
> > The IMX219 supports RAW8/RAW10 image formats.
> >
> > Example configuration:
> > media-ctl -l "'imx219 3-0010':0->'csis-32e40000.csi':0[1]"
> > media-ctl -v -V "'imx219 3-0010':0 [fmt:SRGGB8/640x480 field:none]"
> > media-ctl -v -V "'crossbar':0 [fmt:SRGGB8/640x480 field:none]"
> > media-ctl -v -V "'mxc_isi.0':0 [fmt:SRGGB8/640x480 field:none]"
> > v4l2-ctl --set-fmt-video=width=640,height=480,pixelformat=RGGB
> > v4l2-ctl --stream-mmap --stream-to=frame.raw --stream-count=1
> > convert -size 640x480 -depth 8 gray:frame.raw frame.png
> > gst-launch-1.0 v4l2src ! \
> >   video/x-bayer,format=rggb,width=640,height=480,framerate=10/1 ! \
> >   bayer2rgb ! fbdevsink
> >
> > Signed-off-by: Tim Harvey <tharvey@gateworks.com>
>
> Reviewed-by: Fabio Estevam <festevam@gmail.com>

Hi Shawn,

I think this patch got missed. Was there something I need to do here?

Best regards,

Tim

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] arm64: dts: imx8mp: add imx8mp-venice-gw74xx-imx219 overlay for rpi v2 camera
  2023-07-11 22:15 [PATCH] arm64: dts: imx8mp: add imx8mp-venice-gw74xx-imx219 overlay for rpi v2 camera Tim Harvey
  2023-07-13 18:52 ` Fabio Estevam
@ 2023-09-19 12:29 ` Shawn Guo
  1 sibling, 0 replies; 4+ messages in thread
From: Shawn Guo @ 2023-09-19 12:29 UTC (permalink / raw)
  To: Tim Harvey
  Cc: devicetree, linux-kernel, linux-arm-kernel, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, NXP Linux Team

On Tue, Jul 11, 2023 at 03:15:18PM -0700, Tim Harvey wrote:
> Add support for the RaspberryPi Camera v2 which is an IMX219 8MP module:
>  - https://datasheets.raspberrypi.com/camera/camera-v2-schematics.pdf
>  - has its own on-board 24MHz osc so no clock required from baseboard
>  - pin 11 enables 1.8V and 2.8V LDO which is connected to
>    GW74xx MIPI_GPIO4 (IMX8MP GPIO1_IO4) so we use this as a gpio
> 
> Support is added via a device-tree overlay.
> 
> The IMX219 supports RAW8/RAW10 image formats.
> 
> Example configuration:
> media-ctl -l "'imx219 3-0010':0->'csis-32e40000.csi':0[1]"
> media-ctl -v -V "'imx219 3-0010':0 [fmt:SRGGB8/640x480 field:none]"
> media-ctl -v -V "'crossbar':0 [fmt:SRGGB8/640x480 field:none]"
> media-ctl -v -V "'mxc_isi.0':0 [fmt:SRGGB8/640x480 field:none]"
> v4l2-ctl --set-fmt-video=width=640,height=480,pixelformat=RGGB
> v4l2-ctl --stream-mmap --stream-to=frame.raw --stream-count=1
> convert -size 640x480 -depth 8 gray:frame.raw frame.png
> gst-launch-1.0 v4l2src ! \
>   video/x-bayer,format=rggb,width=640,height=480,framerate=10/1 ! \
>   bayer2rgb ! fbdevsink
> 
> Signed-off-by: Tim Harvey <tharvey@gateworks.com>

Applied, thanks!

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-09-19 12:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-11 22:15 [PATCH] arm64: dts: imx8mp: add imx8mp-venice-gw74xx-imx219 overlay for rpi v2 camera Tim Harvey
2023-07-13 18:52 ` Fabio Estevam
2023-08-14 17:55   ` Tim Harvey
2023-09-19 12:29 ` Shawn Guo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).