Pasthis

Raw | New paste
Never expires.
const char* jag_eth0 = "/ethernet@fe1b0000"; 
struct udevice *devp;

if (uclass_get_device_by_of_path(UCLASS_ETH, jag_eth0, &devp)) {
    printf("Ethernet PHY (%s) not found in U-Boot, not fixing up kernel DT\n", jag_eth0);
    return 0;
}

struct mii_dev *mii = eth_phy_get_mdio_bus(devp);

printf("%s: %d phyid=0x%08x\n", __func__, __LINE__, mii->phymap[JAG_ETH0_PHY_ADDR]->phy_id);