aboutsummaryrefslogtreecommitdiff
path: root/drivers/net/fm
diff options
context:
space:
mode:
authorVladimir Oltean <vladimir.oltean@nxp.com>2021-09-18 15:32:35 +0300
committerRamon Fried <rfried.dev@gmail.com>2021-09-28 18:50:56 +0300
commit7c2d5d1642cb561f4135c0be7568d6ee51c56726 (patch)
treee94f9f497eb56b8afcf54553495b25c5b90ae7c3 /drivers/net/fm
parent77b11f7604162886f46e56011e790b7700f8cadd (diff)
downloadu-boot-7c2d5d1642cb561f4135c0be7568d6ee51c56726.zip
u-boot-7c2d5d1642cb561f4135c0be7568d6ee51c56726.tar.gz
u-boot-7c2d5d1642cb561f4135c0be7568d6ee51c56726.tar.bz2
net: freescale: replace usage of phy-mode = "sgmii-2500" with "2500base-x"
After the discussion here: https://lore.kernel.org/netdev/20210603143453.if7hgifupx5k433b@pali/ which resulted in this patch: https://patchwork.kernel.org/project/netdevbpf/patch/20210704134325.24842-1-pali@kernel.org/ and many other discussions before it, notably: https://patchwork.kernel.org/project/linux-arm-kernel/patch/1512016235-15909-1-git-send-email-Bhaskar.Upadhaya@nxp.com/ it became apparent that nobody really knows what "SGMII 2500" is. Certainly, Freescale/NXP hardware engineers name this protocol "SGMII 2500" in the reference manuals, but the PCS devices do not support any "SGMII" specific features when operating at the speed of 2500 Mbps, no in-band autoneg and no speed change via symbol replication . So that leaves a fixed speed of 2500 Mbps using a coding of 8b/10b with a SERDES lane frequency of 3.125 GHz. In fact, "SGMII 2500 without in-band autoneg and at a fixed speed" is indistinguishable from "2500base-x without in-band autoneg", which is precisely what these NXP devices support. So it just appears that "SGMII 2500" is an unclear name with no clear definition that stuck. As such, in the Linux kernel, the drivers which use this SERDES protocol use the 2500base-x phy-mode. This patch converts U-Boot to use 2500base-x too, or at least, as much as it can. Note that I would have really liked to delete PHY_INTERFACE_MODE_SGMII_2500 completely, but the mvpp2 driver seems to even distinguish between SGMII 2500 and 2500base-X. Namely, it enables in-band autoneg for one but not the other, and forces flow control for one but not the other. This goes back to the idea that maybe 2500base-X is a fiber protocol and SGMII-2500 is an MII protocol (connects a MAC to a PHY such as Aquantia), but the two are practically indistinguishable through everything except use case. NXP devices can support both use cases through an identical configuration, for example RX flow control can be unconditionally enabled in order to support rate adaptation performed by an Aquantia PHY. At least I can find no indication in online documents published by Cisco which would point towards "SGMII-2500" being an actual standard with an actual definition, so I cannot say "yes, NXP devices support it". Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Diffstat (limited to 'drivers/net/fm')
-rw-r--r--drivers/net/fm/eth.c10
-rw-r--r--drivers/net/fm/ls1043.c4
-rw-r--r--drivers/net/fm/ls1046.c2
-rw-r--r--drivers/net/fm/memac.c2
-rw-r--r--drivers/net/fm/t1024.c2
5 files changed, 10 insertions, 10 deletions
diff --git a/drivers/net/fm/eth.c b/drivers/net/fm/eth.c
index 7c23ccc..5e0d0bc 100644
--- a/drivers/net/fm/eth.c
+++ b/drivers/net/fm/eth.c
@@ -50,7 +50,7 @@ static void dtsec_configure_serdes(struct fm_eth *priv)
u32 value;
struct mii_dev bus;
bool sgmii_2500 = (priv->enet_if ==
- PHY_INTERFACE_MODE_SGMII_2500) ? true : false;
+ PHY_INTERFACE_MODE_2500BASEX) ? true : false;
int i = 0, j;
#ifndef CONFIG_DM_ETH
@@ -133,7 +133,7 @@ static void dtsec_init_phy(struct fm_eth *fm_eth)
if (fm_eth->enet_if == PHY_INTERFACE_MODE_SGMII ||
fm_eth->enet_if == PHY_INTERFACE_MODE_QSGMII ||
- fm_eth->enet_if == PHY_INTERFACE_MODE_SGMII_2500)
+ fm_eth->enet_if == PHY_INTERFACE_MODE_2500BASEX)
dtsec_configure_serdes(fm_eth);
}
@@ -432,7 +432,7 @@ static int fm_eth_startup(struct fm_eth *fm_eth)
/* For some reason we need to set SPEED_100 */
if (((fm_eth->enet_if == PHY_INTERFACE_MODE_SGMII) ||
- (fm_eth->enet_if == PHY_INTERFACE_MODE_SGMII_2500) ||
+ (fm_eth->enet_if == PHY_INTERFACE_MODE_2500BASEX) ||
(fm_eth->enet_if == PHY_INTERFACE_MODE_QSGMII)) &&
mac->set_if_mode)
mac->set_if_mode(mac, fm_eth->enet_if, SPEED_100);
@@ -829,7 +829,7 @@ static int init_phy(struct fm_eth *fm_eth)
if (fm_eth->type == FM_ETH_10G_E)
supported = PHY_10G_FEATURES;
- if (fm_eth->enet_if == PHY_INTERFACE_MODE_SGMII_2500)
+ if (fm_eth->enet_if == PHY_INTERFACE_MODE_2500BASEX)
supported |= SUPPORTED_2500baseX_Full;
#endif
@@ -1090,7 +1090,7 @@ static int fm_eth_probe(struct udevice *dev)
if (fm_eth->num != 0)
break;
case PHY_INTERFACE_MODE_SGMII:
- case PHY_INTERFACE_MODE_SGMII_2500:
+ case PHY_INTERFACE_MODE_2500BASEX:
fm_eth->pcs_mdio = fm_get_internal_mdio(dev);
break;
default:
diff --git a/drivers/net/fm/ls1043.c b/drivers/net/fm/ls1043.c
index ba4da69..e1abf8f 100644
--- a/drivers/net/fm/ls1043.c
+++ b/drivers/net/fm/ls1043.c
@@ -79,7 +79,7 @@ phy_interface_t fman_port_enet_if(enum fm_port port)
case FM1_DTSEC2:
if ((port == FM1_DTSEC2) &&
is_serdes_configured(SGMII_2500_FM1_DTSEC2))
- return PHY_INTERFACE_MODE_SGMII_2500;
+ return PHY_INTERFACE_MODE_2500BASEX;
case FM1_DTSEC5:
case FM1_DTSEC6:
case FM1_DTSEC9:
@@ -87,7 +87,7 @@ phy_interface_t fman_port_enet_if(enum fm_port port)
return PHY_INTERFACE_MODE_SGMII;
else if ((port == FM1_DTSEC9) &&
is_serdes_configured(SGMII_2500_FM1_DTSEC9))
- return PHY_INTERFACE_MODE_SGMII_2500;
+ return PHY_INTERFACE_MODE_2500BASEX;
break;
default:
break;
diff --git a/drivers/net/fm/ls1046.c b/drivers/net/fm/ls1046.c
index 49b540b..09df0aa 100644
--- a/drivers/net/fm/ls1046.c
+++ b/drivers/net/fm/ls1046.c
@@ -99,7 +99,7 @@ phy_interface_t fman_port_enet_if(enum fm_port port)
case FM1_DTSEC10:
if (is_serdes_configured(SGMII_2500_FM1_DTSEC5 +
port - FM1_DTSEC5))
- return PHY_INTERFACE_MODE_SGMII_2500;
+ return PHY_INTERFACE_MODE_2500BASEX;
break;
default:
break;
diff --git a/drivers/net/fm/memac.c b/drivers/net/fm/memac.c
index e1f812b..eeb67a3 100644
--- a/drivers/net/fm/memac.c
+++ b/drivers/net/fm/memac.c
@@ -93,7 +93,7 @@ static void memac_set_interface_mode(struct fsl_enet_mac *mac,
if_mode |= (IF_MODE_GMII | IF_MODE_RM);
break;
case PHY_INTERFACE_MODE_SGMII:
- case PHY_INTERFACE_MODE_SGMII_2500:
+ case PHY_INTERFACE_MODE_2500BASEX:
case PHY_INTERFACE_MODE_QSGMII:
if_mode &= ~IF_MODE_MASK;
if_mode |= (IF_MODE_GMII);
diff --git a/drivers/net/fm/t1024.c b/drivers/net/fm/t1024.c
index 6fc3b90..696e74c 100644
--- a/drivers/net/fm/t1024.c
+++ b/drivers/net/fm/t1024.c
@@ -63,7 +63,7 @@ phy_interface_t fman_port_enet_if(enum fm_port port)
return PHY_INTERFACE_MODE_SGMII;
else if (is_serdes_configured(SGMII_2500_FM1_DTSEC1
+ port - FM1_DTSEC1))
- return PHY_INTERFACE_MODE_SGMII_2500;
+ return PHY_INTERFACE_MODE_2500BASEX;
break;
default:
break;