drivers/net/sun8i_emac.cImmediately the advantage of having done a build for the target we are interested in comes into focus. We can do "ls *.o" and see that the above file is the only file of the dozens in this directory which was actually compiled. In particular, there is a file "sunxi_emac.c" which is highly suggestive, but as it turns out entirely irrelevant.
bus->read = sun8i_mdio_read; bus->write = sun8i_mdio_write; bus->priv = (void *)priv; bus->reset = sun8i_mdio_reset; return mdio_register(bus);The routine mdio_register() is in common/miiphyutil.c
I also see the following calls:
phy_connect() in drivers/net/phy/phy.c phy_connect_dev() in drivers/net/phy/phy.c phy_config() in drivers/net/phy/phy.cThe last call is just a call to an "optional" board specific helper:
board_phy_config(phydev);Of course ctags gives 1000 options for this call, all in "board/vendor..." I take a look in the "board" directory looking for orangepi, allwinner, and then notice "sunxi". Indeed this is it with "board.o" inside. The only thing in board/sunxi/board.c having to do with "phy" is for USB.
Kyu / [email protected]