mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-25 09:10:55 +07:00
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 (dacdbb4dfc
:
"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>
This commit is contained in:
parent
cb732e9a26
commit
2105a5d3ac
@ -488,10 +488,12 @@ static int macb_mii_probe(struct net_device *dev)
|
|||||||
}
|
}
|
||||||
bp->phy_node = of_node_get(np);
|
bp->phy_node = of_node_get(np);
|
||||||
} else {
|
} else {
|
||||||
/* fallback to standard phy registration if no phy were
|
bp->phy_node = of_parse_phandle(np, "phy-handle", 0);
|
||||||
* found during dt phy registration
|
/* fallback to standard phy registration if no
|
||||||
|
* phy-handle was found nor any phy found during
|
||||||
|
* dt phy registration
|
||||||
*/
|
*/
|
||||||
if (!phy_find_first(bp->mii_bus)) {
|
if (!bp->phy_node && !phy_find_first(bp->mii_bus)) {
|
||||||
for (i = 0; i < PHY_MAX_ADDR; i++) {
|
for (i = 0; i < PHY_MAX_ADDR; i++) {
|
||||||
struct phy_device *phydev;
|
struct phy_device *phydev;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user