devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Niklas Söderlund" <niklas.soderlund@ragnatech.se>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Sakari Ailus <sakari.ailus@iki.fi>,
	guoniu.zhou@oss.nxp.com, linux-media@vger.kernel.org,
	devicetree@vger.kernel.org, linux-imx@nxp.com,
	mchehab@kernel.org, alexander.stein@ew.tq-group.com,
	krzysztof.kozlowski+dt@linaro.org, robh+dt@kernel.org,
	conor+dt@kernel.org, jacopo.mondi@ideasonboard.com
Subject: Re: [PATCH v2 2/2] media: nxp: add driver for i.MX93 MIPI CSI-2 controller and D-PHY
Date: Thu, 21 Sep 2023 20:45:37 +0200	[thread overview]
Message-ID: <ZQyPURd-I2WwOsh5@oden.dyn.berto.se> (raw)
In-Reply-To: <20230917212509.GB16448@pendragon.ideasonboard.com>

Hello,

On 2023-09-18 00:25:09 +0300, Laurent Pinchart wrote:

[snip]

> > > diff --git a/drivers/media/platform/nxp/dwc-mipi-csi2.h 
> > > b/drivers/media/platform/nxp/dwc-mipi-csi2.h
> > > new file mode 100644
> > > index 000000000000..470023787c25
> > > --- /dev/null
> > > +++ b/drivers/media/platform/nxp/dwc-mipi-csi2.h
> > > @@ -0,0 +1,299 @@
> > > +/* SPDX-License-Identifier: GPL-2.0 */
> > > +/*
> > > + * Copyright 2023 NXP
> > > + */
> > > +
> > > +#ifndef __DWC_MIPI_CSI2_H__
> > > +#define __DWC_MIPI_CSI2_H__
> > > +
> > > +#include <linux/device.h>
> > > +#include <linux/delay.h>
> > > +#include <linux/io.h>
> > > +
> > > +#include <media/v4l2-ctrls.h>
> > > +#include <media/v4l2-device.h>
> > > +#include <media/v4l2-fwnode.h>
> > > +#include <media/v4l2-mc.h>
> > > +#include <media/v4l2-subdev.h>
> > 
> > I don't think you need many of these headers here. Please move to the .c
> > file those you don't need here.
> > 
> > > +
> > > +/* MIPI CSI-2 Host Controller Registers Define */
> > > +
> 
> Niklas, is it me, or do the registers here look very familiar ? The
> R-Car V4H may have the same CSI-2 RX. Should we have a single driver ?

I agree it looks very familiar. The register space to indeed start out 
aligned between this driver and R-Car V4H (not checked every bit tho).  
But once we get to later registers it seems the two diverge a bit. If 
this is due to usage or something else I don't know. I have very sparse 
documentation for the V4H.

It becomes even more interesting. Have a look at this drivers 
hsfreqrange lookup table, dwc_csi_mbps_table[]. That overlaps with R-Car 
V3U (rcar-csi2.c hsfreqrange_v3u[]) instead of V4H, but V3U appears to 
support faster bus.

I think we can agree these two drivers are very similar, but not 
identical. The most interesting register here is the first one 
CSI2RX_VERSION. Maybe if we can figure that out we could start to think 
about a generic driver? Unfortunately I have no documentation for the 
content of this register. And the V4H driver do not use it, so I don't 
even know if it contains anything.

Is there any publicly documentation about this device? I have very 
sparse documentation about V4H, and nothing I can share. As to not block 
anyone maybe two drivers are OK and if we can figure out what parts, if 
any can be shared?

-- 
Kind Regards,
Niklas Söderlund

  reply	other threads:[~2023-09-21 18:45 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-10  6:03 [PATCH v2 0/2] media: nxp: add i.MX93 MIPI CSI-2 support guoniu.zhou
2023-07-10  6:03 ` [PATCH v2 1/2] media: dt-bindings: Add binding doc for i.MX93 MIPI CSI-2 guoniu.zhou
2023-07-10 15:27   ` Rob Herring
2023-09-17 20:46   ` Laurent Pinchart
2023-07-10  6:03 ` [PATCH v2 2/2] media: nxp: add driver for i.MX93 MIPI CSI-2 controller and D-PHY guoniu.zhou
2023-09-13 20:36   ` Sakari Ailus
2023-09-17 21:25     ` Laurent Pinchart
2023-09-21 18:45       ` Niklas Söderlund [this message]
2023-09-21 21:38         ` Laurent Pinchart

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=ZQyPURd-I2WwOsh5@oden.dyn.berto.se \
    --to=niklas.soderlund@ragnatech.se \
    --cc=alexander.stein@ew.tq-group.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=guoniu.zhou@oss.nxp.com \
    --cc=jacopo.mondi@ideasonboard.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-imx@nxp.com \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=sakari.ailus@iki.fi \
    /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;
as well as URLs for NNTP newsgroup(s).