From: Andrew Lunn <andrew@lunn.ch>
To: Claudiu Manoil <claudiu.manoil@nxp.com>
Cc: "David S . Miller" <davem@davemloft.net>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
alexandru.marginean@nxp.com, catalin.horghidan@nxp.com
Subject: Re: [PATCH net-next 1/4] enetc: Introduce basic PF and VF ENETC ethernet drivers
Date: Thu, 15 Nov 2018 21:35:44 +0100 [thread overview]
Message-ID: <20181115203544.GG32274@lunn.ch> (raw)
In-Reply-To: <1542298436-23422-2-git-send-email-claudiu.manoil@nxp.com>
On Thu, Nov 15, 2018 at 06:13:53PM +0200, Claudiu Manoil wrote:
> ENETC is a multi-port virtualized Ethernet controller supporting GbE
> designs
Hi Claudiu
Do you mean 1GbE, or multigigabit? Do you have a SERDES between the
MAC and the PHY? Could an SFP be connected?
> +static int enetc_of_get_phy(struct enetc_ndev_priv *priv)
> +{
> + struct device_node *np = priv->dev->of_node;
> + int err;
> +
> + if (!np) {
> + dev_err(priv->dev, "missing ENETC port node\n");
> + return -ENODEV;
> + }
> +
> + priv->phy_node = of_parse_phandle(np, "phy-handle", 0);
> + if (!priv->phy_node) {
> + if (!of_phy_is_fixed_link(np)) {
> + dev_err(priv->dev, "PHY not specified\n");
> + return -ENODEV;
> + }
> +
> + err = of_phy_register_fixed_link(np);
> + if (err < 0) {
> + dev_err(priv->dev, "fixed link registration failed\n");
> + return err;
> + }
> +
> + priv->phy_node = of_node_get(np);
> + }
> +
> + priv->if_mode = of_get_phy_mode(np);
> + if (priv->if_mode < 0) {
> + dev_err(priv->dev, "missing phy type\n");
> + of_node_put(priv->phy_node);
> + if (of_phy_is_fixed_link(np))
> + of_phy_deregister_fixed_link(np);
> +
> + return -EINVAL;
> + }
> +
> + return 0;
> +}
I asked the above questions because of this. Using phylink will
simplify a lot of this. And it makes you future proof for faster
speeds and handling the SERDES between the MAC and the PHY, and having
an SFP, etc.
Andrew
next prev parent reply other threads:[~2018-11-16 6:45 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-15 16:13 [PATCH net-next 0/4] Introduce ENETC ethernet drivers Claudiu Manoil
2018-11-15 16:13 ` [PATCH net-next 1/4] enetc: Introduce basic PF and VF " Claudiu Manoil
2018-11-15 20:35 ` Andrew Lunn [this message]
2018-11-16 9:32 ` Claudiu Manoil
2018-11-16 23:48 ` Andrew Lunn
2018-11-17 0:30 ` Andrew Lunn
2018-11-19 15:09 ` Claudiu Manoil
2018-11-19 15:20 ` Andrew Lunn
2018-11-17 20:08 ` David Miller
2018-11-19 15:25 ` Claudiu Manoil
2018-11-15 16:13 ` [PATCH net-next 2/4] enetc: Add ethtool statistics Claudiu Manoil
2018-11-15 16:13 ` [PATCH net-next 3/4] enetc: Add vf to pf messaging support Claudiu Manoil
2018-11-15 16:13 ` [PATCH net-next 4/4] enetc: Add RFS and RSS support Claudiu Manoil
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=20181115203544.GG32274@lunn.ch \
--to=andrew@lunn.ch \
--cc=alexandru.marginean@nxp.com \
--cc=catalin.horghidan@nxp.com \
--cc=claudiu.manoil@nxp.com \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.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).