Commit f3bb7759 authored by Mark Brown's avatar Mark Brown Committed by Jakub Kicinski

net: netsec: Ignore 'phy-mode' on SynQuacer in DT mode

As documented in acd7aaf5 ("netsec: ignore 'phy-mode' device
property on ACPI systems") the SocioNext SynQuacer platform ships with
firmware defining the PHY mode as RGMII even though the physical
configuration of the PHY is for TX and RX delays.  Since bbc4d71d
("net: phy: realtek: fix rtl8211e rx/tx delay config") this has caused
misconfiguration of the PHY, rendering the network unusable.

This was worked around for ACPI by ignoring the phy-mode property but
the system is also used with DT.  For DT instead if we're running on a
SynQuacer force a working PHY mode, as well as the standard EDK2
firmware with DT there are also some of these systems that use u-boot
and might not initialise the PHY if not netbooting.  Newer firmware
imagaes for at least EDK2 are available from Linaro so print a warning
when doing this.

Fixes: 533dd11a ("net: socionext: Add Synquacer NetSec driver")
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
Acked-by: default avatarArd Biesheuvel <ardb@kernel.org>
Acked-by: default avatarIlias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Link: https://lore.kernel.org/r/20230731-synquacer-net-v3-1-944be5f06428@kernel.orgSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 0b6291ad
...@@ -1851,6 +1851,17 @@ static int netsec_of_probe(struct platform_device *pdev, ...@@ -1851,6 +1851,17 @@ static int netsec_of_probe(struct platform_device *pdev,
return err; return err;
} }
/*
* SynQuacer is physically configured with TX and RX delays
* but the standard firmware claimed otherwise for a long
* time, ignore it.
*/
if (of_machine_is_compatible("socionext,developer-box") &&
priv->phy_interface != PHY_INTERFACE_MODE_RGMII_ID) {
dev_warn(&pdev->dev, "Outdated firmware reports incorrect PHY mode, overriding\n");
priv->phy_interface = PHY_INTERFACE_MODE_RGMII_ID;
}
priv->phy_np = of_parse_phandle(pdev->dev.of_node, "phy-handle", 0); priv->phy_np = of_parse_phandle(pdev->dev.of_node, "phy-handle", 0);
if (!priv->phy_np) { if (!priv->phy_np) {
dev_err(&pdev->dev, "missing required property 'phy-handle'\n"); dev_err(&pdev->dev, "missing required property 'phy-handle'\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment