All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Wang, Dongsheng" <dongsheng.wang@hxt-semitech.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: Florian Fainelli <f.fainelli@gmail.com>,
	"timur@kernel.org" <timur@kernel.org>,
	"davem@davemloft.net" <davem@davemloft.net>,
	"Zheng, Joey" <yu.zheng@hxt-semitech.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>
Subject: Re: [PATCH v2 2/4] dt-bindings: net: qcom: Add binding for shared mdio bus
Date: Wed, 19 Sep 2018 09:19:19 +0000	[thread overview]
Message-ID: <7696bcd8ca594b1da683b437197b4ddf@HXTBJIDCEMVIW02.hxtcorp.net> (raw)
In-Reply-To: 20180918123545.GA29092@lunn.ch

On 2018/9/18 20:35, Andrew Lunn wrote:
>>> If you want to describe the MDIO controller, then you embed a mdio
>>> subnode into your Ethernet MAC node:
>>>
>>>  emac0: ethernet@feb20000 {
>>> 	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:

Yes, these are all things that must be done, and emac driver will
connect phy when mac up.
If we had a separate MDIO controller, the MAC would not care about MDIO
bus. But MDIO is integrated within the EMAC, and emac driver maintains
the mdio.

Each EMAC do their mdio register/unregister. But in the shared scenario,
the EMACs that use the shared bus do not need to create an MDIO and
cannot release the Shared bus.

In device tree environment as you and Florian said. Just use phy-handle
get the phy_node.
The EMAC would not care about the phy come from which MDIO bus because
the phy device gets from the device_node match(phy-handle). And if the
phy_dev cannot get through phy_node means, the mdio bus is not ready.

But ACPI environment my understand is this:
First method. EMAC driver gets the shared MDIO bus, and maintain it.
The second way, EMAC match the phy_dev from the name.
These patch series try to use the FIRST way. Now I prefer to use the
second way to do the shared function.

I will rework this patchset and maybe patches will be a delay for a few
days.

Cheers,
Dongsheng
> 	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
>

  reply	other threads:[~2018-09-19 14:58 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-17  8:53 [PATCH v2 0/4] net: qcom/emac: add shared mdio bus support Wang Dongsheng
2018-09-17  8:53 ` Wang Dongsheng
2018-09-17  8:53 ` [PATCH v2 1/4] net: qcom/emac: split phy_config to mdio bus create and get phy device Wang Dongsheng
2018-09-17  8:53 ` [PATCH v2 2/4] dt-bindings: net: qcom: Add binding for shared mdio bus Wang Dongsheng
2018-09-17  8:53   ` Wang Dongsheng
2018-09-17 14:50   ` Andrew Lunn
2018-09-17 16:47     ` Wang, Dongsheng
2018-09-17 16:54       ` Florian Fainelli
2018-09-18  8:47         ` Wang, Dongsheng
2018-09-18 12:35           ` Andrew Lunn
2018-09-19  9:19             ` Wang, Dongsheng [this message]
2018-09-19 12:25               ` Andrew Lunn
2018-09-19 14:05                 ` Timur Tabi
2018-09-19 15:20                   ` Andrew Lunn
2018-09-20 13:42                     ` Timur Tabi
2018-10-25 10:08                       ` [PATCH v3 0/2] net: qcom/emac: add shared mdio bus support Wang Dongsheng
2018-10-25 10:08                         ` [PATCH v3 1/2] net: qcom/emac: split phy_config to mdio bus create and get phy device Wang Dongsheng
2018-10-25 10:09                         ` [PATCH v3 2/2] net: qcom/emac: add phy-handle support for ACPI Wang Dongsheng
2018-10-25 19:24                           ` Andrew Lunn
2018-10-26  2:18                             ` Wang, Dongsheng
2018-10-26  2:37                               ` Timur Tabi
2018-10-26  3:04                                 ` Wang, Dongsheng
2018-10-26 13:13                                   ` Andrew Lunn
2018-10-29  2:39                                     ` Wang, Dongsheng
2018-10-29 12:40                                       ` Andrew Lunn
2018-10-30  5:15                                         ` Wang, Dongsheng
2018-11-08  7:21                                         ` [RFC PATCH 0/3] acpi: Add acpi mdio support code Wang Dongsheng
2018-11-08  7:21                                           ` Wang Dongsheng
2018-11-08  7:22                                           ` [RFC PATCH 1/3] " Wang Dongsheng
2018-11-08  7:22                                             ` Wang Dongsheng
2018-11-08  7:45                                             ` Rafael J. Wysocki
2018-11-08  7:55                                               ` Wang, Dongsheng
2018-11-08  8:01                                                 ` Rafael J. Wysocki
2018-11-12 17:25                                             ` Andrew Lunn
2018-11-08  7:22                                           ` [RFC PATCH 2/3] net: qcom/emac: split phy_config to mdio bus create and get phy device Wang Dongsheng
2018-11-08  7:22                                             ` Wang Dongsheng
2018-11-08  7:22                                           ` [RFC PATCH 3/3] net: qcom/emac: add phy-handle support for ACPI Wang Dongsheng
2018-11-08  7:22                                             ` Wang Dongsheng
2018-11-08 23:23                                           ` [RFC PATCH 0/3] acpi: Add acpi mdio support code Andrew Lunn
2018-11-09  0:37                                             ` Timur Tabi
2018-11-10  9:10                                             ` Wang, Dongsheng
2018-11-12 17:20                                               ` Andrew Lunn
2018-11-13  7:36                                                 ` Wang, Dongsheng
2018-11-12  2:52                                             ` Wang, Dongsheng
2018-09-20  1:33                   ` [PATCH v2 2/4] dt-bindings: net: qcom: Add binding for shared mdio bus Wang, Dongsheng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7696bcd8ca594b1da683b437197b4ddf@HXTBJIDCEMVIW02.hxtcorp.net \
    --to=dongsheng.wang@hxt-semitech.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=f.fainelli@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=timur@kernel.org \
    --cc=yu.zheng@hxt-semitech.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.