[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <yw1xy3riosag.fsf@mansr.com>
Date: Fri, 21 Jul 2017 14:04:07 +0100
From: Måns Rullgård <mans@...sr.com>
To: Marc Gonzalez <marc_gonzalez@...madesigns.com>
Cc: Florian Fainelli <f.fainelli@...il.com>,
Andrew Lunn <andrew@...n.ch>,
Martin Blumenstingl <martin.blumenstingl@...il.com>,
Grygorii Strashko <grygorii.strashko@...com>,
Fabio Estevam <fabio.estevam@....com>,
Zefir Kurtisi <zefir.kurtisi@...atec.com>,
Timur Tabi <timur@...eaurora.org>,
Daniel Mack <zonque@...il.com>,
netdev <netdev@...r.kernel.org>,
Linux ARM <linux-arm-kernel@...ts.infradead.org>,
"David S. Miller" <davem@...emloft.net>,
Thibaud Cornic <thibaud_cornic@...madesigns.com>,
Mason <slash.tmp@...e.fr>
Subject: Re: [PATCH v2 3/4] net: ethernet: nb8800: Fix RGMII TX clock delay setup
Marc Gonzalez <marc_gonzalez@...madesigns.com> writes:
> According to commit e5f3a4a56ce2a707b2fb8ce37e4414dcac89c672
> ("Documentation: devicetree: clarify usage of the RGMII phy-modes")
> there are 4 RGMII modes to handle:
>
> "rgmii" (RX and TX delays are added by the MAC when required)
> "rgmii-id" (RGMII with internal RX and TX delays provided by the PHY,
> the MAC should not add the RX or TX delays in this case)
> "rgmii-rxid" (RGMII with internal RX delay provided by the PHY,
> the MAC should not add an RX delay in this case)
> "rgmii-txid" (RGMII with internal TX delay provided by the PHY,
> the MAC should not add an TX delay in this case)
>
> Add TX delay in the MAC only for rgmii and rgmii-rxid.
>
> Signed-off-by: Marc Gonzalez <marc_gonzalez@...madesigns.com>
> ---
> drivers/net/ethernet/aurora/nb8800.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/aurora/nb8800.c b/drivers/net/ethernet/aurora/nb8800.c
> index ded041dbafe7..f3ed320eb4ad 100644
> --- a/drivers/net/ethernet/aurora/nb8800.c
> +++ b/drivers/net/ethernet/aurora/nb8800.c
> @@ -1268,11 +1268,13 @@ static int nb8800_tangox_init(struct net_device *dev)
> break;
>
> case PHY_INTERFACE_MODE_RGMII:
> - pad_mode = PAD_MODE_RGMII;
> + case PHY_INTERFACE_MODE_RGMII_RXID:
> + pad_mode = PAD_MODE_RGMII | PAD_MODE_GTX_CLK_DELAY;
> break;
>
> + case PHY_INTERFACE_MODE_RGMII_ID:
> case PHY_INTERFACE_MODE_RGMII_TXID:
> - pad_mode = PAD_MODE_RGMII | PAD_MODE_GTX_CLK_DELAY;
> + pad_mode = PAD_MODE_RGMII;
> break;
>
> default:
I still don't like this. Having both the MAC and PHY drivers react to
the phy-connection-type property is bound to cause trouble somewhere.
The only way out of the current mess is to define new properties for
both MAC and PHY that override the existing ones if present.
--
Måns Rullgård
Powered by blists - more mailing lists