RE: [net-next,PATCH] enetc: Set eMDIO MDC rate to 2.5 MHz only on i.MX95
From: Wei Fang
Date: Wed Oct 07 2026 - 23:31:26 EST
> static const struct pci_device_id enetc_pci_mdio_id_table[] = {
> - { PCI_DEVICE(PCI_VENDOR_ID_FREESCALE, ENETC_MDIO_DEV_ID) },
> - { PCI_DEVICE(NETC_EMDIO_VEN_ID, NETC_EMDIO_DEV_ID) },
> + { PCI_DEVICE(PCI_VENDOR_ID_FREESCALE, ENETC_MDIO_DEV_ID), 0, 0,
> 258 },
> + { PCI_DEVICE(NETC_EMDIO_VEN_ID, NETC_EMDIO_DEV_ID), 0, 0, 66 },
> { 0, } /* End of table. */
> };
No, please do not add the divisor to the driver_data. All NETC v4 devices
use the same vendor ID and device ID, but their system clock may be
different. So the divisor is different as well.
In addition to EMDIO, the ENETC port and NETC switch port also support
virtual MDIO, which uses their own MDIO registers to access the external
PHY. Therefore, the modifications go far beyond this.
If you don't mind, I can add a patch set to address this issue later. You can
simply revert the commit 587acb86d646 "enetc: Increase eMDIO MDC rate
to 2.5 MHz".
> MODULE_DEVICE_TABLE(pci, enetc_pci_mdio_id_table);
> diff --git a/include/linux/fsl/enetc_mdio.h b/include/linux/fsl/enetc_mdio.h
> index 623ccfcbf39c3..7dfd65622c95d 100644
> --- a/include/linux/fsl/enetc_mdio.h
> +++ b/include/linux/fsl/enetc_mdio.h
> @@ -33,6 +33,7 @@ struct enetc_hw;
> struct enetc_mdio_priv {
> struct enetc_hw *hw;
> int mdio_base;
> + int mdc_div;
> };
>
> #if IS_REACHABLE(CONFIG_FSL_ENETC_MDIO)
> --
> 2.53.0