Skip to content

Commit

Permalink
net: ldpaa_eth: connect to multiple PHYs/retimers
Browse files Browse the repository at this point in the history
There are cases where multiple retimers are needed for a single port.
This is the case of the M8 mezzanine card used on the LX2160AQDS boards,
where 2 Inphi IN112525 S05 retimers are needed for a  100G port.

In this case we need to specify 2 PHYs in the phy-handle property so
that both retimers are initialized.

Signed-off-by: Ioana Ciornei <[email protected]>
  • Loading branch information
IoanaCiornei authored and p-priyanka-jain committed Jun 30, 2021
1 parent b87e550 commit f923ded
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions drivers/net/ldpaa_eth/ldpaa_eth.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: GPL-2.0+
/*
* Copyright 2014-2016 Freescale Semiconductor, Inc.
* Copyright 2017 NXP
* Copyright 2017-2021 NXP
*/

#include <common.h>
Expand All @@ -25,11 +25,11 @@

#ifdef CONFIG_PHYLIB
#ifdef CONFIG_DM_ETH
static void init_phy(struct udevice *dev)
static void init_phy(struct udevice *dev, int i)
{
struct ldpaa_eth_priv *priv = dev_get_priv(dev);

priv->phy = dm_eth_phy_connect(dev);
priv->phy = dm_eth_phy_connect_index(dev, i);

if (!priv->phy)
return;
Expand Down Expand Up @@ -1101,14 +1101,17 @@ static int ldpaa_dpni_bind(struct ldpaa_eth_priv *priv)
static int ldpaa_eth_probe(struct udevice *dev)
{
struct ofnode_phandle_args phandle;
int i;

/* Nothing to do if there is no "phy-handle" in the DTS node */
if (dev_read_phandle_with_args(dev, "phy-handle", NULL,
0, 0, &phandle)) {
return 0;
}
for (i = 0; i < WRIOP_MAX_PHY_NUM; i++) {
/* Nothing to do if there is no "phy-handle" in the DTS node */
if (dev_read_phandle_with_args(dev, "phy-handle", NULL,
0, i, &phandle)) {
return 0;
}

init_phy(dev);
init_phy(dev, i);
}

return 0;
}
Expand Down

0 comments on commit f923ded

Please sign in to comment.