• Brad Mouring's avatar
    net: macb: Add phy-handle DT support · 2105a5d3
    Brad Mouring authored
    This optional binding (as described in the ethernet DT bindings doc)
    directs the netdev to the phydev to use. This is useful for a phy
    chip that has >1 phy in it, and two netdevs are using the same phy
    chip (i.e. the second mac's phy lives on the first mac's MDIO bus)
    
    The devicetree snippet would look something like this:
    
    ethernet@feedf00d {
    	...
    	phy-handle = <&phy0> // the first netdev is physically wired to phy0
    	...
    	phy0: phy@0 {
    		...
    		reg = <0x0> // MDIO address 0
    		...
    	}
    	phy1: phy@1 {
    		...
    		reg = <0x1> // MDIO address 1
    		...
    	}
    ...
    }
    
    ethernet@deadbeef {
    	...
    	phy-handle = <&phy1> // tells the driver to use phy1 on the
    						 // first mac's mdio bus (it's wired thusly)
    	...
    }
    
    The work done to add the phy_node in the first place (dacdbb4d:
    "net: macb: add fixed-link node support") will consume the
    device_node (if found).
    Signed-off-by: default avatarBrad Mouring <brad.mouring@ni.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    2105a5d3
macb_main.c 104 KB