* [PATCH net-next 0/2] net: ethernet: ti: am65-cpsw-nuss: support stacked switches
@ 2024-05-28 7:59 A. Sverdlin
2024-05-28 7:59 ` [PATCH net-next 1/2] net: ethernet: ti: am65-cpsw-nuss: rename phy_node -> port_np A. Sverdlin
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: A. Sverdlin @ 2024-05-28 7:59 UTC (permalink / raw)
To: netdev; +Cc: Alexander Sverdlin, Roger Quadros, Grygorii Strashko,
Chintan Vankar
From: Alexander Sverdlin <alexander.sverdlin@siemens.com>
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.
Alexander Sverdlin (2):
net: ethernet: ti: am65-cpsw-nuss: rename phy_node -> port_np
net: ethernet: ti: am65-cpsw-nuss: populate netdev of_node
drivers/net/ethernet/ti/am65-cpsw-nuss.c | 7 ++++---
drivers/net/ethernet/ti/am65-cpsw-nuss.h | 2 +-
2 files changed, 5 insertions(+), 4 deletions(-)
--
2.45.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH net-next 1/2] net: ethernet: ti: am65-cpsw-nuss: rename phy_node -> port_np
2024-05-28 7:59 [PATCH net-next 0/2] net: ethernet: ti: am65-cpsw-nuss: support stacked switches A. Sverdlin
@ 2024-05-28 7:59 ` A. Sverdlin
2024-05-28 7:59 ` [PATCH net-next 2/2] net: ethernet: ti: am65-cpsw-nuss: populate netdev of_node A. Sverdlin
2024-05-30 0:40 ` [PATCH net-next 0/2] net: ethernet: ti: am65-cpsw-nuss: support stacked switches patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: A. Sverdlin @ 2024-05-28 7:59 UTC (permalink / raw)
To: netdev; +Cc: Alexander Sverdlin, Roger Quadros, Grygorii Strashko,
Chintan Vankar
From: Alexander Sverdlin <alexander.sverdlin@siemens.com>
Rename phy_node to port_np to better reflect what it actually is,
because the new phylink API takes netdev node (or DSA port node),
and resolves the phandle internally.
Signed-off-by: Alexander Sverdlin <alexander.sverdlin@siemens.com>
---
drivers/net/ethernet/ti/am65-cpsw-nuss.c | 6 +++---
drivers/net/ethernet/ti/am65-cpsw-nuss.h | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/ti/am65-cpsw-nuss.c b/drivers/net/ethernet/ti/am65-cpsw-nuss.c
index 4e50b37928885..eaadf8f09c401 100644
--- a/drivers/net/ethernet/ti/am65-cpsw-nuss.c
+++ b/drivers/net/ethernet/ti/am65-cpsw-nuss.c
@@ -896,7 +896,7 @@ static int am65_cpsw_nuss_ndo_slave_open(struct net_device *ndev)
/* mac_sl should be configured via phy-link interface */
am65_cpsw_sl_ctl_reset(port);
- ret = phylink_of_phy_connect(port->slave.phylink, port->slave.phy_node, 0);
+ ret = phylink_of_phy_connect(port->slave.phylink, port->slave.port_np, 0);
if (ret)
goto error_cleanup;
@@ -2611,7 +2611,7 @@ static int am65_cpsw_nuss_init_slave_ports(struct am65_cpsw_common *common)
of_property_read_bool(port_np, "ti,mac-only");
/* get phy/link info */
- port->slave.phy_node = port_np;
+ port->slave.port_np = port_np;
ret = of_get_phy_mode(port_np, &port->slave.phy_if);
if (ret) {
dev_err(dev, "%pOF read phy-mode err %d\n",
@@ -2760,7 +2760,7 @@ am65_cpsw_nuss_init_port_ndev(struct am65_cpsw_common *common, u32 port_idx)
}
phylink = phylink_create(&port->slave.phylink_config,
- of_node_to_fwnode(port->slave.phy_node),
+ of_node_to_fwnode(port->slave.port_np),
port->slave.phy_if,
&am65_cpsw_phylink_mac_ops);
if (IS_ERR(phylink))
diff --git a/drivers/net/ethernet/ti/am65-cpsw-nuss.h b/drivers/net/ethernet/ti/am65-cpsw-nuss.h
index d8ce88dc9c89a..e2ce2be320bd6 100644
--- a/drivers/net/ethernet/ti/am65-cpsw-nuss.h
+++ b/drivers/net/ethernet/ti/am65-cpsw-nuss.h
@@ -30,7 +30,7 @@ struct am65_cpts;
struct am65_cpsw_slave_data {
bool mac_only;
struct cpsw_sl *mac_sl;
- struct device_node *phy_node;
+ struct device_node *port_np;
phy_interface_t phy_if;
struct phy *ifphy;
struct phy *serdes_phy;
--
2.45.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH net-next 2/2] net: ethernet: ti: am65-cpsw-nuss: populate netdev of_node
2024-05-28 7:59 [PATCH net-next 0/2] net: ethernet: ti: am65-cpsw-nuss: support stacked switches A. Sverdlin
2024-05-28 7:59 ` [PATCH net-next 1/2] net: ethernet: ti: am65-cpsw-nuss: rename phy_node -> port_np A. Sverdlin
@ 2024-05-28 7:59 ` A. Sverdlin
2024-05-30 0:40 ` [PATCH net-next 0/2] net: ethernet: ti: am65-cpsw-nuss: support stacked switches patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: A. Sverdlin @ 2024-05-28 7:59 UTC (permalink / raw)
To: netdev; +Cc: Alexander Sverdlin, Roger Quadros, Grygorii Strashko,
Chintan Vankar
From: Alexander Sverdlin <alexander.sverdlin@siemens.com>
So that of_find_net_device_by_node() can find cpsw-nuss ports and other DSA
switches can be stacked downstream.
Signed-off-by: Alexander Sverdlin <alexander.sverdlin@siemens.com>
---
drivers/net/ethernet/ti/am65-cpsw-nuss.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/ethernet/ti/am65-cpsw-nuss.c b/drivers/net/ethernet/ti/am65-cpsw-nuss.c
index eaadf8f09c401..e6f87ac394fe6 100644
--- a/drivers/net/ethernet/ti/am65-cpsw-nuss.c
+++ b/drivers/net/ethernet/ti/am65-cpsw-nuss.c
@@ -2703,6 +2703,7 @@ am65_cpsw_nuss_init_port_ndev(struct am65_cpsw_common *common, u32 port_idx)
mutex_init(&ndev_priv->mm_lock);
port->qos.link_speed = SPEED_UNKNOWN;
SET_NETDEV_DEV(port->ndev, dev);
+ port->ndev->dev.of_node = port->slave.port_np;
eth_hw_addr_set(port->ndev, port->slave.mac_addr);
--
2.45.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH net-next 0/2] net: ethernet: ti: am65-cpsw-nuss: support stacked switches
2024-05-28 7:59 [PATCH net-next 0/2] net: ethernet: ti: am65-cpsw-nuss: support stacked switches A. Sverdlin
2024-05-28 7:59 ` [PATCH net-next 1/2] net: ethernet: ti: am65-cpsw-nuss: rename phy_node -> port_np A. Sverdlin
2024-05-28 7:59 ` [PATCH net-next 2/2] net: ethernet: ti: am65-cpsw-nuss: populate netdev of_node A. Sverdlin
@ 2024-05-30 0:40 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-05-30 0:40 UTC (permalink / raw)
To: A. Sverdlin; +Cc: netdev, rogerq, grygorii.strashko, c-vankar
Hello:
This series was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Tue, 28 May 2024 09:59:48 +0200 you wrote:
> From: Alexander Sverdlin <alexander.sverdlin@siemens.com>
>
> 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.
>
> [...]
Here is the summary with links:
- [net-next,1/2] net: ethernet: ti: am65-cpsw-nuss: rename phy_node -> port_np
https://git.kernel.org/netdev/net-next/c/78269025e192
- [net-next,2/2] net: ethernet: ti: am65-cpsw-nuss: populate netdev of_node
https://git.kernel.org/netdev/net-next/c/29c71bf2a05a
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-05-30 0:40 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-28 7:59 [PATCH net-next 0/2] net: ethernet: ti: am65-cpsw-nuss: support stacked switches A. Sverdlin
2024-05-28 7:59 ` [PATCH net-next 1/2] net: ethernet: ti: am65-cpsw-nuss: rename phy_node -> port_np A. Sverdlin
2024-05-28 7:59 ` [PATCH net-next 2/2] net: ethernet: ti: am65-cpsw-nuss: populate netdev of_node A. Sverdlin
2024-05-30 0:40 ` [PATCH net-next 0/2] net: ethernet: ti: am65-cpsw-nuss: support stacked switches patchwork-bot+netdevbpf
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.