Linux kernel and device drivers for NXP i.MX platforms
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Alexander Stein <alexander.stein@ew.tq-group.com>
Cc: linux-media@vger.kernel.org,
	Isaac Scott <isaac.scott@ideasonboard.com>,
	Rui Miguel Silva <rmfrfs@gmail.com>,
	Martin Kepplinger <martink@posteo.de>,
	Purism Kernel Team <kernel@puri.sm>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Shawn Guo <shawnguo@kernel.org>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Pengutronix Kernel Team <kernel@pengutronix.de>,
	Fabio Estevam <festevam@gmail.com>,
	devicetree@vger.kernel.org, imx@lists.linux.dev,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 8/8] media: imx-mipi-csis: Initial support for multiple output channels
Date: Tue, 10 Jun 2025 12:30:54 +0300	[thread overview]
Message-ID: <20250610093054.GN27510@pendragon.ideasonboard.com> (raw)
In-Reply-To: <2230307.irdbgypaU6@steina-w>

On Tue, Jun 10, 2025 at 11:01:20AM +0200, Alexander Stein wrote:
> Am Montag, 9. Juni 2025, 01:58:40 CEST schrieb Laurent Pinchart:
> > Some CSIS instances feature more than one output channel. Parse the
> > number of channels from the device tree, and update register dumps and
> > event counters accordingly. Support for routing virtual channels and
> > data types to output channels through the subdev internal routing API
> > will come later.
> > 
> > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > ---
> >  drivers/media/platform/nxp/imx-mipi-csis.c | 224 ++++++++++++++-------
> >  1 file changed, 146 insertions(+), 78 deletions(-)
> > 
> > diff --git a/drivers/media/platform/nxp/imx-mipi-csis.c b/drivers/media/platform/nxp/imx-mipi-csis.c
> > index 080e40837463..4cc358d93187 100644
> > --- a/drivers/media/platform/nxp/imx-mipi-csis.c
> > +++ b/drivers/media/platform/nxp/imx-mipi-csis.c
> > @@ -98,12 +98,12 @@
> >  #define MIPI_CSIS_INT_SRC_ODD_AFTER		BIT(28)
> >  #define MIPI_CSIS_INT_SRC_ODD			(0x3 << 28)
> >  #define MIPI_CSIS_INT_SRC_NON_IMAGE_DATA	(0xf << 28)
> 
> As a side note: I just noticed Bits 28-31 are only defined on i.MX7. They
> are reserved on i.MX8M (Mini, Nano, Plus).

They are many bit marked as reserved that are actually implemented. The
CSIS is a big pain point :-(

> > -#define MIPI_CSIS_INT_SRC_FRAME_START		BIT(24)
> > -#define MIPI_CSIS_INT_SRC_FRAME_END		BIT(20)
> > +#define MIPI_CSIS_INT_SRC_FRAME_START(n)	BIT((n) + 24)
> > +#define MIPI_CSIS_INT_SRC_FRAME_END(n)		BIT((n) + 20)
> >  #define MIPI_CSIS_INT_SRC_ERR_SOT_HS(n)		BIT((n) + 16)
> > -#define MIPI_CSIS_INT_SRC_ERR_LOST_FS		BIT(12)
> > -#define MIPI_CSIS_INT_SRC_ERR_LOST_FE		BIT(8)
> > -#define MIPI_CSIS_INT_SRC_ERR_OVER		BIT(4)
> > +#define MIPI_CSIS_INT_SRC_ERR_LOST_FS(n)	BIT((n) + 12)
> > +#define MIPI_CSIS_INT_SRC_ERR_LOST_FE(n)	BIT((n) + 8)
> > +#define MIPI_CSIS_INT_SRC_ERR_OVER(n)		BIT((n) + 4)
> 
> Similar here. Only i.MX7 has the bits for CH1, CH2 and CH3 defined.
> 
> >  #define MIPI_CSIS_INT_SRC_ERR_WRONG_CFG		BIT(3)
> >  #define MIPI_CSIS_INT_SRC_ERR_ECC		BIT(2)
> >  #define MIPI_CSIS_INT_SRC_ERR_CRC		BIT(1)
> > @@ -205,23 +205,23 @@
> >  /* Debug control register */
> >  #define MIPI_CSIS_DBG_CTRL			0xc0
> >  #define MIPI_CSIS_DBG_INTR_MSK			0xc4
> > -#define MIPI_CSIS_DBG_INTR_MSK_DT_NOT_SUPPORT	BIT(25)
> > -#define MIPI_CSIS_DBG_INTR_MSK_DT_IGNORE	BIT(24)
> > -#define MIPI_CSIS_DBG_INTR_MSK_ERR_FRAME_SIZE	BIT(20)
> > -#define MIPI_CSIS_DBG_INTR_MSK_TRUNCATED_FRAME	BIT(16)
> > -#define MIPI_CSIS_DBG_INTR_MSK_EARLY_FE		BIT(12)
> > -#define MIPI_CSIS_DBG_INTR_MSK_EARLY_FS		BIT(8)
> > -#define MIPI_CSIS_DBG_INTR_MSK_CAM_VSYNC_FALL	BIT(4)
> > -#define MIPI_CSIS_DBG_INTR_MSK_CAM_VSYNC_RISE	BIT(0)
> > +#define MIPI_CSIS_DBG_INTR_MSK_DT_NOT_SUPPORT		BIT(25)
> > +#define MIPI_CSIS_DBG_INTR_MSK_DT_IGNORE		BIT(24)
> > +#define MIPI_CSIS_DBG_INTR_MSK_ERR_FRAME_SIZE(n)	BIT((n) + 20)
> > +#define MIPI_CSIS_DBG_INTR_MSK_TRUNCATED_FRAME(n)	BIT((n) + 16)
> > +#define MIPI_CSIS_DBG_INTR_MSK_EARLY_FE(n)		BIT((n) + 12)
> > +#define MIPI_CSIS_DBG_INTR_MSK_EARLY_FS(n)		BIT((n) + 8)
> > +#define MIPI_CSIS_DBG_INTR_MSK_CAM_VSYNC_FALL(n)	BIT((n) + 4)
> > +#define MIPI_CSIS_DBG_INTR_MSK_CAM_VSYNC_RISE(n)	BIT((n) + 0)
> >  #define MIPI_CSIS_DBG_INTR_SRC			0xc8
> > -#define MIPI_CSIS_DBG_INTR_SRC_DT_NOT_SUPPORT	BIT(25)
> > -#define MIPI_CSIS_DBG_INTR_SRC_DT_IGNORE	BIT(24)
> > -#define MIPI_CSIS_DBG_INTR_SRC_ERR_FRAME_SIZE	BIT(20)
> > -#define MIPI_CSIS_DBG_INTR_SRC_TRUNCATED_FRAME	BIT(16)
> > -#define MIPI_CSIS_DBG_INTR_SRC_EARLY_FE		BIT(12)
> > -#define MIPI_CSIS_DBG_INTR_SRC_EARLY_FS		BIT(8)
> > -#define MIPI_CSIS_DBG_INTR_SRC_CAM_VSYNC_FALL	BIT(4)
> > -#define MIPI_CSIS_DBG_INTR_SRC_CAM_VSYNC_RISE	BIT(0)
> > +#define MIPI_CSIS_DBG_INTR_SRC_DT_NOT_SUPPORT		BIT(25)
> > +#define MIPI_CSIS_DBG_INTR_SRC_DT_IGNORE		BIT(24)
> > +#define MIPI_CSIS_DBG_INTR_SRC_ERR_FRAME_SIZE(n)	BIT((n) + 20)
> > +#define MIPI_CSIS_DBG_INTR_SRC_TRUNCATED_FRAME(n)	BIT((n) + 16)
> > +#define MIPI_CSIS_DBG_INTR_SRC_EARLY_FE(n)		BIT((n) + 12)
> > +#define MIPI_CSIS_DBG_INTR_SRC_EARLY_FS(n)		BIT((n) + 8)
> > +#define MIPI_CSIS_DBG_INTR_SRC_CAM_VSYNC_FALL(n)	BIT((n) + 4)
> > +#define MIPI_CSIS_DBG_INTR_SRC_CAM_VSYNC_RISE(n)	BIT((n) + 0)
> 
> Out of curiosity: Where do these bits come from? I can't find them in RM.

They are documented in the i.MX7D RM, and they appear to be implemented
on the i.MX8MP as the interrupts fire in the expected way.

> > [snip]

-- 
Regards,

Laurent Pinchart

      reply	other threads:[~2025-06-10  9:31 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-08 23:58 [PATCH 0/8] media: imx-mipi-csis: Cleanups and debugging improvements Laurent Pinchart
2025-06-08 23:58 ` [PATCH 1/8] media: imx-mipi-csis: Rename register macros to match reference manual Laurent Pinchart
2025-06-10  9:10   ` Alexander Stein
2025-06-10  9:16     ` Laurent Pinchart
2025-06-11 13:59       ` Laurent Pinchart
2025-06-08 23:58 ` [PATCH 2/8] media: imx-mipi-csis: Fix field alignment in register dump Laurent Pinchart
2025-06-10  7:12   ` Alexander Stein
2025-06-10  7:47     ` Laurent Pinchart
2025-06-08 23:58 ` [PATCH 3/8] media: imx-mipi-csis: Log per-lane start of transmission errors Laurent Pinchart
2025-06-10  7:17   ` Alexander Stein
2025-06-08 23:58 ` [PATCH 4/8] media: imx-mipi-csis: Only set clock rate when specified in DT Laurent Pinchart
2025-06-08 23:58 ` [PATCH 5/8] dt-bindings: media: nxp,imx-mipi-csi2: Mark clock-frequency as deprecated Laurent Pinchart
2025-06-09 15:33   ` Frank Li
2025-06-25 19:23   ` Rob Herring (Arm)
2025-06-08 23:58 ` [PATCH 6/8] dt-bindings: media: nxp,imx-mipi-csi2: Add fsl,num-channels property Laurent Pinchart
2025-06-09 15:32   ` Frank Li
2025-06-09 17:53     ` Adam Ford
2025-06-09 17:58       ` Frank Li
2025-06-09 18:20       ` Laurent Pinchart
2025-06-09 19:08         ` Frank Li
2025-06-10  8:18           ` Laurent Pinchart
2025-06-19 21:02             ` Laurent Pinchart
2025-06-25 19:27               ` Rob Herring
2025-06-25 19:34                 ` Laurent Pinchart
2025-06-26 23:22   ` Rob Herring (Arm)
2025-06-08 23:58 ` [PATCH 7/8] arm64: dts: imx8mp: Specify the number of channels for CSI-2 receivers Laurent Pinchart
2025-06-08 23:58 ` [PATCH 8/8] media: imx-mipi-csis: Initial support for multiple output channels Laurent Pinchart
2025-06-09 15:39   ` Frank Li
2025-06-10  9:32     ` Laurent Pinchart
2025-06-10  9:01   ` Alexander Stein
2025-06-10  9:30     ` 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=20250610093054.GN27510@pendragon.ideasonboard.com \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=alexander.stein@ew.tq-group.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=festevam@gmail.com \
    --cc=imx@lists.linux.dev \
    --cc=isaac.scott@ideasonboard.com \
    --cc=kernel@pengutronix.de \
    --cc=kernel@puri.sm \
    --cc=krzk+dt@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-media@vger.kernel.org \
    --cc=martink@posteo.de \
    --cc=mchehab@kernel.org \
    --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