[PATCH v3 1/2] net: fsl_enetc: fix the duplex setting on the iMX platform

Tim Harvey tharvey at gateworks.com
Fri Apr 24 17:50:45 CEST 2026


On Thu, Apr 23, 2026 at 11:54 PM <alice.guo at oss.nxp.com> wrote:
>
> From: Clark Wang <xiaoning.wang at nxp.com>
>
> The iMX and LS platforms use different bits in the same register to
> set duplex, but their logics are opposite.
> The current settings will result in unexpected configurations in
> RGMII mode.
>
> Fixes: e6df2f5e22c6 ("net: fsl_enetc: Update enetc driver to support i.MX95")
> Signed-off-by: Clark Wang <xiaoning.wang at nxp.com>
> Signed-off-by: Alice Guo <alice.guo at nxp.com>
> Reviewed-by: Peng Fan <peng.fan at nxp.com>
> ---
>  drivers/net/fsl_enetc.c | 18 +++++++++---------
>  1 file changed, 9 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/net/fsl_enetc.c b/drivers/net/fsl_enetc.c
> index 206f1a381bb..b07193e4e83 100644
> --- a/drivers/net/fsl_enetc.c
> +++ b/drivers/net/fsl_enetc.c
> @@ -18,6 +18,7 @@
>  #include <asm/io.h>
>  #include <pci.h>
>  #include <miiphy.h>
> +#include <linux/bitfield.h>
>  #include <linux/bug.h>
>  #include <linux/delay.h>
>  #include <linux/build_bug.h>
> @@ -396,7 +397,7 @@ static int enetc_init_sgmii(struct udevice *dev)
>  /* set up MAC for RGMII */
>  static void enetc_init_rgmii(struct udevice *dev, struct phy_device *phydev)
>  {
> -       u32 old_val, val, dpx = 0;
> +       u32 old_val, val = 0;
>
>         old_val = val = enetc_read_mac_port(dev, ENETC_PM_IF_MODE);
>
> @@ -416,15 +417,14 @@ static void enetc_init_rgmii(struct udevice *dev, struct phy_device *phydev)
>                 val |= ENETC_PM_IFM_SSP_10;
>         }
>
> -       if (enetc_is_imx95(dev))
> -               dpx = ENETC_PM_IFM_FULL_DPX_IMX;
> +       if  (enetc_is_imx95(dev))
> +               val = u32_replace_bits(val,
> +                                      phydev->duplex == DUPLEX_FULL ? 0 : 1,
> +                                      ENETC_PM_IFM_FULL_DPX_IMX);
>         else if (enetc_is_ls1028a(dev))
> -               dpx = ENETC_PM_IFM_FULL_DPX_LS;
> -
> -       if (phydev->duplex == DUPLEX_FULL)
> -               val |= dpx;
> -       else
> -               val &= ~dpx;
> +               val = u32_replace_bits(val,
> +                                      phydev->duplex == DUPLEX_FULL ? 1 : 0,
> +                                      ENETC_PM_IFM_FULL_DPX_LS);
>
>         if (val == old_val)
>                 return;
>
> --
> 2.34.1
>

Hi Alice,

It looks like this is required for i.MX94 and i.MX95 as well as
i.MX952 and should be split out if you end up making any other changes
to this series but otherwise:
Reviewed-by: Tim Harvey <tharvey at gateworks.com>

Best regards,

Tim


More information about the U-Boot mailing list