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