Re: [PATCH net-next 6/8] net: enetc: add basic support for the ENETC with pseudo MAC for i.MX94

From: Paolo Abeni

Date: Tue Oct 21 2025 - 03:26:54 EST


On 10/16/25 12:20 PM, Wei Fang wrote:
> @@ -635,28 +649,10 @@ static void enetc4_pl_mac_config(struct phylink_config *config, unsigned int mod
>
> static void enetc4_set_port_speed(struct enetc_ndev_priv *priv, int speed)
> {
> - u32 old_speed = priv->speed;
> - u32 val;
> -
> - if (speed == old_speed)
> - return;
> -
> - val = enetc_port_rd(&priv->si->hw, ENETC4_PCR);
> - val &= ~PCR_PSPEED;
> -
> - switch (speed) {
> - case SPEED_100:
> - case SPEED_1000:
> - case SPEED_2500:
> - case SPEED_10000:
> - val |= (PCR_PSPEED & PCR_PSPEED_VAL(speed));
> - break;
> - case SPEED_10:
> - default:
> - val |= (PCR_PSPEED & PCR_PSPEED_VAL(SPEED_10));
> - }
> + u32 val = enetc_port_rd(&priv->si->hw, ENETC4_PCR);
>
> priv->speed = speed;
> + val = u32_replace_bits(val, PCR_PSPEED_VAL(speed), PCR_PSPEED);
> enetc_port_wr(&priv->si->hw, ENETC4_PCR, val);
> }

The above chunk looks unrelated from the rest of this patch. Perhaps
worth moving to a separate patch in this series? Or add some comments
explaining why it's needed.

Thanks,

Paolo