Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753935AbbGTMQW (ORCPT ); Mon, 20 Jul 2015 08:16:22 -0400 Received: from smtp.transmode.se ([31.15.61.139]:53475 "EHLO smtp.transmode.se" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751534AbbGTMQU convert rfc822-to-8bit (ORCPT ); Mon, 20 Jul 2015 08:16:20 -0400 From: Joakim Tjernlund To: "netdev@vger.kernel.org" , "igal.liberman@freescale.com" CC: "linuxppc-dev@lists.ozlabs.org" , "linux-kernel@vger.kernel.org" , "madalin.bucur@freescale.com" Subject: Re: [RFC,v3,12/12] fsl/fman: Add FMan MAC driver Thread-Topic: [RFC,v3,12/12] fsl/fman: Add FMan MAC driver Thread-Index: AQHQgoMUX0zDZ9osFk68924iqE+98J3kpTKA Date: Mon, 20 Jul 2015 12:16:15 +0000 Message-ID: <1437394575.10831.18.camel@transmode.se> References: <1430299742-29428-1-git-send-email-igal.liberman@freescale.com> In-Reply-To: <1430299742-29428-1-git-send-email-igal.liberman@freescale.com> Accept-Language: en-US, sv-SE Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: Evolution 3.16.4 x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [192.168.200.4] Content-Type: text/plain; charset=US-ASCII Content-ID: <0586BE72347437409A534D01BDADEBA8@transmode.com> Content-Transfer-Encoding: 7BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3353 Lines: 79 On Wed, 2015-04-29 at 12:29 +0300, Igal.Liberman wrote: > From: Igal Liberman > > This patch adds the Ethernet MAC driver support. > > Signed-off-by: Igal Liberman > --- > 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 > > 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 = of_parse_phandle(mac_node, "phy-handle", 0); > + if (!mac_dev->phy_node) { > + int sz; > + const u32 *phy_id = 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 = -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/ethernet/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 #include #include +#include #include #include #include @@ -399,7 +400,7 @@ static int __cold mac_probe(struct platform_device *_of_dev) /* Get the rest of the PHY information */ mac_dev->phy_node = 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 = of_get_property(mac_node, "fixed-link", &sz); @@ -412,6 +413,16 @@ static int __cold mac_probe(struct platform_device *_of_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 = of_phy_register_fixed_link(mac_node); + if (_errno) + return _errno; + mac_dev->phy_node = of_node_get(mac_node); + }-- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/