[PATCH net-next 3/3] net: phy: mediatek: add driver for built-in 2.5G ethernet PHY on MT7988
Krzysztof Kozlowski
krzk at kernel.org
Thu Jan 16 04:45:35 PST 2025
On 16/01/2025 02:21, Sky Huang wrote:
> +
> +static int mt798x_2p5ge_phy_load_fw(struct phy_device *phydev)
> +{
> + struct mtk_i2p5ge_phy_priv *priv = phydev->priv;
> + void __iomem *mcu_csr_base, *pmb_addr;
> + struct device *dev = &phydev->mdio.dev;
> + const struct firmware *fw;
> + struct device_node *np;
> + int ret, i;
> + u32 reg;
> +
> + if (priv->fw_loaded)
> + return 0;
> +
> + np = of_find_compatible_node(NULL, NULL, "mediatek,2p5gphy-fw");
There is no such compatible. You cannot just add undocumented bindings.
Also, devices should not just look for some random compatibles. Express
proper relationships with phandles or node hierarchy.
> + if (!np)
> + return -ENOENT;
> +
> + pmb_addr = of_iomap(np, 1);
> + if (!pmb_addr)
> + return -ENOMEM;
> + mcu_csr_base = of_iomap(np, 2);
> + if (!mcu_csr_base) {
> + ret = -ENOMEM;
> + goto free_pmb;
> + }
> +
Best regards,
Krzysztof
More information about the Linux-mediatek
mailing list