Linux Renesas SOC kernel development
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Jose Abreu <Jose.Abreu@synopsys.com>
Cc: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>,
	dri-devel@lists.freedesktop.org,
	Andy Yan <andy.yan@rock-chips.com>,
	Fabio Estevam <fabio.estevam@freescale.com>,
	Kieran Bingham <kieran.bingham@ideasonboard.com>,
	Russell King <rmk+kernel@arm.linux.org.uk>,
	Ulrich Hecht <ulrich.hecht@gmail.com>,
	Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com>,
	linux-renesas-soc@vger.kernel.org
Subject: Re: [PATCH v2 16/29] drm: bridge: dw-hdmi: Detect PHY type at runtime
Date: Thu, 05 Jan 2017 02:15:04 +0200	[thread overview]
Message-ID: <6935724.YkYy7FE9s6@avalon> (raw)
In-Reply-To: <a9e7ad57-8a6a-05a9-4e74-f1e922ec6579@synopsys.com>

Hi Jose,

On Tuesday 20 Dec 2016 15:01:52 Jose Abreu wrote:
> On 20-12-2016 13:11, Laurent Pinchart wrote:
> > On Tuesday 20 Dec 2016 11:39:21 Jose Abreu wrote:
> >> On 20-12-2016 01:33, Laurent Pinchart wrote:
> >>> Detect the PHY type and use it to handle the PHY type-specific SVSRET
> >>> signal.
> >>> 
> >>> Signed-off-by: Laurent Pinchart
> >>> <laurent.pinchart+renesas@ideasonboard.com>
> >>> ---
> >>> 
> >>>  drivers/gpu/drm/bridge/dw-hdmi.c | 68 +++++++++++++++++++++++++++++++--
> >>>  include/drm/bridge/dw_hdmi.h     | 10 ++++++
> >>>  2 files changed, 75 insertions(+), 3 deletions(-)
> >>> 
> >>> diff --git a/drivers/gpu/drm/bridge/dw-hdmi.c
> >>> b/drivers/gpu/drm/bridge/dw-hdmi.c index f4faa14213e5..ef4f2f96ed2c
> >>> 100644
> >>> --- a/drivers/gpu/drm/bridge/dw-hdmi.c
> >>> +++ b/drivers/gpu/drm/bridge/dw-hdmi.c
> 
> [snip]
> 
> > I don't have access to the documentation so I can't comment on that :-)
> > What does the SVSRET signal control (and what does the name stand for) ?
>
> SVSRET stands for SVSRET :) (no idea what it means) Its a low
> power mode of consumption.
> 
> > By de-asserting PHY reset, do you mean
> > 
> >         /* PHY reset */
> >         hdmi_writeb(hdmi, HDMI_MC_PHYRSTZ_DEASSERT, HDMI_MC_PHYRSTZ);
> >         hdmi_writeb(hdmi, HDMI_MC_PHYRSTZ_ASSERT, HDMI_MC_PHYRSTZ);
> > 
> > ? HDMI_MC_PHYRSTZ_DEASSERT is defined as 0x01 and HDMI_MC_PHYRSTZ_ASSERT
> > as 0x00, which I believe leads to correct operation on Gen2 PHYs, but is
> > incorrect on Gen1 PHYs that have an active low reset signal. Could you
> > confirm that ? The DEASSERT and ASSERT macros should be renamed as
> > they're obviously incorrect.
> 
> Correct. Older phys require PHYRSTZ to be deasserted (i.e. low)
> for a PHY-dependent time. Newer phys require PHYRSTZ to be
> asserted (i.e. high) for, again, a PHY-dependent time.

Thanks for the confirmation, I'll rename the macros.

> This is the kind of things that made me suggest you to extract
> all the phy configuration from dw-hdmi. I think that having a
> bunch of if's because of all the phy's that we need to support
> does not make much sense. The downside is, of course, having code
> duplicated.

I agree with you in principle, but I'd rather do that when I'll have devices 
to test the code on. The three devices (soon to be) supported in mainline by 
the dw-hdmi drivers, i.MX6, RK3288 and R-Car Gen3, all use Gen2 PHYs, so I 
can't test the Gen1 code paths meaningfully at the moment.

> > I can move the SVSRET assertion before PHY reset and test it on RK3288 and
> > R-Car H3.
> 
> Probably wont make much difference unless you have a way to
> measure how much power the phy is consuming. But I think it is
> the right thing to do according to docs.

The init sequence is currently

- Power the PHY off (TXPWRON = 0, PDDQ = 1)
- Reset the PHY (through HDMI_MC_PHYRSTZ and HDMI_MC_HEACPHY_RST)
- Configure the PHY through I2C
- Power the PHY on (TXPWRON = 1, PDDQ = 0)
- Set SVSRET
- Wait for PHY PLL lock

I've tried moving SVSRET right before the reset and everything still seems to 
work fine, so I'll submit a patch.

Is the rest of the sequence correct ? When should SVSRET be deasserted (the 
driver currently keeps it asserted at all times) ?

Speaking of reset, I believe support for HEAC PHYs is broken, given that the 
driver asserts the reset signal (through the HDMI_MC_HEACPHY_RST register) but 
never deasserts it.

> [snip]
> 
> > The SoC datasheet mentions the SVSRET bit in the HDMI TX registers but
> > doesn't document it any further. If I don't set SVSRET the HDMI output
> > stays dead, so I assume I need to set it :-)
> 
> Hmm, ok. I still haven't figured out which phy you are using so
> can't comment much further.

I'll then leave has_svsret set to true for DW_HDMI_PHY_DWC_HDMI20_TX_PHY as 
tests show it's needed.

-- 
Regards,

Laurent Pinchart

  reply	other threads:[~2017-01-05  0:15 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-20  1:33 [PATCH v2 00/29] R-Car Gen3 HDMI output support Laurent Pinchart
2016-12-20  1:33 ` [PATCH v2 01/29] drm: bridge: dw-hdmi: Merge __hdmi_phy_i2c_write and hdmi_phy_i2c_write Laurent Pinchart
2016-12-20  1:33 ` [PATCH v2 02/29] drm: bridge: dw-hdmi: Remove unneeded arguments to bind/unbind functions Laurent Pinchart
2016-12-20  1:33 ` [PATCH v2 03/29] drm: bridge: dw-hdmi: Remove unused function parameter Laurent Pinchart
2016-12-20  1:33 ` [PATCH v2 04/29] drm: bridge: dw-hdmi: Embed drm_bridge in struct dw_hdmi Laurent Pinchart
2016-12-20  1:33 ` [PATCH v2 05/29] drm: bridge: dw-hdmi: Remove encoder field from " Laurent Pinchart
2016-12-20  1:33 ` [PATCH v2 06/29] drm: bridge: dw-hdmi: Don't forward HPD events to DRM core before attach Laurent Pinchart
2016-12-20  1:33 ` [PATCH v2 07/29] drm: bridge: dw-hdmi: Move IRQ and IO resource allocation to common code Laurent Pinchart
2016-12-20  1:33 ` [PATCH v2 08/29] drm: bridge: dw-hdmi: Reorder functions to prepare for next commit Laurent Pinchart
2016-12-20  1:33 ` [PATCH v2 09/29] drm: bridge: dw-hdmi: Create connector in the bridge attach operation Laurent Pinchart
2016-12-20  1:33 ` [PATCH v2 10/29] drm: bridge: dw-hdmi: Implement DRM bridge registration Laurent Pinchart
2016-12-20  1:33 ` [PATCH v2 11/29] drm: bridge: dw-hdmi: Remove PHY configuration resolution parameter Laurent Pinchart
2016-12-20  1:33 ` [PATCH v2 12/29] drm: bridge: dw-hdmi: Rename CONF0 SPARECTRL bit to SVSRET Laurent Pinchart
2016-12-20 10:58   ` Jose Abreu
2016-12-20  1:33 ` [PATCH v2 13/29] drm: bridge: dw-hdmi: Reject invalid product IDs Laurent Pinchart
2016-12-20 10:59   ` Jose Abreu
2016-12-20  1:33 ` [PATCH v2 14/29] drm: bridge: dw-hdmi: Detect AHB audio DMA using correct register Laurent Pinchart
2016-12-20 11:00   ` Jose Abreu
2016-12-20  1:33 ` [PATCH v2 15/29] drm: bridge: dw-hdmi: Handle overflow workaround based on device version Laurent Pinchart
2016-12-20 11:32   ` Jose Abreu
2016-12-20  1:33 ` [PATCH v2 16/29] drm: bridge: dw-hdmi: Detect PHY type at runtime Laurent Pinchart
2016-12-20 11:39   ` Jose Abreu
2016-12-20 13:11     ` Laurent Pinchart
2016-12-20 15:01       ` Jose Abreu
2017-01-05  0:15         ` Laurent Pinchart [this message]
2017-01-05 10:33           ` Jose Abreu
2017-01-05 11:44             ` Laurent Pinchart
2017-01-05 14:27               ` Jose Abreu
2016-12-20  1:33 ` [PATCH v2 17/29] drm: bridge: dw-hdmi: Refactor PHY power handling Laurent Pinchart
2016-12-20 11:45   ` Russell King - ARM Linux
2016-12-20 12:17     ` Jose Abreu
2017-01-05 12:29       ` Laurent Pinchart
2017-01-05 15:06         ` Jose Abreu
2017-01-05 15:33           ` Laurent Pinchart
2017-01-06  1:48             ` Laurent Pinchart
2017-01-06 10:07               ` Jose Abreu
2017-01-06 14:52                 ` Laurent Pinchart
2017-03-01 11:09           ` Laurent Pinchart
2017-03-01 16:25             ` Jose Abreu
2017-03-01 22:47               ` Laurent Pinchart
2016-12-20 13:50     ` Laurent Pinchart
2016-12-20  1:33 ` [PATCH v2 18/29] drm: bridge: dw-hdmi: Move CSC configuration out of PHY code Laurent Pinchart
2016-12-20  1:33 ` [PATCH v2 19/29] drm: bridge: dw-hdmi: Add support for custom PHY configuration Laurent Pinchart
2016-12-20  1:33 ` [PATCH v2 20/29] drm: bridge: dw-hdmi: Remove device type from platform data Laurent Pinchart
2016-12-20  1:33 ` [PATCH v2 21/29] dt-bindings: display: dw-hdmi: Clean up DT bindings documentation Laurent Pinchart
2016-12-20  1:33 ` [PATCH v2 22/29] dt-bindings: display: renesas: Add R-Car Gen3 HDMI TX DT bindings Laurent Pinchart
2016-12-20  1:33 ` [PATCH v2 23/29] drm: rcar-du: Add Gen3 HDMI encoder support Laurent Pinchart
2016-12-20  1:33 ` [PATCH v2 24/29] drm: rcar-du: Skip disabled outputs Laurent Pinchart
2016-12-20  1:33 ` [PATCH v2 25/29] drm: rcar-du: Add DPLL support Laurent Pinchart
2016-12-20  1:33 ` [PATCH v2 26/29] drm: rcar-du: Add HDMI outputs to R8A7795 device description Laurent Pinchart
2016-12-20  1:33 ` [PATCH v2 27/29] arm64: dts: r8a7795: Add HDMI encoder support Laurent Pinchart
2016-12-20  1:33 ` [PATCH v2 28/29] arm64: dts: r8a7795: salvator-x: Enable HDMI outputs Laurent Pinchart
2016-12-20  1:34 ` [PATCH v2 29/29] arm64: dts: r8a7795: salvator-x: Add DU1 and DU2 external dot clocks 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=6935724.YkYy7FE9s6@avalon \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=Jose.Abreu@synopsys.com \
    --cc=andy.yan@rock-chips.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=fabio.estevam@freescale.com \
    --cc=kieran.bingham@ideasonboard.com \
    --cc=laurent.pinchart+renesas@ideasonboard.com \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=rmk+kernel@arm.linux.org.uk \
    --cc=ulrich.hecht@gmail.com \
    --cc=vladimir_zapolskiy@mentor.com \
    /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