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

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'net-ethernet-ti-am65-cpsw-nuss-support-stacked-switches'

Alexander Sverdlin says:

====================
net: ethernet: ti: am65-cpsw-nuss: support stacked switches

Currently an external Ethernet switch connected to a am65-cpsw-nuss CPU
port will not be probed successfully because of_find_net_device_by_node()
will not be able to find the netdev of the CPU port.

It's necessary to populate of_node of the struct device for the
am65-cpsw-nuss ports. DT nodes of the ports are already stored in per-port
private data, but because of some legacy reasons the naming ("phy_node")
was misleading.
====================

Link: https://lore.kernel.org/r/20240528075954.3608118-1-alexander.sverdlin@siemens.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

+5 -4
+4 -3
drivers/net/ethernet/ti/am65-cpsw-nuss.c
··· 896 896 /* mac_sl should be configured via phy-link interface */ 897 897 am65_cpsw_sl_ctl_reset(port); 898 898 899 - ret = phylink_of_phy_connect(port->slave.phylink, port->slave.phy_node, 0); 899 + ret = phylink_of_phy_connect(port->slave.phylink, port->slave.port_np, 0); 900 900 if (ret) 901 901 goto error_cleanup; 902 902 ··· 2611 2611 of_property_read_bool(port_np, "ti,mac-only"); 2612 2612 2613 2613 /* get phy/link info */ 2614 - port->slave.phy_node = port_np; 2614 + port->slave.port_np = port_np; 2615 2615 ret = of_get_phy_mode(port_np, &port->slave.phy_if); 2616 2616 if (ret) { 2617 2617 dev_err(dev, "%pOF read phy-mode err %d\n", ··· 2703 2703 mutex_init(&ndev_priv->mm_lock); 2704 2704 port->qos.link_speed = SPEED_UNKNOWN; 2705 2705 SET_NETDEV_DEV(port->ndev, dev); 2706 + port->ndev->dev.of_node = port->slave.port_np; 2706 2707 2707 2708 eth_hw_addr_set(port->ndev, port->slave.mac_addr); 2708 2709 ··· 2761 2760 } 2762 2761 2763 2762 phylink = phylink_create(&port->slave.phylink_config, 2764 - of_node_to_fwnode(port->slave.phy_node), 2763 + of_node_to_fwnode(port->slave.port_np), 2765 2764 port->slave.phy_if, 2766 2765 &am65_cpsw_phylink_mac_ops); 2767 2766 if (IS_ERR(phylink))
+1 -1
drivers/net/ethernet/ti/am65-cpsw-nuss.h
··· 30 30 struct am65_cpsw_slave_data { 31 31 bool mac_only; 32 32 struct cpsw_sl *mac_sl; 33 - struct device_node *phy_node; 33 + struct device_node *port_np; 34 34 phy_interface_t phy_if; 35 35 struct phy *ifphy; 36 36 struct phy *serdes_phy;