Received: by 2002:ac0:950c:0:0:0:0:0 with SMTP id f12csp1049400imc; Mon, 11 Mar 2019 05:29:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqwPdMWcj5JovBeBWRChMLjYzh/lAoZqtM+EVtjYs6PL/9TYg3hn4XVPTYmv4nbouz4d0vez X-Received: by 2002:a65:4384:: with SMTP id m4mr29505409pgp.375.1552307350835; Mon, 11 Mar 2019 05:29:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552307350; cv=none; d=google.com; s=arc-20160816; b=cItJ3iKMG58x/xpRyqbpePp+drNDd4lK54B/SVHqdQHFA0MBHbbnRhaIhwRYCzJ98j RdWCgJt9oPN4NAePhxtMpSWUMJlrqlz/Al2Mih+ju+kNUOIC0kuXfUbp1sD4yUxYbmIe cqCAj22XF5Q193GAz4XcsFmEhwmMrTO+vZ74MnnYqGwAv9sMOSF0P+ilvJkyBgDuR7yU s9eU+duW6U3YZFWeSTkfmJ3/Jusle4BnfLXs/em4KaBtpZDCDTXKFqPdlliSRspQcBUv 37u0jz8atgDr++MT7XzS9NwnOMEHz7hfuos1+ZhAismmczJvGoVovbxJov4hYezZ+25H VBJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=MivUfwAF8id8U4PNcmDQ+n5SKWGtEZQQuDAkhjyNSU4=; b=B+zrAbxLvpvJGOfc1elhR7spYCoUB0Q5qlMxyk25Ba0XIBizpH3V6FKFWCUnKcSKmX a+cdLlJBkh+6DuXLO3ho0+gC1q8hJouuqFwwIAnr8quBmznx0hrJrM3COJImr0fL/OJB SS8rLm+FUdm6LWABlaDMgl9yErnIQT2kL16w295yCI+ccd4wkC0M05qx43Q1AQW0yuSX Yf5i13CACzHHABff4UEHX6/BhZ63ktLTDrqiYF0g9pSAfn/s0ILujtTLX7C2cPteQauR 8y4OXupZQ2xWioawI8LrhpCjzcnFJ59i2PL6JKzUh6SsuqcAFcDSZ8VR/kFuF8ASkIvx i9aw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g3si4788818pfh.86.2019.03.11.05.28.55; Mon, 11 Mar 2019 05:29:10 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727258AbfCKM1Q (ORCPT + 99 others); Mon, 11 Mar 2019 08:27:16 -0400 Received: from mail-ot1-f66.google.com ([209.85.210.66]:41460 "EHLO mail-ot1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725943AbfCKM1Q (ORCPT ); Mon, 11 Mar 2019 08:27:16 -0400 Received: by mail-ot1-f66.google.com with SMTP id t7so3715226otk.8; Mon, 11 Mar 2019 05:27:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=MivUfwAF8id8U4PNcmDQ+n5SKWGtEZQQuDAkhjyNSU4=; b=S1zYTeaCAGqfGVh6jUULr5kwjZt9mjuD/Ad3N/anP2ofQcrsiY+KTgS24U3m38ooIx o6zuEDPAdqftnnGI27UW2HL+9utXLOezq3bO+PPtczx/Ui1DpdPo/Lkz0umjBJF37u/C qw3Uyztd5RMjg8jMpSsutWZEDIYdZymmcTbCk33FSzzkdZYFCPaJOkL1jLuXams+FAbm 3S98YJLMYyL6Kvart/pQ9YWrUmPOmmk+Eke1DgF17JxOjMHQwurMgzEI4ZGwfdn1M1Bn usyA8Y6Btg/jaihsDrksE7wvahPJBrJvZDfUM4MLXV3u4NsCMY2JYmdjDvqfNU45lZzD biyw== X-Gm-Message-State: APjAAAUIMUvAMmPTcgXVtTnNvmyACPjsS6LGm2Wy+2gwY7G3dUVNox7R 0buidLiSuAQTjaCtsMf43lbrbMBtChYeeTdgMs0ftQ== X-Received: by 2002:a9d:58c6:: with SMTP id s6mr20790606oth.122.1552307235001; Mon, 11 Mar 2019 05:27:15 -0700 (PDT) MIME-Version: 1.0 References: <958bb823-3dc8-607f-3c38-3d902acb85a8@gmail.com> <20190219172515.GC13075@lunn.ch> <9cb2f7a8-a8cf-ef80-d260-cc67c072b5c5@xilinx.com> <8bb813fb-102b-00c9-fb6f-a3e928965051@xilinx.com> <20190309161912.GD9000@lunn.ch> In-Reply-To: From: Harini Katakam Date: Mon, 11 Mar 2019 17:57:03 +0530 Message-ID: Subject: Re: [PATCH RESEND net] net: phy: xgmiitorgmii: Support generic PHY status read To: Andrew Lunn Cc: Michal Simek , Paul Kocialkowski , Florian Fainelli , netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, "David S . Miller" , Thomas Petazzoni , Heiner Kallweit Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Andrew, On Mon, Mar 11, 2019 at 11:34 AM Harini Katakam wrote: > > Hi Andrew, > On Sat, Mar 9, 2019 at 9:53 PM Andrew Lunn wrote: > > > > > Related to this, I have a query on how the DT node for gmii2rgmii should look. > > > One of the users of gmii2rgmii is Cadence macb driver. In Xilinx tree, we use > > > this piece of code to register this mdiobus: > > > + mdio_np = of_get_child_by_name(np, "mdio"); > > > + if (mdio_np) { > > > + of_node_put(mdio_np); > > > + err = of_mdiobus_register(bp->mii_bus, mdio_np); > > > + if (err) > > > + goto err_out_unregister_bus; > > > > > > And the DT node looks like this: > > > ethernet { > > > phy-mode = "gmii"; > > > phy-handle = <&extphy>; > > > > > > mdio { > > > extphy { > > > reg = ; > > > }; > > > gmii_to_rgmii{ > > > compatible = "xlnx,gmii-to-rgmii-1.0"; > > > phy-handle = <&extphy>; > > > reg = ; > > > }; > > > }; > > > }; > > > > Hi Harini > > > > You have this setup: > > > > MAC <==> GMII2RGMII <==> RGMII_PHY > > > > So you want the MAC phy-handle to point to the gmii_to_rgmii 'PHY'. > > > > Feel free to submit a patch extending > > Documentation/devicetree/bindings/net/xilinx_gmii2rgmii.txt to include > > a MAC node, etc. > > Thank you, will do the same. Thanks again for your input. So, I did some testing with this change. But the issue is that, if I point the phy-handle to gmi2rgmii, of_phy_connect will be called from the MAC and it will fail because gmii2rgmii is not a PHY driver and it does not have a standard PHY register set or ID. Which goes back to the discussion above whether this needs to changed in the IP. But right now, it is a bridge device on the MDIO bus and has no PHY functionality. Moreover, any MAC is capable of accessing the external PHY with no interference in the MDIO path (the gmii2rgmii bridge just acts like another device on a common bus). What Michal suggested below in uboot is that they register gmii2rgmii with a dummy PHY ID and then attach the external phy driver in its probe. I'm not sure if this will work in linux i.e. calling phy_connect_direct inside the gmii2rgmii probe. Regards, Harini