All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: "Ramon Fried" <rfried.dev@gmail.com>
To: "Aleksandar Gerasimovski"
	<aleksandar.gerasimovski@hitachi-powergrids.com>,
	"Bin Meng" <bmeng.cn@gmail.com>,
	"Vladimir Oltean" <vladimir.oltean@nxp.com>,
	"u-boot@lists.denx.de" <u-boot@lists.denx.de>,
	"Priyanka Jain (OSS)" <priyanka.jain@oss.nxp.com>,
	"Rainer Boschung" <rainer.boschung@hitachi-powergrids.com>
Subject: Re: [PATCH v3] net: tsec: add option to set device max-speed via dts
Date: Sat, 12 Jun 2021 21:40:26 +0300	[thread overview]
Message-ID: <CC1UY9NGYJLC.17B3KM61ANE1E@stdcall-pc> (raw)
In-Reply-To: <AM9PR06MB8100BDB8E2C1CB5F650FB7C4D23B9@AM9PR06MB8100.eurprd06.prod.outlook.com>

On Fri Jun 4, 2021 at 4:40 PM IDT, Aleksandar Gerasimovski wrote:
> Current tsec adapter sets adapter gigabit capabilities by default, and
> in
> reality this must not always be the case.
> It is possible that tsec adapter is used for 100Mbps connection, and in
> this case setting 1000Mbps capabilities can lead to some side effects
> such
> longer autoneg process.
>
> In our ls102x designs this problem leads to long autoneg times (> 4 sec)
> in case board rgmii link is 100Mbps capable only.
> Limiting the rgmii link capabilities provides faster and smoother
> link establishment.
>
> Signed-off-by: Aleksandar Gerasimovski
> <aleksandar.gerasimovski@hitachi-powergrids.com>
> Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
> ---
> Changes for v2:
> - keep the variable sort order in a decreasing order of line length
> - fix comment typo
> Changes for v3:
> - fix commit message typos
> ---
> drivers/net/tsec.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/tsec.c b/drivers/net/tsec.c
> index c68e4b7..ee820aa 100644
> --- a/drivers/net/tsec.c
> +++ b/drivers/net/tsec.c
> @@ -828,6 +828,7 @@ int tsec_probe(struct udevice *dev)
> const char *phy_mode;
> ofnode parent, child;
> fdt_addr_t reg;
> + u32 max_speed;
> int ret;
>  
> data = (struct tsec_data *)dev_get_driver_data(dev);
> @@ -893,8 +894,12 @@ int tsec_probe(struct udevice *dev)
> }
> priv->interface = pdata->phy_interface;
>  
> + /* Check for speed limit, default is 1000Mbps */
> + max_speed = dev_read_u32_default(dev, "max-speed", 1000);
> +
> /* Initialize flags */
> - priv->flags = TSEC_GIGABIT;
> + if (max_speed == 1000)
> + priv->flags = TSEC_GIGABIT;
> if (priv->interface == PHY_INTERFACE_MODE_SGMII)
> priv->flags |= TSEC_SGMII;
>  
> --
> 1.8.3.1

Applied to u-boot-net/master, thanks!

Best regards,
Ramon Fried

      reply	other threads:[~2021-06-12 18:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-04 13:40 [PATCH v3] net: tsec: add option to set device max-speed via dts Aleksandar Gerasimovski
2021-06-12 18:40 ` Ramon Fried [this message]

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=CC1UY9NGYJLC.17B3KM61ANE1E@stdcall-pc \
    --to=rfried.dev@gmail.com \
    --cc=aleksandar.gerasimovski@hitachi-powergrids.com \
    --cc=bmeng.cn@gmail.com \
    --cc=priyanka.jain@oss.nxp.com \
    --cc=rainer.boschung@hitachi-powergrids.com \
    --cc=u-boot@lists.denx.de \
    --cc=vladimir.oltean@nxp.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.