Lines Matching refs:phydev
36 static int xilinxphy_startup(struct phy_device *phydev) in xilinxphy_startup() argument
45 err = genphy_update_link(phydev); in xilinxphy_startup()
49 if (AUTONEG_ENABLE == phydev->autoneg) { in xilinxphy_startup()
50 status = phy_read(phydev, MDIO_DEVAD_NONE, MII_LPA); in xilinxphy_startup()
54 phydev->duplex = DUPLEX_FULL; in xilinxphy_startup()
56 phydev->duplex = DUPLEX_HALF; in xilinxphy_startup()
60 phydev->speed = SPEED_1000; in xilinxphy_startup()
64 phydev->speed = SPEED_100; in xilinxphy_startup()
68 phydev->speed = SPEED_10; in xilinxphy_startup()
72 int bmcr = phy_read(phydev, MDIO_DEVAD_NONE, MII_BMCR); in xilinxphy_startup()
78 phydev->duplex = DUPLEX_FULL; in xilinxphy_startup()
80 phydev->duplex = DUPLEX_HALF; in xilinxphy_startup()
83 phydev->speed = SPEED_1000; in xilinxphy_startup()
85 phydev->speed = SPEED_100; in xilinxphy_startup()
87 phydev->speed = SPEED_10; in xilinxphy_startup()
94 if (phydev->flags == XAE_PHY_TYPE_1000BASE_X) { in xilinxphy_startup()
95 phydev->duplex = DUPLEX_FULL; in xilinxphy_startup()
96 phydev->speed = SPEED_1000; in xilinxphy_startup()
102 static int xilinxphy_of_init(struct phy_device *phydev) in xilinxphy_of_init() argument
107 phytype = fdtdec_get_int(gd->fdt_blob, dev_of_offset(phydev->dev), in xilinxphy_of_init()
110 phydev->flags |= XAE_PHY_TYPE_1000BASE_X; in xilinxphy_of_init()
115 static int xilinxphy_config(struct phy_device *phydev) in xilinxphy_config() argument
120 xilinxphy_of_init(phydev); in xilinxphy_config()
121 temp = phy_read(phydev, MDIO_DEVAD_NONE, MII_BMCR); in xilinxphy_config()
123 phy_write(phydev, MDIO_DEVAD_NONE, MII_BMCR, temp); in xilinxphy_config()