Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754812AbbGTM2P (ORCPT ); Mon, 20 Jul 2015 08:28:15 -0400 Received: from mail-bn1on0141.outbound.protection.outlook.com ([157.56.110.141]:53408 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752308AbbGTM2N convert rfc822-to-8bit (ORCPT ); Mon, 20 Jul 2015 08:28:13 -0400 From: Madalin-Cristian Bucur To: Joakim Tjernlund , "netdev@vger.kernel.org" , Liberman Igal CC: "linuxppc-dev@lists.ozlabs.org" , "linux-kernel@vger.kernel.org" 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: AQHQgoF5kb4pqg8fR0SikBoDA5GsQp3kxryAgAACzuA= Date: Mon, 20 Jul 2015 12:28:11 +0000 Message-ID: References: <1430299742-29428-1-git-send-email-igal.liberman@freescale.com> <1437394575.10831.18.camel@transmode.se> In-Reply-To: <1437394575.10831.18.camel@transmode.se> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: transmode.se; dkim=none (message not signed) header.d=none; x-originating-ip: [192.88.166.1] x-microsoft-exchange-diagnostics: 1;BL2PR03MB369;5:7joqx0gsmXZZ24UHBWiqOBZ6jaf6sUPMPCFEj4uq0USEZdrGcRoCm7ExrLtRvSTgJfejHsHT76b4G4vt0EwGn7xO9FO9pMLGvHnbN5BQCpMSLmRLKio8R9VFDKuOao1WExs75MJtElqF0xj1aGBJlg==;24:X0/7po3pFiW3BkhP8RMgmRCZB2lh4JIXf8RUmVvJquuZAlrlBCHe0H0o4FV90hLRLmMc8SsDCqhLhxvU8XWJkwzE4shQaBIp2nFKi+Ln8uw=;20:I4rF40XSviwxBjO+nTvH2FbyNhukAlJ6jZFFNrrgYSH/2lU5+hOAYMm0xrZ943l3P7CHHwHWKC9isAvD9cTnFQ== x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BL2PR03MB369; bl2pr03mb369: X-MS-Exchange-Organization-RulesExecuted x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(601004)(5005006)(3002001);SRVR:BL2PR03MB369;BCL:0;PCL:0;RULEID:;SRVR:BL2PR03MB369; x-forefront-prvs: 0643BDA83C x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(13464003)(24454002)(377424004)(377454003)(2656002)(86362001)(5002640100001)(122556002)(19580395003)(77156002)(5001960100002)(19580405001)(92566002)(87936001)(189998001)(66066001)(54356999)(62966003)(46102003)(2950100001)(50986999)(76176999)(5003600100002)(74316001)(77096005)(2900100001)(2501003)(33656002)(99286002)(106116001)(40100003)(102836002)(4001450100002)(76576001)(142933001)(19627235001);DIR:OUT;SFP:1102;SCL:1;SRVR:BL2PR03MB369;H:BL2PR03MB545.namprd03.prod.outlook.com;FPR:;SPF:None;MLV:sfv;LANG:en; Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Jul 2015 12:28:11.8107 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 710a03f5-10f6-4d38-9ff4-a80b81da590d X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL2PR03MB369 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3969 Lines: 103 Hi Joakim, It seems we just need to align to the API introduced by Thomas Petazzoni in 3be2a49e. Madalin > -----Original Message----- > From: Joakim Tjernlund [mailto:joakim.tjernlund@transmode.se] > Sent: Monday, July 20, 2015 3:16 PM > To: netdev@vger.kernel.org; Liberman Igal-B31950 > Cc: linuxppc-dev@lists.ozlabs.org; linux-kernel@vger.kernel.org; Bucur > Madalin-Cristian-B32716 > Subject: Re: [RFC,v3,12/12] fsl/fman: Add FMan MAC driver > > 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/