Skip to content

Conversation

CkovMk
Copy link
Contributor

@CkovMk CkovMk commented Sep 19, 2025

Add YT8521 PHY driver and enable it on FRDM-IMX93

Test PHY driver using zperf:
west build -p always -b frdm_imx93/mimx9352/a55 samples/net/zperf/

Signed-off-by: Hongbo Wang <[email protected]>
PHY chip YT8521, the driver is:
drivers/ethernet/phy/phy_motorcomm_yt8521.c

Signed-off-by: Hongbo Wang <[email protected]>
@maass-hamburg
Copy link
Member

Why can't the generic ethernet-phy already in zephyr can't be used instead. I don't see you using external irq pins, that would indicate the need for a special driver.

@CkovMk
Copy link
Contributor Author

CkovMk commented Sep 19, 2025

@maass-hamburg It may because YT8521 has device specific regs other than common MII regs.
I'm not the original author of this driver, if you think there's no need for a special driver I could double check with the author.

Comment on lines +558 to +577
/* set default reg space */
mc_ytphy_write_ext(dev, YT8521_REG_SPACE_SELECT_REG, YT8521_RSSR_UTP_SPACE);

mc_ytphy_modify_ext(dev, YTPHY_SYNCE_CFG_REG, YT8521_SCR_SYNCE_ENABLE, 0);

ret = mc_ytphy_get_features(dev);
if (ret) {
return -EIO;
}

/* Reset PHY */
ret = mc_ytphy_soft_reset(dev);
if (ret) {
return -EIO;
}

/* Enable clock delay */
mc_ytphy_cfg_clock_delay(dev);

mc_ytphy_resume(dev);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it seems like these are the differences, check if these are needed, also the things that are set in them like the rx/tx rgmii delay isboard specific and should not be hardcoded and instead be props from the dt.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added dt props

@CkovMk
Copy link
Contributor Author

CkovMk commented Sep 22, 2025

Added rx and tx delay sel dt props.

Separate commit is created for easier review. Will squash it before merge.

- Moves binding to phy subdir
- Add rx and tx delay sel
- Format code
- Update frdm-imx93 dts accordingly

Signed-off-by: Chekhov Ma <[email protected]>
@CkovMk CkovMk force-pushed the pr/frdm-imx93-ethernet branch from 96eb915 to c652c1a Compare September 22, 2025 06:08
Copy link

@CkovMk CkovMk marked this pull request as draft September 22, 2025 10:42
@CkovMk
Copy link
Contributor Author

CkovMk commented Sep 22, 2025

The driver needs to be adapted to recent Zephyr version. Convert to draft.

@JiafeiPan
Copy link
Contributor

Close this one as a new PR is created for this: #97535

@JiafeiPan JiafeiPan closed this Oct 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants