Subject: Re: [PATCH] netdev/phy: add MDIO bus multiplexer driven by a memory-mapped FPGA

From: David Daney <[email-masked]>
Date: Wed, 22 Aug 2012 15:52:32 -0700

On 08/22/2012 03:38 PM, Timur Tabi wrote:
> David Daney wrote:
>
>> I wonder if *fpga is really a good name for this.  It is a general
>> purpose multiplexer with a memory mapped control register.  I would call
>> it something like mdio-mux-mmioreg.
>
> At one point, I thought of using mdio-mux-bitbang, but -mmioreg is better.
>   Thanks.
>
>>> +- mdio-mux-device : phandle, points to the FPGA (or similar) node.  This
>>> +	must be a memory-mapped device with 8-bit registers.
>>
>> You shouldn't need this.  Just make the multiplexer a child of FPGA node
>> to indicate where it lives.
>
> The problem is that we don't normally consider the FPGA node to be a bus,
> so its child nodes won't get probed.  That's why I have this:
>

That would seem to be a mistake/error.

You should be able to arrive at any directly addressable register by 
walking down the tree to the children and applying any "ranges" 
properties at each node.  The OF infrastructure will take care of 
resolving all the addresses and you get rid of much of the code you 
added to duplicate its function.