OSDN Git Service

net: macb: Add phy-handle DT support
authorBrad Mouring <brad.mouring@ni.com>
Tue, 13 Mar 2018 21:32:15 +0000 (16:32 -0500)
committerDavid S. Miller <davem@davemloft.net>
Fri, 16 Mar 2018 15:14:33 +0000 (11:14 -0400)
commit2105a5d3acd778e20634f25950cc9254ea408efe
treeee9dc62f9caae8c8e002aede16e3847a4bb6fd31
parentcb732e9a26f336ddd3e7ef4dba84ce190d1e175e
net: macb: Add phy-handle DT support

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 (dacdbb4dfc1a1:
"net: macb: add fixed-link node support") will consume the
device_node (if found).

Signed-off-by: Brad Mouring <brad.mouring@ni.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/cadence/macb_main.c