[PATCH 2/3] netdev/of/phy: Add MDIO bus multiplexer support.
Grant Likely
grant.likely at secretlab.ca
Thu Sep 15 10:51:02 EST 2011
On Aug 31, 2011 2:01 PM, "David Daney" <david.daney at cavium.com> wrote:
>
> This patch adds a somewhat generic framework for MDIO bus
> multiplexers. It is modeled on the I2C multiplexer.
>
> The multiplexer is needed if there are multiple PHYs with the same
> address connected to the same MDIO bus adepter, or if there is
> insufficient electrical drive capability for all the connected PHY
> devices.
>
> Conceptually it could look something like this:
>
> ------------------
> | Control Signal |
> --------+---------
> |
> --------------- --------+------
> | MDIO MASTER |---| Multiplexer |
> --------------- --+-------+----
> | |
> C C
> h h
> i i
> l l
> d d
> | |
> --------- A B ---------
> | | | | | |
> | PHY at 1 +-------+ +---+ PHY at 1 |
> | | | | | |
> --------- | | ---------
> --------- | | ---------
> | | | | | |
> | PHY at 2 +-------+ +---+ PHY at 2 |
> | | | |
> --------- ---------
>
> This framework configures the bus topology from device tree data. The
> mechanics of switching the multiplexer is left to device specific
> drivers.
>
> The follow-on patch contains a multiplexer driven by GPIO lines.
>
> Signed-off-by: David Daney <david.daney at cavium.com>
> Cc: Grant Likely <grant.likely at secretlab.ca>
> Cc: "David S. Miller" <davem at davemloft.net>
> ---
> Documentation/devicetree/bindings/net/mdio-mux.txt | 132 ++++++++++++++
> drivers/net/phy/Kconfig | 8 +
> drivers/net/phy/Makefile | 1 +
> drivers/net/phy/mdio-mux.c | 182
++++++++++++++++++++
> include/linux/mdio-mux.h | 18 ++
> 5 files changed, 341 insertions(+), 0 deletions(-)
> create mode 100644 Documentation/devicetree/bindings/net/mdio-mux.txt
> create mode 100644 drivers/net/phy/mdio-mux.c
> create mode 100644 include/linux/mdio-mux.h
>
> diff --git a/Documentation/devicetree/bindings/net/mdio-mux.txt
b/Documentation/devicetree/bindings/net/mdio-mux.txt
> new file mode 100644
> index 0000000..a908312
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/net/mdio-mux.txt
> @@ -0,0 +1,132 @@
> +Common MDIO bus multiplexer/switch properties.
> +
> +An MDIO bus multiplexer/switch will have several child busses that are
> +numbered uniquely in a device dependent manner. The nodes for an MDIO
> +bus multiplexer/switch will have one child node for each child bus.
> +
> +Required properties:
> +- parent-bus : phandle to the parent MDIO bus.
As discussed, I like mdio-parent-bus.
> +
> +Optional properties:
> +- Other properties specific to the multiplexer/switch hardware.
> +
> +Required properties for child nodes:
> +- #address-cells = <1>;
> +- #size-cells = <0>;
> +- cell-index : The sub-bus number.
Use reg, not cell-index. That is what it is there for. And add the
appropriate #address/size-cells in the parent.
I've not reviewed the implementation, but with the changes. I'm okay with
the binding.
g.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ozlabs.org/pipermail/devicetree-discuss/attachments/20110914/ecde4527/attachment.html>
More information about the devicetree-discuss
mailing list