Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: stmmac: Deprecate snps, phy-addr and auto-detect PHY address

The snps,phy-addr device tree property is non-standard, and should be
removed in favor of proper phy node support. Remove it from the binding
documents and warn if the property is still used.

Most PHYs respond to address 0, but a few don't, so auto-detect PHY
address by default, to make up for the lack of explicit address selection.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Chen-Yu Tsai and committed by
David S. Miller
436f7ecd 6aedb8c0

+8 -2
-1
Documentation/devicetree/bindings/net/stmmac.txt
··· 12 12 property 13 13 - phy-mode: String, operation mode of the PHY interface. 14 14 Supported values are: "mii", "rmii", "gmii", "rgmii". 15 - - snps,phy-addr phy address to connect to. 16 15 - snps,reset-gpio gpio number for phy reset. 17 16 - snps,reset-active-low boolean flag to indicate if phy reset is active low. 18 17 - snps,reset-delays-us is triplet of delays
+8 -1
drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
··· 50 50 if (plat->bus_id < 0) 51 51 plat->bus_id = 0; 52 52 53 - of_property_read_u32(np, "snps,phy-addr", &plat->phy_addr); 53 + /* Default to phy auto-detection */ 54 + plat->phy_addr = -1; 55 + 56 + /* "snps,phy-addr" is not a standard property. Mark it as deprecated 57 + * and warn of its use. Remove this when phy node support is added. 58 + */ 59 + if (of_property_read_u32(np, "snps,phy-addr", &plat->phy_addr) == 0) 60 + dev_warn(&pdev->dev, "snps,phy-addr property is deprecated\n"); 54 61 55 62 plat->mdio_bus_data = devm_kzalloc(&pdev->dev, 56 63 sizeof(struct stmmac_mdio_bus_data),