[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180918123545.GA29092@lunn.ch>
Date: Tue, 18 Sep 2018 14:35:45 +0200
From: Andrew Lunn <andrew@...n.ch>
To: "Wang, Dongsheng" <dongsheng.wang@...-semitech.com>
Cc: Florian Fainelli <f.fainelli@...il.com>,
"timur@...nel.org" <timur@...nel.org>,
"davem@...emloft.net" <davem@...emloft.net>,
"Zheng, Joey" <yu.zheng@...-semitech.com>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>
Subject: Re: [PATCH v2 2/4] dt-bindings: net: qcom: Add binding for shared
mdio bus
> > If you want to describe the MDIO controller, then you embed a mdio
> > subnode into your Ethernet MAC node:
> >
> > emac0: ethernet@...20000 {
> > mdio {
> > #address-cells = <1>;
> > #size-cells = <0>;
> >
> > phy0: ethernet-phy@0 {
> > reg = <0>;
> > };
> > };
> > };
> >
> > And then each Ethernet MAC controller refers to their appropriate PHY
> > device tree node using a phy-handle property to point to either their
> > own MDIO controller, or another MAC's MDIO controller.
> Sorry, I do not understand how phy-handle point to MDIO controller,
> because phy-handle is defined to point to a phy.
The MAC driver does not care what MDIO controller a PHY is on. All you
need to do to register the PHY is:
phy_node = of_parse_phandle(np, "phy-handle", 0);
phy_interface = of_get_phy_mode(np);
phydev = of_phy_connect(dev, phy_node,
&handle_link_change, 0,
phy_interface);
Andrew
Powered by blists - more mailing lists