From mboxrd@z Thu Jan 1 00:00:00 1970 From: andrew@lunn.ch (Andrew Lunn) Date: Wed, 6 Jul 2016 16:21:21 +0200 Subject: [RFC PATCH v2 1/4] Documentation: DT: net: Add Xilinx gmiitorgmii converter device tree binding documentation In-Reply-To: <03CA77BA8AF6F1469AEDFBDA1322A7B74A193913@XAP-PVEXMBX02.xlnx.xilinx.com> References: <1467623084-15471-1-git-send-email-appanad@xilinx.com> <1467623084-15471-2-git-send-email-appanad@xilinx.com> <20160704140458.GC3282@lunn.ch> <03CA77BA8AF6F1469AEDFBDA1322A7B74A193913@XAP-PVEXMBX02.xlnx.xilinx.com> Message-ID: <20160706142121.GI19800@lunn.ch> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org > > Hi Kedareswara > > > > So looking at the device tree, you have the gmiitorgmii as an mdio > > device. It will get probed as an mdio device, and from that you know > > the address on the bus. However, your driver does not actually do > > this. xilinx_gmii2rgmii.c is just a library of two functions, and does > > not use any of this device tree information. You device tree binding > > is completely bogus. > > > > What i think is a much more logical structure, and fits the hardware, > > which is what DT is all about, is to make your driver an mdio driver. > > Also, have a phy-handle pointing to the PHY in the gmii_to_rgmii node. > > You then no longer need the exported gmii2rgmii_phyprobe() function. > > > > Next, you want gmiitorgmii driver to register a phy. The MAC driver > > can then look this up using phy-handle: > > > > mdio { > > #address-cells = <1>; > > #size-cells = <0>; > > > > phy: ethernet-phy at 0 { > > reg = <0>; > > }; > > > > gmii_to_rgmii: gmii-to-rgmii at 8 { > > compatible = "xlnx,gmiitorgmii"; > > reg = <8>; > > phy-handle = <&phy>; > > }; > > }; > > > Thanks for your inputs initially we too thought the similar implementation > But the GMII2RGMII converter contains only one register and it is > not compatible to the standard ethernet MII interface. Also it doesn't have > a standard VID and PID registers So, during the mdio bus scan, this device will > not appear. Hi Punnaiah Use missed some subtlety in my description. I did not call the GMII2RGMII a PHY device, i called it an MDIO device. These are different things. Go look at the MDIO subsystem to figure out the difference. Andrew From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Lunn Subject: Re: [RFC PATCH v2 1/4] Documentation: DT: net: Add Xilinx gmiitorgmii converter device tree binding documentation Date: Wed, 6 Jul 2016 16:21:21 +0200 Message-ID: <20160706142121.GI19800@lunn.ch> References: <1467623084-15471-1-git-send-email-appanad@xilinx.com> <1467623084-15471-2-git-send-email-appanad@xilinx.com> <20160704140458.GC3282@lunn.ch> <03CA77BA8AF6F1469AEDFBDA1322A7B74A193913@XAP-PVEXMBX02.xlnx.xilinx.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <03CA77BA8AF6F1469AEDFBDA1322A7B74A193913-4lKfpRxZ5ekkx2a1wsGfbYg+Gb3gawCHQz34XiSyOiE@public.gmane.org> Sender: devicetree-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Punnaiah Choudary Kalluri Cc: Appana Durga Kedareswara Rao , "robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org" , "mark.rutland-5wv7dgnIgG8@public.gmane.org" , Michal Simek , Soren Brinkmann , "nicolas.ferre-AIFe0yeh4nAAvxtiuMwx3w@public.gmane.org" , "f.fainelli-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org" , Anirudha Sarangi , Harini Katakam , "netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , "devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , "linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org" , "linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" List-Id: devicetree@vger.kernel.org > > Hi Kedareswara > > > > So looking at the device tree, you have the gmiitorgmii as an mdio > > device. It will get probed as an mdio device, and from that you know > > the address on the bus. However, your driver does not actually do > > this. xilinx_gmii2rgmii.c is just a library of two functions, and does > > not use any of this device tree information. You device tree binding > > is completely bogus. > > > > What i think is a much more logical structure, and fits the hardware, > > which is what DT is all about, is to make your driver an mdio driver. > > Also, have a phy-handle pointing to the PHY in the gmii_to_rgmii node. > > You then no longer need the exported gmii2rgmii_phyprobe() function. > > > > Next, you want gmiitorgmii driver to register a phy. The MAC driver > > can then look this up using phy-handle: > > > > mdio { > > #address-cells = <1>; > > #size-cells = <0>; > > > > phy: ethernet-phy@0 { > > reg = <0>; > > }; > > > > gmii_to_rgmii: gmii-to-rgmii@8 { > > compatible = "xlnx,gmiitorgmii"; > > reg = <8>; > > phy-handle = <&phy>; > > }; > > }; > > > Thanks for your inputs initially we too thought the similar implementation > But the GMII2RGMII converter contains only one register and it is > not compatible to the standard ethernet MII interface. Also it doesn't have > a standard VID and PID registers So, during the mdio bus scan, this device will > not appear. Hi Punnaiah Use missed some subtlety in my description. I did not call the GMII2RGMII a PHY device, i called it an MDIO device. These are different things. Go look at the MDIO subsystem to figure out the difference. Andrew -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754504AbcGFOVh (ORCPT ); Wed, 6 Jul 2016 10:21:37 -0400 Received: from vps0.lunn.ch ([178.209.37.122]:36941 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753678AbcGFOVf (ORCPT ); Wed, 6 Jul 2016 10:21:35 -0400 Date: Wed, 6 Jul 2016 16:21:21 +0200 From: Andrew Lunn To: Punnaiah Choudary Kalluri Cc: Appana Durga Kedareswara Rao , "robh+dt@kernel.org" , "mark.rutland@arm.com" , Michal Simek , Soren Brinkmann , "nicolas.ferre@atmel.com" , "f.fainelli@gmail.com" , Anirudha Sarangi , Harini Katakam , "netdev@vger.kernel.org" , "devicetree@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" Subject: Re: [RFC PATCH v2 1/4] Documentation: DT: net: Add Xilinx gmiitorgmii converter device tree binding documentation Message-ID: <20160706142121.GI19800@lunn.ch> References: <1467623084-15471-1-git-send-email-appanad@xilinx.com> <1467623084-15471-2-git-send-email-appanad@xilinx.com> <20160704140458.GC3282@lunn.ch> <03CA77BA8AF6F1469AEDFBDA1322A7B74A193913@XAP-PVEXMBX02.xlnx.xilinx.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <03CA77BA8AF6F1469AEDFBDA1322A7B74A193913@XAP-PVEXMBX02.xlnx.xilinx.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > Hi Kedareswara > > > > So looking at the device tree, you have the gmiitorgmii as an mdio > > device. It will get probed as an mdio device, and from that you know > > the address on the bus. However, your driver does not actually do > > this. xilinx_gmii2rgmii.c is just a library of two functions, and does > > not use any of this device tree information. You device tree binding > > is completely bogus. > > > > What i think is a much more logical structure, and fits the hardware, > > which is what DT is all about, is to make your driver an mdio driver. > > Also, have a phy-handle pointing to the PHY in the gmii_to_rgmii node. > > You then no longer need the exported gmii2rgmii_phyprobe() function. > > > > Next, you want gmiitorgmii driver to register a phy. The MAC driver > > can then look this up using phy-handle: > > > > mdio { > > #address-cells = <1>; > > #size-cells = <0>; > > > > phy: ethernet-phy@0 { > > reg = <0>; > > }; > > > > gmii_to_rgmii: gmii-to-rgmii@8 { > > compatible = "xlnx,gmiitorgmii"; > > reg = <8>; > > phy-handle = <&phy>; > > }; > > }; > > > Thanks for your inputs initially we too thought the similar implementation > But the GMII2RGMII converter contains only one register and it is > not compatible to the standard ethernet MII interface. Also it doesn't have > a standard VID and PID registers So, during the mdio bus scan, this device will > not appear. Hi Punnaiah Use missed some subtlety in my description. I did not call the GMII2RGMII a PHY device, i called it an MDIO device. These are different things. Go look at the MDIO subsystem to figure out the difference. Andrew