linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Florian Fainelli <f.fainelli@gmail.com>
To: Vinod Koul <vkoul@kernel.org>, David S Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org, linux-arm-msm@vger.kernel.org,
	Niklas Cassel <niklas.cassel@linaro.org>,
	Bjorn Andersson <bjorn.andersson@linaro.org>,
	Andrew Lunn <andrew@lunn.ch>
Subject: Re: [PATCH v2 4/5] net: phy: at803x: Disable phy delay for RGMII mode
Date: Tue, 8 Jan 2019 09:59:09 -0800	[thread overview]
Message-ID: <3baa95a5-5905-5d34-b656-698c792e6716@gmail.com> (raw)
In-Reply-To: <20190108162926.17806-5-vkoul@kernel.org>

On 1/8/19 8:29 AM, Vinod Koul wrote:
> For RGMII mode, phy delay should be disabled. Add this case along
> with disable delay routines.
> 
> Signed-off-by: Vinod Koul <vkoul@kernel.org>
> ---
>  drivers/net/phy/at803x.c | 21 +++++++++++++++++++++
>  1 file changed, 21 insertions(+)
> 
> diff --git a/drivers/net/phy/at803x.c b/drivers/net/phy/at803x.c
> index f9432d053a22..e7cf1d5b0514 100644
> --- a/drivers/net/phy/at803x.c
> +++ b/drivers/net/phy/at803x.c
> @@ -122,6 +122,18 @@ static inline int at803x_enable_tx_delay(struct phy_device *phydev)
>  					AT803X_DEBUG_TX_CLK_DLY_EN);
>  }
>  
> +static inline int at803x_disable_rx_delay(struct phy_device *phydev)
> +{
> +	return at803x_debug_reg_mask(phydev, AT803X_DEBUG_REG_0,
> +				     AT803X_DEBUG_RX_CLK_DLY_EN, 0);
> +}
> +
> +static inline int at803x_disable_tx_delay(struct phy_device *phydev)
> +{
> +	return at803x_debug_reg_mask(phydev, AT803X_DEBUG_REG_5,
> +				     AT803X_DEBUG_TX_CLK_DLY_EN, 0);
> +}
> +
>  /* save relevant PHY registers to private copy */
>  static void at803x_context_save(struct phy_device *phydev,
>  				struct at803x_context *context)
> @@ -269,6 +281,15 @@ static int at803x_config_init(struct phy_device *phydev)
>  			return ret;
>  	}
>  
> +	if (phydev->interface == PHY_INTERFACE_MODE_RGMII) {
> +		ret = at803x_disable_rx_delay(phydev);
> +		if (ret < 0)
> +			return ret;
> +		ret = at803x_disable_tx_delay(phydev);
> +		if (ret < 0)
> +			return ret;
> +	}

This looks right in that PHY_INTERFACE_MODE_RGMII from the perspective
of the PHY means no TX/RX delays, but you would also have to take care
of PHY_INTERFACE_MODE_RGMII_TXID and disable the RX delay in that case,
and PHY_INTERFACE_MODE_RGMII_RXID and disabled the TX delay in that case.


Thanks!
-- 
Florian

  reply	other threads:[~2019-01-08 17:59 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-08 16:29 [PATCH v2 0/5] net: Add support for Qualcomm ethqos Vinod Koul
2019-01-08 16:29 ` [PATCH v2 1/5] dt-bindings: net: Add Qualcomm ethqos binding Vinod Koul
2019-01-15 21:03   ` Rob Herring
2019-01-17  4:03     ` Vinod Koul
2019-01-08 16:29 ` [PATCH v2 2/5] net: stmmac: Add driver for Qualcomm ethqos Vinod Koul
2019-01-08 16:29 ` [PATCH v2 3/5] MAINTAINER: Add entry for Qualcomm ETHQOS ethernet driver Vinod Koul
2019-01-08 16:29 ` [PATCH v2 4/5] net: phy: at803x: Disable phy delay for RGMII mode Vinod Koul
2019-01-08 17:59   ` Florian Fainelli [this message]
2019-01-09  4:35     ` Vinod Koul
2019-01-08 16:29 ` [PATCH v2 5/5] net: dsa: qca8k: disable " Vinod Koul
2019-01-08 18:00   ` Florian Fainelli
2019-01-09  4:43     ` Vinod Koul

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=3baa95a5-5905-5d34-b656-698c792e6716@gmail.com \
    --to=f.fainelli@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=bjorn.andersson@linaro.org \
    --cc=davem@davemloft.net \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=niklas.cassel@linaro.org \
    --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 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).