Re: [PATCH net-next 3/4] net: stmmac: Add glue driver for Motorcomm YT6801 ethernet controller

Andrew Lunn
2025-10-18T14:53:31Z

> > I was also wondering about all the other parameters you set. Why have
> > i not seen any other glue driver with similar code? What makes this
> > glue driver different?
>
> Most glue drivers are for SoC-integrated IPs, for which
> stmmac_pltfr_probe() helper could be used to retrieve configuration
> arguments from devicetree to fill plat_stmmacenet_data. However, YT6801
> is a PCIe-based controller, and we couldn't rely on devicetree to carry
> these parameters.
>
> You could find similar parameter setup code in stmmac_pltfr_probe(), and
> also other glue drivers for PCIe-based controllers, like dwmac-intel.c
> (intel_mgbe_common_data) and dwmac-loongson.c (loongson_default_data).

Is there anything common with these two drivers? One of the problems
stmmac has had in the past is that glue driver writers just
copy/paste, rather than refactor other glue drivers to share code. If
there is shared code, maybe move it into stmmac_pci.c as helpers?

Andrew