linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* LP-11 Timeout on RZ/G2 with ov5640
@ 2021-11-24 21:16 Adam Ford
  2021-11-24 22:12 ` Laurent Pinchart
  0 siblings, 1 reply; 5+ messages in thread
From: Adam Ford @ 2021-11-24 21:16 UTC (permalink / raw)
  To: linux-media, Linux-Renesas
  Cc: Niklas Söderlund, Laurent Pinchart, Geert Uytterhoeven, cstevens

I am trying to use an OV5640 camera sensor that I've used on both an
i.MX6Q and an i.MX8M Mini (with good success) on an RZ/G2[MNH] board
connected to the 2-lane CSI interface.

I can get the media-ctl to show the routings, and sometimes I can get
streaming.  Often, I get a timeout:

     rcar-csi2 fea80000.csi2: Timeout waiting for LP-11 state

Looking at the various mailing list e-mails for the LP-11, it's
unclear to me if the timeout is caused by the sensor not doing
something correctly or the CSI2 misbehaving.

I was hoping someone might have some suggestions of things I can try.

Thank you,

adam

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

* Re: LP-11 Timeout on RZ/G2 with ov5640
  2021-11-24 21:16 LP-11 Timeout on RZ/G2 with ov5640 Adam Ford
@ 2021-11-24 22:12 ` Laurent Pinchart
  2021-11-25  7:23   ` Sakari Ailus
  0 siblings, 1 reply; 5+ messages in thread
From: Laurent Pinchart @ 2021-11-24 22:12 UTC (permalink / raw)
  To: Adam Ford
  Cc: linux-media, Linux-Renesas, Niklas Söderlund,
	Geert Uytterhoeven, cstevens, Sakari Ailus

Hi Adam,

(CC'ing Sakari)

On Wed, Nov 24, 2021 at 03:16:57PM -0600, Adam Ford wrote:
> I am trying to use an OV5640 camera sensor that I've used on both an
> i.MX6Q and an i.MX8M Mini (with good success) on an RZ/G2[MNH] board
> connected to the 2-lane CSI interface.
> 
> I can get the media-ctl to show the routings, and sometimes I can get
> streaming.  Often, I get a timeout:
> 
>      rcar-csi2 fea80000.csi2: Timeout waiting for LP-11 state
> 
> Looking at the various mailing list e-mails for the LP-11, it's
> unclear to me if the timeout is caused by the sensor not doing
> something correctly or the CSI2 misbehaving.

Before transitioning to the high speed (HS) mode, the D-PHY transmitter
must drive the lane in the LP-11 state. This is the idle state of the
lane when powered up and when not in the ultra low-power state (ULPS).
The transition to HS mode on the receiver side involves observing the
LP-11 state. Many D-PHY RX require configuring the PHY when the lane is
in LP-11 state, and only then starting the sensor to transition to HS.
This requires powering up the D-PHY TX and going to idle mode, which
most sensors support. As we're deprecating the .s_power() subdev
operation, however, we have no way to power up the sensor without
starting it before the D-PHY RX gets configured.

In some cases, the D-PHY RX can handle the power up sequence
automatically. They can be fully configured (from a software point of
view) while the lane is in the power down state LP-00, and they then
handle the transition to the stop state LP-11 and to the HS mode
automatically. This isn't true for all receivers, some need software
configuration after the data lane reaches the LP-11 state and before it
transitions to HS mode. According to the documentation, the R-Car CSI-2
receiver requires software intervention between LP-11 and HS mode at
least on V3M and E3. There's also a software configuration step on H3,
M3N, V3H and V3U, but there's a chance that one could possibly be
bypassed.

> I was hoping someone might have some suggestions of things I can try.

I would first try to power up the sensor at probe time and keep it power
forever, to see if it solves your issue. If it does, then introducing a
CSI-2-specific subdev operation to power up the sensor (or officially
de-deprecating .s_power() for this use case) could be an option to fix
the issue properly.

-- 
Regards,

Laurent Pinchart

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

* Re: LP-11 Timeout on RZ/G2 with ov5640
  2021-11-24 22:12 ` Laurent Pinchart
@ 2021-11-25  7:23   ` Sakari Ailus
  2021-11-25 15:42     ` Jacopo Mondi
  0 siblings, 1 reply; 5+ messages in thread
From: Sakari Ailus @ 2021-11-25  7:23 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: Adam Ford, linux-media, Linux-Renesas, Niklas Söderlund,
	Geert Uytterhoeven, cstevens

Hi Laurent,

On Thu, Nov 25, 2021 at 12:12:18AM +0200, Laurent Pinchart wrote:
> Hi Adam,
> 
> (CC'ing Sakari)
> 
> On Wed, Nov 24, 2021 at 03:16:57PM -0600, Adam Ford wrote:
> > I am trying to use an OV5640 camera sensor that I've used on both an
> > i.MX6Q and an i.MX8M Mini (with good success) on an RZ/G2[MNH] board
> > connected to the 2-lane CSI interface.
> > 
> > I can get the media-ctl to show the routings, and sometimes I can get
> > streaming.  Often, I get a timeout:
> > 
> >      rcar-csi2 fea80000.csi2: Timeout waiting for LP-11 state
> > 
> > Looking at the various mailing list e-mails for the LP-11, it's
> > unclear to me if the timeout is caused by the sensor not doing
> > something correctly or the CSI2 misbehaving.
> 
> Before transitioning to the high speed (HS) mode, the D-PHY transmitter
> must drive the lane in the LP-11 state. This is the idle state of the
> lane when powered up and when not in the ultra low-power state (ULPS).
> The transition to HS mode on the receiver side involves observing the
> LP-11 state. Many D-PHY RX require configuring the PHY when the lane is
> in LP-11 state, and only then starting the sensor to transition to HS.
> This requires powering up the D-PHY TX and going to idle mode, which
> most sensors support. As we're deprecating the .s_power() subdev
> operation, however, we have no way to power up the sensor without
> starting it before the D-PHY RX gets configured.

That's not true anymore. Please see:

<URL:https://hverkuil.home.xs4all.nl/spec/driver-api/tx-rx.html#lp-11-and-lp-111-modes>

Not all sensors can do this without tricks though.

> 
> In some cases, the D-PHY RX can handle the power up sequence
> automatically. They can be fully configured (from a software point of
> view) while the lane is in the power down state LP-00, and they then
> handle the transition to the stop state LP-11 and to the HS mode
> automatically. This isn't true for all receivers, some need software
> configuration after the data lane reaches the LP-11 state and before it
> transitions to HS mode. According to the documentation, the R-Car CSI-2
> receiver requires software intervention between LP-11 and HS mode at
> least on V3M and E3. There's also a software configuration step on H3,
> M3N, V3H and V3U, but there's a chance that one could possibly be
> bypassed.
> 
> > I was hoping someone might have some suggestions of things I can try.
> 
> I would first try to power up the sensor at probe time and keep it power
> forever, to see if it solves your issue. If it does, then introducing a
> CSI-2-specific subdev operation to power up the sensor (or officially
> de-deprecating .s_power() for this use case) could be an option to fix
> the issue properly.

-- 
Kind regards,

Sakari Ailus

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

* Re: LP-11 Timeout on RZ/G2 with ov5640
  2021-11-25  7:23   ` Sakari Ailus
@ 2021-11-25 15:42     ` Jacopo Mondi
  2021-11-25 15:51       ` Sakari Ailus
  0 siblings, 1 reply; 5+ messages in thread
From: Jacopo Mondi @ 2021-11-25 15:42 UTC (permalink / raw)
  To: Sakari Ailus
  Cc: Laurent Pinchart, Adam Ford, linux-media, Linux-Renesas,
	Niklas Söderlund, Geert Uytterhoeven, cstevens

Hello
G
On Thu, Nov 25, 2021 at 09:23:41AM +0200, Sakari Ailus wrote:
> Hi Laurent,
>
> On Thu, Nov 25, 2021 at 12:12:18AM +0200, Laurent Pinchart wrote:
> > Hi Adam,
> >
> > (CC'ing Sakari)
> >
> > On Wed, Nov 24, 2021 at 03:16:57PM -0600, Adam Ford wrote:
> > > I am trying to use an OV5640 camera sensor that I've used on both an
> > > i.MX6Q and an i.MX8M Mini (with good success) on an RZ/G2[MNH] board
> > > connected to the 2-lane CSI interface.
> > >
> > > I can get the media-ctl to show the routings, and sometimes I can get
> > > streaming.  Often, I get a timeout:
> > >
> > >      rcar-csi2 fea80000.csi2: Timeout waiting for LP-11 state
> > >
> > > Looking at the various mailing list e-mails for the LP-11, it's
> > > unclear to me if the timeout is caused by the sensor not doing
> > > something correctly or the CSI2 misbehaving.
> >
> > Before transitioning to the high speed (HS) mode, the D-PHY transmitter
> > must drive the lane in the LP-11 state. This is the idle state of the
> > lane when powered up and when not in the ultra low-power state (ULPS).
> > The transition to HS mode on the receiver side involves observing the
> > LP-11 state. Many D-PHY RX require configuring the PHY when the lane is
> > in LP-11 state, and only then starting the sensor to transition to HS.
> > This requires powering up the D-PHY TX and going to idle mode, which
> > most sensors support. As we're deprecating the .s_power() subdev
> > operation, however, we have no way to power up the sensor without
> > starting it before the D-PHY RX gets configured.
>
> That's not true anymore. Please see:
>
> <URL:https://hverkuil.home.xs4all.nl/spec/driver-api/tx-rx.html#lp-11-and-lp-111-modes>
>
> Not all sensors can do this without tricks though.
>
> >
> > In some cases, the D-PHY RX can handle the power up sequence
> > automatically. They can be fully configured (from a software point of
> > view) while the lane is in the power down state LP-00, and they then
> > handle the transition to the stop state LP-11 and to the HS mode
> > automatically. This isn't true for all receivers, some need software
> > configuration after the data lane reaches the LP-11 state and before it
> > transitions to HS mode. According to the documentation, the R-Car CSI-2
> > receiver requires software intervention between LP-11 and HS mode at
> > least on V3M and E3. There's also a software configuration step on H3,
> > M3N, V3H and V3U, but there's a chance that one could possibly be
> > bypassed.
> >
> > > I was hoping someone might have some suggestions of things I can try.
> >
> > I would first try to power up the sensor at probe time and keep it power
> > forever, to see if it solves your issue. If it does, then introducing a
> > CSI-2-specific subdev operation to power up the sensor (or officially
> > de-deprecating .s_power() for this use case) could be an option to fix
> > the issue properly.

What about .pre_streamon video op ?
Should it fit here ?


>
> --
> Kind regards,
>
> Sakari Ailus

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

* Re: LP-11 Timeout on RZ/G2 with ov5640
  2021-11-25 15:42     ` Jacopo Mondi
@ 2021-11-25 15:51       ` Sakari Ailus
  0 siblings, 0 replies; 5+ messages in thread
From: Sakari Ailus @ 2021-11-25 15:51 UTC (permalink / raw)
  To: Jacopo Mondi
  Cc: Laurent Pinchart, Adam Ford, linux-media, Linux-Renesas,
	Niklas Söderlund, Geert Uytterhoeven, cstevens

On Thu, Nov 25, 2021 at 04:42:25PM +0100, Jacopo Mondi wrote:
> Hello
> G
> On Thu, Nov 25, 2021 at 09:23:41AM +0200, Sakari Ailus wrote:
> > Hi Laurent,
> >
> > On Thu, Nov 25, 2021 at 12:12:18AM +0200, Laurent Pinchart wrote:
> > > Hi Adam,
> > >
> > > (CC'ing Sakari)
> > >
> > > On Wed, Nov 24, 2021 at 03:16:57PM -0600, Adam Ford wrote:
> > > > I am trying to use an OV5640 camera sensor that I've used on both an
> > > > i.MX6Q and an i.MX8M Mini (with good success) on an RZ/G2[MNH] board
> > > > connected to the 2-lane CSI interface.
> > > >
> > > > I can get the media-ctl to show the routings, and sometimes I can get
> > > > streaming.  Often, I get a timeout:
> > > >
> > > >      rcar-csi2 fea80000.csi2: Timeout waiting for LP-11 state
> > > >
> > > > Looking at the various mailing list e-mails for the LP-11, it's
> > > > unclear to me if the timeout is caused by the sensor not doing
> > > > something correctly or the CSI2 misbehaving.
> > >
> > > Before transitioning to the high speed (HS) mode, the D-PHY transmitter
> > > must drive the lane in the LP-11 state. This is the idle state of the
> > > lane when powered up and when not in the ultra low-power state (ULPS).
> > > The transition to HS mode on the receiver side involves observing the
> > > LP-11 state. Many D-PHY RX require configuring the PHY when the lane is
> > > in LP-11 state, and only then starting the sensor to transition to HS.
> > > This requires powering up the D-PHY TX and going to idle mode, which
> > > most sensors support. As we're deprecating the .s_power() subdev
> > > operation, however, we have no way to power up the sensor without
> > > starting it before the D-PHY RX gets configured.
> >
> > That's not true anymore. Please see:
> >
> > <URL:https://hverkuil.home.xs4all.nl/spec/driver-api/tx-rx.html#lp-11-and-lp-111-modes>
> >
> > Not all sensors can do this without tricks though.
> >
> > >
> > > In some cases, the D-PHY RX can handle the power up sequence
> > > automatically. They can be fully configured (from a software point of
> > > view) while the lane is in the power down state LP-00, and they then
> > > handle the transition to the stop state LP-11 and to the HS mode
> > > automatically. This isn't true for all receivers, some need software
> > > configuration after the data lane reaches the LP-11 state and before it
> > > transitions to HS mode. According to the documentation, the R-Car CSI-2
> > > receiver requires software intervention between LP-11 and HS mode at
> > > least on V3M and E3. There's also a software configuration step on H3,
> > > M3N, V3H and V3U, but there's a chance that one could possibly be
> > > bypassed.
> > >
> > > > I was hoping someone might have some suggestions of things I can try.
> > >
> > > I would first try to power up the sensor at probe time and keep it power
> > > forever, to see if it solves your issue. If it does, then introducing a
> > > CSI-2-specific subdev operation to power up the sensor (or officially
> > > de-deprecating .s_power() for this use case) could be an option to fix
> > > the issue properly.
> 
> What about .pre_streamon video op ?
> Should it fit here ?

That's its first use case but there can be others.

-- 
Sakari Ailus

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

end of thread, other threads:[~2021-11-25 16:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-24 21:16 LP-11 Timeout on RZ/G2 with ov5640 Adam Ford
2021-11-24 22:12 ` Laurent Pinchart
2021-11-25  7:23   ` Sakari Ailus
2021-11-25 15:42     ` Jacopo Mondi
2021-11-25 15:51       ` Sakari Ailus

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).