From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Frank Li <Frank.li@nxp.com>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>,
Shawn Guo <shawnguo@kernel.org>,
Sascha Hauer <s.hauer@pengutronix.de>,
Pengutronix Kernel Team <kernel@pengutronix.de>,
Fabio Estevam <festevam@gmail.com>,
Rui Miguel Silva <rmfrfs@gmail.com>,
Martin Kepplinger <martink@posteo.de>,
Purism Kernel Team <kernel@puri.sm>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Philipp Zabel <p.zabel@pengutronix.de>,
linux-media@vger.kernel.org, imx@lists.linux.dev,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH 5/5] arm64: dts: imx8qxp-mek: add parallel ov5640 camera support
Date: Tue, 1 Jul 2025 23:52:20 +0300 [thread overview]
Message-ID: <20250701205220.GE16835@pendragon.ideasonboard.com> (raw)
In-Reply-To: <aGP56BUXrNnBCQu/@lizhi-Precision-Tower-5810>
Hi Frank,
On Tue, Jul 01, 2025 at 11:08:24AM -0400, Frank Li wrote:
> On Tue, Jul 01, 2025 at 02:06:51AM +0300, Laurent Pinchart wrote:
> > On Mon, Jun 30, 2025 at 06:28:21PM -0400, Frank Li wrote:
> > > Add parallel ov5640 nodes in imx8qxp-mek and create overlay file to enable
> > > it because it can work at two mode: MIPI and parallel mode.
> > >
> > > Signed-off-by: Frank Li <Frank.Li@nxp.com>
> > > ---
> > > arch/arm64/boot/dts/freescale/Makefile | 3 ++
> > > arch/arm64/boot/dts/freescale/imx8qxp-mek.dts | 37 +++++++++++++++++++
> > > .../dts/freescale/imx8x-mek-ov5640-parallel.dtso | 43 ++++++++++++++++++++++
> > > 3 files changed, 83 insertions(+)
> > >
> > > diff --git a/arch/arm64/boot/dts/freescale/Makefile b/arch/arm64/boot/dts/freescale/Makefile
> > > index 02ef35578dbc7..a9fb11ccd3dea 100644
> > > --- a/arch/arm64/boot/dts/freescale/Makefile
> > > +++ b/arch/arm64/boot/dts/freescale/Makefile
> > > @@ -330,6 +330,9 @@ dtb-$(CONFIG_ARCH_MXC) += imx8qxp-mek-pcie-ep.dtb
> > > imx8qxp-mek-ov5640-csi-dtbs := imx8qxp-mek.dtb imx8qxp-mek-ov5640-csi.dtbo
> > > dtb-${CONFIG_ARCH_MXC} += imx8qxp-mek-ov5640-csi.dtb
> > >
> > > +imx8qxp-mek-ov5640-parallel-dtbs := imx8qxp-mek.dtb imx8x-mek-ov5640-parallel.dtbo
> > > +dtb-${CONFIG_ARCH_MXC} += imx8qxp-mek-ov5640-parallel.dtb
> > > +
> > > dtb-$(CONFIG_ARCH_MXC) += imx8qxp-tqma8xqp-mba8xx.dtb
> > > dtb-$(CONFIG_ARCH_MXC) += imx8qxp-tqma8xqps-mb-smarc-2.dtb
> > > dtb-$(CONFIG_ARCH_MXC) += imx8ulp-evk.dtb
> > > diff --git a/arch/arm64/boot/dts/freescale/imx8qxp-mek.dts b/arch/arm64/boot/dts/freescale/imx8qxp-mek.dts
> > > index c95cb8acc360a..09eb85a9759e2 100644
> > > --- a/arch/arm64/boot/dts/freescale/imx8qxp-mek.dts
> > > +++ b/arch/arm64/boot/dts/freescale/imx8qxp-mek.dts
> > > @@ -487,6 +487,23 @@ pca6416: gpio@20 {
> > > #gpio-cells = <2>;
> > > };
> > >
> > > + ov5640_pi: camera@3c {
> > > + compatible = "ovti,ov5640";
> > > + reg = <0x3c>;
> > > + pinctrl-names = "default";
> > > + pinctrl-0 = <&pinctrl_parallel_csi>;
> > > + clocks = <&pi0_misc_lpcg IMX_LPCG_CLK_0>;
> > > + assigned-clocks = <&pi0_misc_lpcg IMX_LPCG_CLK_0>;
> > > + assigned-clock-rates = <24000000>;
> > > + clock-names = "xclk";
> > > + powerdown-gpios = <&lsio_gpio3 2 GPIO_ACTIVE_HIGH>;
> > > + reset-gpios = <&lsio_gpio3 3 GPIO_ACTIVE_LOW>;
> > > + AVDD-supply = <®_2v8>;
> > > + DVDD-supply = <®_1v5>;
> > > + DOVDD-supply = <®_1v8>;
> > > + status = "disabled"; /* Overlay enable it */
> > > + };
> > > +
> >
> > As far as I can tell, the sensor isn't soldered on the board, but is an
> > external module connected through a cable. This DT node should therefore
> > be moved to the overlay.
>
> It is fine for i.MX8QXP. I put here try to reuse overlay file as much as
> possible.
>
> For example, imx93 have, 9x9, 11x11, 14x14 boards ...
>
> Each board's reset-gpios have slice difference. If move whole to overlay
> files, we have to create difference overlay for each boards.
>
> If keep here and set "status = okay" and update graphic links in overlay,
> we can reuse this overlay file for different boards.
>
> for example: imx93-pcam.dtso, which simialr with imx8x-mek-ov5640-parallel.dtso.
>
> So we simple use
> imx93-9x9-qsb.dtb + imx93-pcam.dtbo.
> imx93-11x11-evk.dtb + imx93-pcam.dtbo.
> imx93-14x14-evk.dtb + imx93-pcam.dtbo.
>
> even for imx91 boards in future.
First of all, I want to say I feel your pain. I maintain many camera
sensor modules DT overlays out-of-tree, for different boards, and code
duplication is definitely annoying. Unfortunately, DT doesn't provide a
solution to this problem today. There was an attempt years ago to design
a "DT connector" that defined how connector signals were routed on a
board. This would allow a single overlay compatible with the connected
to be used with different base boards. Unfortunately, development
stalled.
Until this problem gets solved, I'm afraid you'll have to duplicate
overlays for different base boards. The OV5640 is not part of the
imx8qxp-mek, so it should not be declared in the imx8qxp-mek.dts.
> > > cs42888: audio-codec@48 {
> > > compatible = "cirrus,cs42888";
> > > reg = <0x48>;
> > > @@ -865,6 +882,26 @@ IMX8QXP_MIPI_CSI0_MCLK_OUT_MIPI_CSI0_ACM_MCLK_OUT 0xC0000041
> > > >;
> > > };
> > >
> > > + pinctrl_parallel_csi: parallelcsigrp {
> > > + fsl,pins = <
> > > + IMX8QXP_CSI_D00_CI_PI_D02 0xc0000041
> > > + IMX8QXP_CSI_D01_CI_PI_D03 0xc0000041
> > > + IMX8QXP_CSI_D02_CI_PI_D04 0xc0000041
> > > + IMX8QXP_CSI_D03_CI_PI_D05 0xc0000041
> > > + IMX8QXP_CSI_D04_CI_PI_D06 0xc0000041
> > > + IMX8QXP_CSI_D05_CI_PI_D07 0xc0000041
> > > + IMX8QXP_CSI_D06_CI_PI_D08 0xc0000041
> > > + IMX8QXP_CSI_D07_CI_PI_D09 0xc0000041
> > > +
> > > + IMX8QXP_CSI_MCLK_CI_PI_MCLK 0xc0000041
> > > + IMX8QXP_CSI_PCLK_CI_PI_PCLK 0xc0000041
> > > + IMX8QXP_CSI_HSYNC_CI_PI_HSYNC 0xc0000041
> > > + IMX8QXP_CSI_VSYNC_CI_PI_VSYNC 0xc0000041
> > > + IMX8QXP_CSI_EN_LSIO_GPIO3_IO02 0xc0000041
> > > + IMX8QXP_CSI_RESET_LSIO_GPIO3_IO03 0xc0000041
> > > + >;
> > > + };
> >
> > Same for this one.
> >
> > > +
> > > pinctrl_pcieb: pcieagrp {
> > > fsl,pins = <
> > > IMX8QXP_PCIE_CTRL0_PERST_B_LSIO_GPIO4_IO00 0x06000021
> > > diff --git a/arch/arm64/boot/dts/freescale/imx8x-mek-ov5640-parallel.dtso b/arch/arm64/boot/dts/freescale/imx8x-mek-ov5640-parallel.dtso
> > > new file mode 100644
> > > index 0000000000000..927d6640662f3
> > > --- /dev/null
> > > +++ b/arch/arm64/boot/dts/freescale/imx8x-mek-ov5640-parallel.dtso
> > > @@ -0,0 +1,43 @@
> > > +// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
> > > +/*
> > > + * Copyright 2025 NXP
> > > + */
> > > +
> > > +/dts-v1/;
> > > +/plugin/;
> > > +
> > > +#include <dt-bindings/gpio/gpio.h>
> > > +#include <dt-bindings/media/video-interfaces.h>
> > > +
> > > +&ov5640_pi {
> > > + status = "okay";
> > > +
> > > + port {
> > > + ov5640_pi_ep: endpoint {
> > > + remote-endpoint = <¶llel_csi_in>;
> > > + data-lanes = <1 2>;
> >
> > data-lanes is not allowed for parallel buses.
>
> Do you know there are method in dt_binding to restrict this?
>
> Frank
We can use if-then-else blocks to restrict the allowed properties based
on the bus-type.
> > > + bus-type = <MEDIA_BUS_TYPE_PARALLEL>;
> > > + bus-width = <8>;
> > > + vsync-active = <0>;
> > > + hsync-active = <1>;
> > > + pclk-sample = <1>;
> > > + };
> > > + };
> > > +};
> > > +
> > > +¶llel_csi {
> > > + status = "okay";
> > > +
> > > + ports {
> > > + port@0 {
> > > + parallel_csi_in: endpoint {
> > > + remote-endpoint = <&ov5640_pi_ep>;
> > > + };
> > > + };
> > > +
> > > + };
> > > +};
> > > +
> > > +&isi {
> > > + status = "okay";
> > > +};
--
Regards,
Laurent Pinchart
prev parent reply other threads:[~2025-07-01 20:52 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-30 22:28 [PATCH 0/5] media: imx8qxp: add parallel " Frank Li
2025-06-30 22:28 ` [PATCH 1/5] media: nxp: isi: add support for UYVY8_2X8 and YUYV8_2X8 bus codes Frank Li
2025-06-30 23:03 ` Laurent Pinchart
2025-06-30 22:28 ` [PATCH 2/5] dt-bindings: media: add i.MX parallel csi support Frank Li
2025-06-30 22:53 ` Laurent Pinchart
2025-07-01 14:55 ` Frank Li
2025-07-01 15:26 ` Frank Li
2025-07-01 20:40 ` Laurent Pinchart
2025-07-01 19:32 ` Laurent Pinchart
2025-06-30 22:28 ` [PATCH 3/5] media: nxp: add V4L2 subdev driver for parallel CSI Frank Li
2025-07-02 6:43 ` Krzysztof Kozlowski
2025-07-02 18:05 ` Frank Li
2025-06-30 22:28 ` [PATCH 4/5] arm64: dts: imx8: add parallel CSI node Frank Li
2025-06-30 22:28 ` [PATCH 5/5] arm64: dts: imx8qxp-mek: add parallel ov5640 camera support Frank Li
2025-06-30 23:06 ` Laurent Pinchart
2025-07-01 15:08 ` Frank Li
2025-07-01 20:52 ` Laurent Pinchart [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250701205220.GE16835@pendragon.ideasonboard.com \
--to=laurent.pinchart@ideasonboard.com \
--cc=Frank.li@nxp.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=festevam@gmail.com \
--cc=imx@lists.linux.dev \
--cc=kernel@pengutronix.de \
--cc=kernel@puri.sm \
--cc=krzk+dt@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=martink@posteo.de \
--cc=mchehab@kernel.org \
--cc=p.zabel@pengutronix.de \
--cc=rmfrfs@gmail.com \
--cc=robh@kernel.org \
--cc=s.hauer@pengutronix.de \
--cc=shawnguo@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®