Re: [PATCH 2/4] net: stmmac: dwc-qos: Add FSD EQoS support

From: Andrew Lunn
Date: Fri Nov 04 2022 - 11:32:38 EST


> For FSD SoC, a mux switch is needed between internal and external clocks.
> By default after reset internal clock is used but for receiving packets
> properly, external clock is needed. Mux switch to external clock happens
> only when the external clock is present.


> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> @@ -3831,6 +3831,9 @@ static int __stmmac_open(struct net_device *dev,
> netif_tx_start_all_queues(priv->dev);
> stmmac_enable_all_dma_irq(priv);
>
> + if (priv->plat->rxmux_setup)
> + priv->plat->rxmux_setup(priv->plat->bsp_priv, true);
> +
> return 0;
>
> irq_error:
> @@ -3884,6 +3887,9 @@ static int stmmac_release(struct net_device *dev)
> struct stmmac_priv *priv = netdev_priv(dev);
> u32 chan;
>
> + if (priv->plat->rxmux_setup)
> + priv->plat->rxmux_setup(priv->plat->bsp_priv, false);
> +

Is this the code which is deciding if the external clock is present? So when somebody called
'ip link set eth42 up'?

Where is the external clock coming from?

Andrew