On 5/23/22 11:17, Rasmus Villemoes wrote:
Hi
Hi,

I'm looking at switching the dwc_eth_qos driver over to use
dm_eth_phy_connect(). However, I'm a little puzzled by the code for the
tegra variant. The comment at the top of the file, as well as
tegra186.dtsi, says

   phy-mode = "rgmii";

But eqos_get_interface_tegra186() returns a hard-coded
PHY_INTERFACE_MODE_MII. Now the commit which introduced the ->interface
abstraction, ac2d4efb16e (net: dwc_eth_qos: add Ethernet stm32mp1
support), and that eqos_get_interface_tegra186() function, changed

-       eqos->phy = phy_connect(eqos->mii, 0, dev, 0);

to

+               eqos->phy = phy_connect(eqos->mii, 0, dev,
+                                       eqos->config->interface(dev));

and that last hard-coded 0 in the former phy_connect() is indeed
equivalent to PHY_INTERFACE_MODE_MII.

So which is it? It would be nice if one could just rely on
dm_eth_phy_connect() picking up the correct value from device tree, and
drop all the code which duplicates parsing of phy-mode from the ethernet
driver.
linux-2.6$ git grep mii arch/arm64/boot/dts/nvidia/tegra186*
arch/arm64/boot/dts/nvidia/tegra186-p3310.dtsi:         phy-mode = "rgmii";
arch/arm64/boot/dts/nvidia/tegra186-p3509-0000+p3636-0001.dts: phy-mode = "rgmii-id";
So probably RGMII ?

Reply via email to