Thread (8 messages) 8 messages, 4 authors, 2025-05-26

Re: [RFC PATCH 2/2] net: stmmac: dwmac-sun8i: Allow runtime AC200/AC300 phy selection

From: Andrew Lunn <andrew@lunn.ch>
Date: 2025-05-26 14:14:14
Also in: linux-arm-kernel, linux-sunxi, lkml

On Mon, May 26, 2025 at 09:04:40AM +0100, Russell King (Oracle) wrote:
On Sun, May 25, 2025 at 06:29:22PM -0600, James Hilliard wrote:
quoted
+	if (!nvmem_cell_read_u16(dev, "ac300", &val)) {
+		const char *phy_name = (val & AC300_KEY) ? "ac300" : "ac200";
+		int index = of_property_match_string(dev->of_node, "phy-names", phy_name);
+		if (index < 0) {
+			dev_err(dev, "PHY name not found in device tree\n");
+			return -EINVAL;
+		}
+
+		plat_dat->phy_node = of_parse_phandle(dev->of_node, "phys", index);
+		if (!plat_dat->phy_node) {
+			dev_err(dev, "Failed to get PHY node from phys property\n");
+			return -EINVAL;
+		}
+	}
1. You are re-using the drivers/phy binding for ethernet PHYs driven by
   phylib here.
2. You need to update
   Documentation/devicetree/bindings/net/allwinner,sun8i-a83t-emac.yaml
   in a separate patch.
A real user, i.e. a patch to a .dts file, would also be good.

  Andrew
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help