All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Pratyush Yadav <p.yadav@ti.com>, Vinod Koul <vkoul@kernel.org>,
	Vignesh Raghavendra <vigneshr@ti.com>,
	Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>,
	Nikhil Devshatwar <nikhil.nd@ti.com>,
	Chunfeng Yun <chunfeng.yun@mediatek.com>,
	Kishon Vijay Abraham I <kishon@ti.com>,
	Rob Herring <robh+dt@kernel.org>,
	linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org
Subject: Re: [PATCH v5 2/6] phy: cdns-dphy: Add Rx support
Date: Fri, 8 Oct 2021 14:55:54 +0200	[thread overview]
Message-ID: <YWA/2o/Df34VDcpp@aptenodytes> (raw)
In-Reply-To: <YWAdKTvYzF58oyU/@pendragon.ideasonboard.com>


[-- Attachment #1.1: Type: text/plain, Size: 3641 bytes --]

Hi,

On Fri 08 Oct 21, 13:27, Laurent Pinchart wrote:
> Hi Pratyush,
> 
> On Thu, Oct 07, 2021 at 05:44:38PM +0530, Pratyush Yadav wrote:
> > On 07/10/21 03:10AM, Laurent Pinchart wrote:
> > > On Fri, Oct 01, 2021 at 11:53:16AM +0530, Vinod Koul wrote:
> > > > On 17-09-21, 22:58, Pratyush Yadav wrote:
> > > > > On 16/09/21 12:22PM, Paul Kocialkowski wrote:
> > > > > > On Fri 03 Sep 21, 00:25, Pratyush Yadav wrote:
> > > > > > > The Cadence DPHY can be used to receive image data over the CSI-2
> > > > > > > protocol. Add support for Rx mode. The programming sequence differs from
> > > > > > > the Tx mode so it is added as a separate set of hooks to isolate the two
> > > > > > > paths. The mode in which the DPHY has to be used is selected based on
> > > > > > > the compatible.
> > > > > > 
> > > > > > I just realized that I didn't follow-up on a previous revision on the debate
> > > > > > about using the phy sub-mode to distinguish between rx/tx.
> > > > > > 
> > > > > > I see that you've been using a dedicated compatible, but I'm not sure this is a
> > > > > > good fit either. My understanding is that the compatible should describe a group
> > > > > > of register-compatible revisions of a hardware component, not how the hardware
> > > > > > is used specifically. I guess the distinction between rx/tx falls under
> > > > > > the latter rather than the former.
> > > > > 
> > > > > I am not sure if that is the case. For example, we use "ti,am654-ospi" 
> > > > > for Cadence Quadspi controller. The default compatible, "cdns,qspi-nor", 
> > > > > only supports Quad SPI (4 lines). The "ti,am654-ospi" compatible also 
> > > > > supports Octal SPI (8 lines).
> > > > 
> > > > Those are hardware defaults right?
> > > > 
> > > > > In addition, I feel like the Rx DPHY is almost a different type of 
> > > > > device from a Tx DPHY. The programming sequence is completely different, 
> > > > 
> > > > Is that due to direction or something else..?
> > > > 
> > > > > the clocks required are different, etc. So I think using a different 
> > > > > compatible for Rx mode makes sense.
> > > > 
> > > > Is the underlaying IP not capable of both TX and RX and in the specific
> > > > situations you are using it as TX and RX.
> > > > 
> > > > I am okay that default being TX but you can use Paul's approach of
> > > > direction with this to make it better proposal
> > > 
> > > 
> > > Given that the RX and TX implementations are very different (it's not a
> > > matter of selecting a mode at runtime), I'm actually tempted to
> > > recommend having two drivers, one for the RX PHY and one for the TX PHY.
> > > This can only be done with two different compatible strings, which I
> > > think would be a better approach.
> > 
> > FWIW, I think having different drivers would certainly make things 
> > easier to maintain.
> 
> I'm sorry for not having recommended this in the first place.
> 
> Any objection from anyone against going in this direction ?

So apparently there is not a single register that is shared between rx and tx
and clocks are not the same either so it feels to me like a separate driver
would be legit. This looks like two distinct IPs sharing the same base address.

Cheers,

Paul

> > > It's unfortunate that the original compatible string didn't contain
> > > "tx". We could rename it and keep the old one in the driver for backward
> > > compatibility, making things cleaner going forward.
> 
> -- 
> Regards,
> 
> Laurent Pinchart

-- 
Paul Kocialkowski, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

[-- Attachment #2: Type: text/plain, Size: 112 bytes --]

-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

WARNING: multiple messages have this Message-ID (diff)
From: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Pratyush Yadav <p.yadav@ti.com>, Vinod Koul <vkoul@kernel.org>,
	Vignesh Raghavendra <vigneshr@ti.com>,
	Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>,
	Nikhil Devshatwar <nikhil.nd@ti.com>,
	Chunfeng Yun <chunfeng.yun@mediatek.com>,
	Kishon Vijay Abraham I <kishon@ti.com>,
	Rob Herring <robh+dt@kernel.org>,
	linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org
Subject: Re: [PATCH v5 2/6] phy: cdns-dphy: Add Rx support
Date: Fri, 8 Oct 2021 14:55:54 +0200	[thread overview]
Message-ID: <YWA/2o/Df34VDcpp@aptenodytes> (raw)
In-Reply-To: <YWAdKTvYzF58oyU/@pendragon.ideasonboard.com>

[-- Attachment #1: Type: text/plain, Size: 3641 bytes --]

Hi,

On Fri 08 Oct 21, 13:27, Laurent Pinchart wrote:
> Hi Pratyush,
> 
> On Thu, Oct 07, 2021 at 05:44:38PM +0530, Pratyush Yadav wrote:
> > On 07/10/21 03:10AM, Laurent Pinchart wrote:
> > > On Fri, Oct 01, 2021 at 11:53:16AM +0530, Vinod Koul wrote:
> > > > On 17-09-21, 22:58, Pratyush Yadav wrote:
> > > > > On 16/09/21 12:22PM, Paul Kocialkowski wrote:
> > > > > > On Fri 03 Sep 21, 00:25, Pratyush Yadav wrote:
> > > > > > > The Cadence DPHY can be used to receive image data over the CSI-2
> > > > > > > protocol. Add support for Rx mode. The programming sequence differs from
> > > > > > > the Tx mode so it is added as a separate set of hooks to isolate the two
> > > > > > > paths. The mode in which the DPHY has to be used is selected based on
> > > > > > > the compatible.
> > > > > > 
> > > > > > I just realized that I didn't follow-up on a previous revision on the debate
> > > > > > about using the phy sub-mode to distinguish between rx/tx.
> > > > > > 
> > > > > > I see that you've been using a dedicated compatible, but I'm not sure this is a
> > > > > > good fit either. My understanding is that the compatible should describe a group
> > > > > > of register-compatible revisions of a hardware component, not how the hardware
> > > > > > is used specifically. I guess the distinction between rx/tx falls under
> > > > > > the latter rather than the former.
> > > > > 
> > > > > I am not sure if that is the case. For example, we use "ti,am654-ospi" 
> > > > > for Cadence Quadspi controller. The default compatible, "cdns,qspi-nor", 
> > > > > only supports Quad SPI (4 lines). The "ti,am654-ospi" compatible also 
> > > > > supports Octal SPI (8 lines).
> > > > 
> > > > Those are hardware defaults right?
> > > > 
> > > > > In addition, I feel like the Rx DPHY is almost a different type of 
> > > > > device from a Tx DPHY. The programming sequence is completely different, 
> > > > 
> > > > Is that due to direction or something else..?
> > > > 
> > > > > the clocks required are different, etc. So I think using a different 
> > > > > compatible for Rx mode makes sense.
> > > > 
> > > > Is the underlaying IP not capable of both TX and RX and in the specific
> > > > situations you are using it as TX and RX.
> > > > 
> > > > I am okay that default being TX but you can use Paul's approach of
> > > > direction with this to make it better proposal
> > > 
> > > 
> > > Given that the RX and TX implementations are very different (it's not a
> > > matter of selecting a mode at runtime), I'm actually tempted to
> > > recommend having two drivers, one for the RX PHY and one for the TX PHY.
> > > This can only be done with two different compatible strings, which I
> > > think would be a better approach.
> > 
> > FWIW, I think having different drivers would certainly make things 
> > easier to maintain.
> 
> I'm sorry for not having recommended this in the first place.
> 
> Any objection from anyone against going in this direction ?

So apparently there is not a single register that is shared between rx and tx
and clocks are not the same either so it feels to me like a separate driver
would be legit. This looks like two distinct IPs sharing the same base address.

Cheers,

Paul

> > > It's unfortunate that the original compatible string didn't contain
> > > "tx". We could rename it and keep the old one in the driver for backward
> > > compatibility, making things cleaner going forward.
> 
> -- 
> Regards,
> 
> Laurent Pinchart

-- 
Paul Kocialkowski, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2021-10-08 12:56 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-02 18:55 [PATCH v5 0/6] Rx mode support for Cadence DPHY Pratyush Yadav
2021-09-02 18:55 ` Pratyush Yadav
2021-09-02 18:55 ` [PATCH v5 1/6] phy: cdns-dphy: Prepare for Rx support Pratyush Yadav
2021-09-02 18:55   ` Pratyush Yadav
2021-10-07  0:02   ` Laurent Pinchart
2021-10-07  0:02     ` Laurent Pinchart
2021-09-02 18:55 ` [PATCH v5 2/6] phy: cdns-dphy: Add " Pratyush Yadav
2021-09-02 18:55   ` Pratyush Yadav
2021-09-16 10:22   ` Paul Kocialkowski
2021-09-16 10:22     ` Paul Kocialkowski
2021-09-17 17:28     ` Pratyush Yadav
2021-09-17 17:28       ` Pratyush Yadav
2021-09-28 16:35       ` Pratyush Yadav
2021-09-28 16:35         ` Pratyush Yadav
2021-10-01  6:23       ` Vinod Koul
2021-10-01  6:23         ` Vinod Koul
2021-10-01  8:07         ` Pratyush Yadav
2021-10-01  8:07           ` Pratyush Yadav
2021-10-07  0:10         ` Laurent Pinchart
2021-10-07  0:10           ` Laurent Pinchart
2021-10-07 12:14           ` Pratyush Yadav
2021-10-07 12:14             ` Pratyush Yadav
2021-10-08 10:27             ` Laurent Pinchart
2021-10-08 10:27               ` Laurent Pinchart
2021-10-08 12:55               ` Paul Kocialkowski [this message]
2021-10-08 12:55                 ` Paul Kocialkowski
2021-10-25  8:09                 ` Vinod Koul
2021-10-25  8:09                   ` Vinod Koul
2021-09-02 18:55 ` [PATCH v5 3/6] phy: dt-bindings: Convert Cadence DPHY binding to YAML Pratyush Yadav
2021-09-02 18:55   ` Pratyush Yadav
2021-09-02 18:55 ` [PATCH v5 4/6] phy: dt-bindings: cdns, dphy: make clocks optional for Rx mode Pratyush Yadav
2021-09-02 18:55   ` [PATCH v5 4/6] phy: dt-bindings: cdns,dphy: " Pratyush Yadav
2021-09-07 19:02   ` [PATCH v5 4/6] phy: dt-bindings: cdns, dphy: " Rob Herring
2021-09-07 19:02     ` [PATCH v5 4/6] phy: dt-bindings: cdns,dphy: " Rob Herring
2021-10-06 23:57   ` [PATCH v5 4/6] phy: dt-bindings: cdns, dphy: " Laurent Pinchart
2021-10-06 23:57     ` [PATCH v5 4/6] phy: dt-bindings: cdns,dphy: " Laurent Pinchart
2021-09-02 18:55 ` [PATCH v5 5/6] phy: dt-bindings: cdns, dphy: add power-domains property Pratyush Yadav
2021-09-02 18:55   ` [PATCH v5 5/6] phy: dt-bindings: cdns,dphy: " Pratyush Yadav
2021-09-02 18:55 ` [PATCH v5 6/6] phy: dt-bindings: cdns,dphy: add Rx DPHY compatible Pratyush Yadav
2021-09-02 18:55   ` Pratyush Yadav
2021-09-07 19:03   ` Rob Herring
2021-09-07 19:03     ` Rob Herring

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=YWA/2o/Df34VDcpp@aptenodytes \
    --to=paul.kocialkowski@bootlin.com \
    --cc=chunfeng.yun@mediatek.com \
    --cc=kishon@ti.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-phy@lists.infradead.org \
    --cc=nikhil.nd@ti.com \
    --cc=p.yadav@ti.com \
    --cc=robh+dt@kernel.org \
    --cc=tomi.valkeinen@ideasonboard.com \
    --cc=vigneshr@ti.com \
    --cc=vkoul@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.