Re: [PATCH v4 2/3] net: fsl_enetc_xpcs_phy: Add SGMII 1G support for i.MX95 Ethernet PHY Wrapper
Marek Vasut <[email protected]>
| Newsgroups | org.u-boot-project.lists.u-boot |
|---|---|
| Message-ID | <[email protected]> |
On 8/18/26 5:18 AM, [email protected] wrote: > + /* 4.2 Poll for SRAM initialization done */ > + begin = get_timer(0); > + do { > + val = xpcs_phy_read_pma(dev, PMA_MP_12G_16G_25G_SRAM); > + if (get_timer(begin) > 500) { > + dev_err(dev, "Polling timeout, line: %d\n", __LINE__); > + goto timeout; > + } > + mdelay(10); Could you use read_poll_timeout() for this ? read_poll_timeout() "op" would be "xpcs_phy_read_pma" and "args" would be "dev, PMA_MP_12G_16G_25G_SRAM)" , this: " ret = read_poll_timeout(xpcs_phy_read_pma, val, val & PMA_SRAM_INIT_DN, 10000, 500000, dev, PMA_MP_12G_16G_25G_SRAM); if (ret) ... timeout ... " > + } while (!(val & PMA_SRAM_INIT_DN)); > + > + /* Assert SRAM external loading done */ > + xpcs_phy_write(dev, XPCS_PHY_GLOBAL, XPCS_PHY_REG(GLOBAL_CTRL_EX_0), > + GLOBAL_CTRL_EX_0_PHY_SRAM_BYPASS); > + > + /* 4.3 Poll for vendor-specific soft reset */ > + begin = get_timer(0); > + do { > + val = xpcs_read(dev, MDIO_MMD_PCS, XPCS_PHY_REG(PCS_DIG_CTRL1)); > + if (get_timer(begin) > 500) { > + dev_err(dev, "Polling timeout, line: %d\n", __LINE__); > + goto timeout; > + } > + mdelay(10); > + } while (val & PCS_DIG_CTRL1_VR_RST); [...]