Re: [PATCH net-next v3 2/3] net: mdio: Add Cortina CS7542 bus controller
From: Andrew Lunn
Date: Thu Nov 26 2026 - 10:31:33 EST
> +#define PER_MDIO_CFG 0x00
> +#define MDIO_CFG_MANUAL BIT(0)
Just curious. If it is not manual, what does MDIO_CFG_AUTOMAGICAL do?
> +static int cs75xx_mdio_probe(struct platform_device *pdev)
> +{
> + struct device *dev = &pdev->dev;
> + struct cs75xx_mdio *priv;
> + struct mii_bus *bus;
> + u32 cfg;
> +
> + bus = devm_mdiobus_alloc_size(dev, sizeof(*priv));
> + if (!bus)
> + return -ENOMEM;
> +
> + priv = bus->priv;
> + priv->base = devm_platform_ioremap_resource(pdev, 0);
> + if (IS_ERR(priv->base))
> + return PTR_ERR(priv->base);
> +
> + cfg = readl(priv->base + PER_MDIO_CFG);
> + /* The firmware configures the MDC rate; retain its prescaler. */
> + cfg |= MDIO_CFG_MANUAL;
> + writel(cfg, priv->base + PER_MDIO_CFG);
This comment is not obvious. I'm assuming the prescaler configuration
is also in PER_MDIO_CFG, but nothing here actually says that.
/* The firmware configures the MDC rate; Perform a RMW in order to
* retain the prescaler setting, which is in bits 24-42.
*/
???
Andrew