Skip to content

Commit dbe17e7

Browse files
WeiFang-NXPPaolo Abeni
authored andcommitted
net: enetc: do not skip setting LaBCR[MDIO_PHYAD_PRTAD] for addr 0
Given that some platforms may use PHY address 0 (I suppose the PHY may not treat address 0 as a broadcast address or default response address). It is possible for some boards to connect multiple PHYs to the same ENETC MAC, for example: - a PHY with a non-zero address connects to ENETC MAC through SGMII interface (selected via DTS_A) - a PHY with address 0 connects to ENETC MAC through RGMII interface (selected via DTS_B) For the case where the ENETC port MDIO is used to manage the PHY, when switching from DTS_A to DTS_B via soft reboot, LaBCR[MDIO_PHYAD_PRTAD] must be updated to 0 because the NETCMIX block is not reset during soft reboot. However, the current driver explicitly skips configuring address 0, causing LaBCR[MDIO_PHYAD_PRTAD] to retain its old value. Therefore, remove the special-case skip of PHY address 0 so that valid configurations using address 0 are properly supported. Fixes: 6633df0 ("net: enetc: set the external PHY address in IERB for port MDIO usage") Fixes: 50bfd9c ("net: enetc: set external PHY address in IERB for i.MX94 ENETC") Reviewed-by: Clark Wang <xiaoning.wang@nxp.com> Signed-off-by: Wei Fang <wei.fang@nxp.com> Link: https://patch.msgid.link/20260305031211.904812-3-wei.fang@nxp.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
1 parent 246953f commit dbe17e7

1 file changed

Lines changed: 0 additions & 12 deletions

File tree

drivers/net/ethernet/freescale/enetc/netc_blk_ctrl.c

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -438,12 +438,6 @@ static int imx95_enetc_mdio_phyaddr_config(struct platform_device *pdev)
438438
return -EINVAL;
439439
}
440440

441-
/* The default value of LaBCR[MDIO_PHYAD_PRTAD ] is
442-
* 0, so no need to set the register.
443-
*/
444-
if (!addr)
445-
continue;
446-
447441
switch (bus_devfn) {
448442
case IMX95_ENETC0_BUS_DEVFN:
449443
netc_reg_write(priv->ierb, IERB_LBCR(0),
@@ -590,12 +584,6 @@ static int imx94_enetc_mdio_phyaddr_config(struct netc_blk_ctrl *priv,
590584
return addr;
591585
}
592586

593-
/* The default value of LaBCR[MDIO_PHYAD_PRTAD] is 0,
594-
* so no need to set the register.
595-
*/
596-
if (!addr)
597-
return 0;
598-
599587
if (phy_mask & BIT(addr)) {
600588
dev_err(dev,
601589
"Find same PHY address in EMDIO and ENETC node\n");

0 commit comments

Comments
 (0)