Ethernet PHY - Software reset don't working
I have a working RLT8211F at my STM32MP257F board.
I wonder why only the hardware reset is working PYRSTB (pin 12), but the software reset won't work?
Should they not do the exactly the same thing?
My Ethernet PHY is working, but it seems it requires as hardware reset GPIO from the MPU.
I have tried to modify the code in realtek.c and phy_device.c by adding the function genphy_soft_reset to the struct in realtek.c.
}, {
PHY_ID_MATCH_EXACT(0x001cc916),
.name = "RTL8211F Gigabit Ethernet",
.probe = rtl8211f_probe,
.soft_reset = genphy_soft_reset, /* <------- this */
.config_init = &rtl8211f_config_init,
.read_status = rtlgen_read_status,
.config_intr = &rtl8211f_config_intr,
.handle_interrupt = rtl8211f_handle_interrupt,
.set_wol = rtl8211f_set_wol,
.get_wol = rtl8211f_get_wol,
.suspend = rtl8211f_suspend,
.resume = rtl8211f_resume,
.read_page = rtl821x_read_page,
.write_page = rtl821x_write_page,
.flags = PHY_ALWAYS_CALL_SUSPEND,
.led_hw_is_supported = rtl8211x_led_hw_is_supported,
.led_hw_control_get = rtl8211f_led_hw_control_get,
.led_hw_control_set = rtl8211f_led_hw_control_set,
.disable_autonomous_eee = rtl8211f_disable_autonomous_eee,
}, {
So it can do a software reset at the initial beginning. But his did not work at all.
https://github.com/STMicroelectronics/linux/blob/v6.6-stm32mp/drivers/net/phy/phy_device.c#L1256C1-L1294C28
int phy_init_hw(struct phy_device *phydev)
{
int ret = 0;
/* Deassert the reset signal */
phy_device_reset(phydev, 0);
if (!phydev->drv)
return 0;
if (phydev->drv->soft_reset) {
ret = phydev->drv->soft_reset(phydev);
/* see comment in genphy_soft_reset for an explanation */
if (!ret)
phydev->suspended = 0;
}
if (ret < 0)
return ret;
ret = phy_scan_fixups(phydev);
if (ret < 0)
return ret;
if (phydev->drv->config_init) {
ret = phydev->drv->config_init(phydev);
if (ret < 0)
return ret;
}
if (phydev->drv->config_intr) {
ret = phydev->drv->config_intr(phydev);
if (ret < 0)
return ret;
}
return 0;
}
EXPORT_SYMBOL(phy_init_hw);
