Lines Matching full:phy

8 /* SiLabs Giant Gecko GG11 Ethernet PHY driver. */
24 /* Enable MDIO serial bus between MAC and PHY. */
30 /* Enable MDIO serial bus between MAC and PHY. */
36 /* Wait PHY operation complete. */
53 /* Send command to PHY over MDIO serial bus */
59 /* Write PHY management register */ in mdio_bus_send()
70 /* Wait until PHY is ready */ in mdio_bus_send()
79 /* Read PHY register. */
80 static int phy_read(const struct phy_gecko_dev *phy, uint8_t reg_addr, in phy_read() argument
83 ETH_TypeDef *const eth = phy->regs; in phy_read()
84 uint8_t phy_addr = phy->address; in phy_read()
98 /* Write PHY register. */
99 static int phy_write(const struct phy_gecko_dev *phy, uint8_t reg_addr, in phy_write() argument
102 ETH_TypeDef *const eth = phy->regs; in phy_write()
103 uint8_t phy_addr = phy->address; in phy_write()
108 /* Issue a PHY soft reset. */
109 static int phy_soft_reset(const struct phy_gecko_dev *phy) in phy_soft_reset() argument
116 retval = phy_write(phy, MII_BMCR, MII_BMCR_RESET); in phy_soft_reset()
122 * IEEE 802.3, Section 2, Subsection 22.2.4.1.1 a PHY reset may take in phy_soft_reset()
132 retval = phy_read(phy, MII_BMCR, &phy_reg); in phy_soft_reset()
141 int phy_gecko_init(const struct phy_gecko_dev *phy) in phy_gecko_init() argument
143 ETH_TypeDef *const eth = phy->regs; in phy_gecko_init()
148 LOG_INF("Soft Reset of ETH PHY"); in phy_gecko_init()
149 phy_soft_reset(phy); in phy_gecko_init()
151 /* Verify that the PHY device is responding */ in phy_gecko_init()
152 phy_id = phy_gecko_id_get(phy); in phy_gecko_init()
154 LOG_ERR("Unable to detect a valid PHY"); in phy_gecko_init()
158 LOG_INF("PHYID: 0x%X at addr: %d", phy_id, phy->address); in phy_gecko_init()
165 uint32_t phy_gecko_id_get(const struct phy_gecko_dev *phy) in phy_gecko_id_get() argument
167 ETH_TypeDef *const eth = phy->regs; in phy_gecko_id_get()
173 if (phy_read(phy, MII_PHYID1R, &phy_reg) < 0) { in phy_gecko_id_get()
179 if (phy_read(phy, MII_PHYID2R, &phy_reg) < 0) { in phy_gecko_id_get()
190 int phy_gecko_auto_negotiate(const struct phy_gecko_dev *phy, in phy_gecko_auto_negotiate() argument
193 ETH_TypeDef *const eth = phy->regs; in phy_gecko_auto_negotiate()
202 LOG_DBG("Starting ETH PHY auto-negotiate sequence"); in phy_gecko_auto_negotiate()
204 /* Read PHY default advertising parameters */ in phy_gecko_auto_negotiate()
205 retval = phy_read(phy, MII_ANAR, &ability_adv); in phy_gecko_auto_negotiate()
211 retval = phy_read(phy, MII_BMCR, &val); in phy_gecko_auto_negotiate()
217 val &= ~MII_BMCR_ISOLATE; /* Don't isolate the PHY */ in phy_gecko_auto_negotiate()
219 retval = phy_write(phy, MII_BMCR, val); in phy_gecko_auto_negotiate()
233 retval = phy_read(phy, MII_BMSR, &val); in phy_gecko_auto_negotiate()
239 LOG_DBG("PHY auto-negotiate sequence completed"); in phy_gecko_auto_negotiate()
242 retval = phy_read(phy, MII_ANLPAR, &ability_rcvd); in phy_gecko_auto_negotiate()
267 bool phy_gecko_is_linked(const struct phy_gecko_dev *phy) in phy_gecko_is_linked() argument
269 ETH_TypeDef *const eth = phy->regs; in phy_gecko_is_linked()
275 if (phy_read(phy, MII_BMSR, &phy_reg) < 0) { in phy_gecko_is_linked()