linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Joakim Tjernlund <joakim.tjernlund@transmode.se>
To: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"igal.liberman@freescale.com" <igal.liberman@freescale.com>
Cc: "linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"madalin.bucur@freescale.com" <madalin.bucur@freescale.com>
Subject: Re: [RFC,v3,12/12] fsl/fman: Add FMan MAC driver
Date: Mon, 20 Jul 2015 12:16:15 +0000	[thread overview]
Message-ID: <1437394575.10831.18.camel@transmode.se> (raw)
In-Reply-To: <1430299742-29428-1-git-send-email-igal.liberman@freescale.com>

On Wed, 2015-04-29 at 12:29 +0300, Igal.Liberman wrote:
> From: Igal Liberman <Igal.Liberman@freescale.com>
>=20
> This patch adds the Ethernet MAC driver support.
>=20
> Signed-off-by: Igal Liberman <Igal.Liberman@freescale.com>
> ---
>  drivers/net/ethernet/freescale/fman/inc/mac.h     |  125 +++++
>  drivers/net/ethernet/freescale/fman/mac/Makefile  |    3 +-
>  drivers/net/ethernet/freescale/fman/mac/mac-api.c |  605 +++++++++++++++=
++++++
>  drivers/net/ethernet/freescale/fman/mac/mac.c     |  527 +++++++++++++++=
+++
>  4 files changed, 1259 insertions(+), 1 deletion(-)
>  create mode 100644 drivers/net/ethernet/freescale/fman/inc/mac.h
>  create mode 100644 drivers/net/ethernet/freescale/fman/mac/mac-api.c
>  create mode 100644 drivers/net/ethernet/freescale/fman/mac/mac.c
>=20
> diff --git a/drivers/net/ethernet/freescale/fman/inc/mac.h b/drivers/net/=
ethernet/freescale/fman/inc/mac.h
> new file mode 100644
> index 0000000..2d27331
> --- /dev/null
> +++ b/drivers/net/ethernet/freescale/fman/inc/mac.h
.....
> +	/* Get the rest of the PHY information */
> +	mac_dev->phy_node =3D of_parse_phandle(mac_node, "phy-handle", 0);
> +	if (!mac_dev->phy_node) {
> +		int sz;
> +		const u32 *phy_id =3D of_get_property(mac_node, "fixed-link",
> +							&sz);
> +		if (!phy_id || sz < sizeof(*phy_id)) {
> +			dev_err(dev, "No PHY (or fixed link) found\n");
> +			_errno =3D -EINVAL;
> +			goto _return_dev_set_drvdata;
> +		}
> +
> +		sprintf(mac_dev->fixed_bus_id, PHY_ID_FMT, "fixed-0",
> +			phy_id[0]);
> +	}

The above for fixed PHY does not work for me, changing it to does:

diff --git a/drivers/net/ethernet/freescale/fman/mac/mac.c b/drivers/net/et=
hernet/freescale/fman/mac/mac.c
index 4eb8f7c..a8be96a 100644
--- a/drivers/net/ethernet/freescale/fman/mac/mac.c
+++ b/drivers/net/ethernet/freescale/fman/mac/mac.c
@@ -42,6 +42,7 @@
 #include <linux/module.h>
 #include <linux/of_address.h>
 #include <linux/of_platform.h>
+#include <linux/of_mdio.h>
 #include <linux/of_net.h>
 #include <linux/device.h>
 #include <linux/phy.h>
@@ -399,7 +400,7 @@ static int __cold mac_probe(struct platform_device *_of=
_dev)
=20
        /* Get the rest of the PHY information */
        mac_dev->phy_node =3D of_parse_phandle(mac_node, "phy-handle", 0);
-       if (!mac_dev->phy_node) {
+       if (0 && !mac_dev->phy_node) {
                int sz;
                const u32 *phy_id =3D of_get_property(mac_node, "fixed-link=
",
                                                        &sz);
@@ -412,6 +413,16 @@ static int __cold mac_probe(struct platform_device *_o=
f_dev)
                sprintf(mac_dev->fixed_bus_id, PHY_ID_FMT, "fixed-0",
                        phy_id[0]);
        }
+       if (!mac_dev->phy_node && of_phy_is_fixed_link(mac_node)) {
+               /*
+                * In the case of a fixed PHY, the DT node associated
+                * to the PHY is the Ethernet MAC DT node.
+                */
+               _errno =3D of_phy_register_fixed_link(mac_node);
+               if (_errno)
+                       return _errno;
+               mac_dev->phy_node =3D of_node_get(mac_node);
+       }=

  reply	other threads:[~2015-07-20 12:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-29  9:29 [RFC,v3,12/12] fsl/fman: Add FMan MAC driver Igal.Liberman
2015-07-20 12:16 ` Joakim Tjernlund [this message]
2015-07-20 12:28   ` Madalin-Cristian Bucur
2015-07-20 12:57     ` Joakim Tjernlund
2015-07-20 13:33       ` Madalin-Cristian Bucur
2015-07-21 13:44         ` Joakim Tjernlund

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=1437394575.10831.18.camel@transmode.se \
    --to=joakim.tjernlund@transmode.se \
    --cc=igal.liberman@freescale.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=madalin.bucur@freescale.com \
    --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).