netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Tim Harvey <tharvey@gateworks.com>
Cc: Sunil Goutham <sgoutham@cavium.com>, netdev@vger.kernel.org
Subject: Re: [PATCH] net: thunderx: add support for rgmii internal delay
Date: Wed, 13 Dec 2017 12:10:54 +0100	[thread overview]
Message-ID: <20171213111054.GE12446@lunn.ch> (raw)
In-Reply-To: <1513119114-17511-1-git-send-email-tharvey@gateworks.com>

> +void xcv_init_hw(int phy_mode)
>  {
>  	u64  cfg;
>  
> @@ -81,12 +81,31 @@ void xcv_init_hw(void)
>  	/* Wait for DLL to lock */
>  	msleep(1);
>  
> -	/* Configure DLL - enable or bypass
> -	 * TX no bypass, RX bypass
> -	 */
> +	/* enable/bypass DLL providing MAC based internal TX/RX delays */
>  	cfg = readq_relaxed(xcv->reg_base + XCV_DLL_CTL);
> -	cfg &= ~0xFF03;
> -	cfg |= CLKRX_BYP;
> +	cfg &= ~0xffff00;
> +	switch (phy_mode) {
> +	/* RX and TX delays are added by the MAC */
> +	case PHY_INTERFACE_MODE_RGMII:
> +		break;
> +	/* internal RX and TX delays provided by the PHY */
> +	case PHY_INTERFACE_MODE_RGMII_ID:
> +		cfg |= CLKRX_BYP;
> +		cfg |= CLKTX_BYP;
> +		break;
> +	/* internal RX delay provided by the PHY, the MAC
> +	 * should not add an RX delay in this case
> +	 */
> +	case PHY_INTERFACE_MODE_RGMII_RXID:
> +		cfg |= CLKRX_BYP;
> +		break;
> +	/* internal TX delay provided by the PHY, the MAC
> +	 * should not add an TX delay in this case
> +	 */
> +	case PHY_INTERFACE_MODE_RGMII_TXID:
> +		cfg |= CLKRX_BYP;
> +		break;
> +	}

Hi Tim

This i don't get. Normally, you leave the PHY to handle delays, if
needed. The MAC should not add any. Here you seem to assume a delay is
always needed, and if the PHY is not providing it, the MAC should.

       Andrew

  reply	other threads:[~2017-12-13 11:10 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-12 22:51 [PATCH] net: thunderx: add support for rgmii internal delay Tim Harvey
2017-12-13 11:10 ` Andrew Lunn [this message]
2017-12-13 23:28   ` Tim Harvey
2017-12-14  8:45     ` Andrew Lunn
2017-12-18 22:10       ` Tim Harvey

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=20171213111054.GE12446@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=netdev@vger.kernel.org \
    --cc=sgoutham@cavium.com \
    --cc=tharvey@gateworks.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;
as well as URLs for NNTP newsgroup(s).