[1/2] drivers: net: phy: aquantia: drop XGMII as a valid system interface proto
diff mbox series

Message ID 20191204133216.12716-1-alexandru.marginean@nxp.com
State New
Delegated to: Joe Hershberger
Headers show
Series
  • [1/2] drivers: net: phy: aquantia: drop XGMII as a valid system interface proto
Related show

Commit Message

Alexandru Marginean Dec. 4, 2019, 1:32 p.m. UTC
Use either USXGMII or XFI in aquantia_set_proto and drop XGMII as a valid
protocol configuration.  The PHY doesn't support it, it's just used as an
alias for one of the other two protocols.

Signed-off-by: Florin Chiculita <florinlaurentiu.chiculita@nxp.com>
Signed-off-by: Alex Marginean <alexandru.marginean@nxp.com>
---

Depends on:
https://patchwork.ozlabs.org/project/uboot/list/?series=142879

 drivers/net/phy/aquantia.c | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

Comments

Priyanka Jain Dec. 5, 2019, 4:48 a.m. UTC | #1
>-----Original Message-----
>From: U-Boot <u-boot-bounces@lists.denx.de> On Behalf Of Alex Marginean
>Sent: Wednesday, December 4, 2019 7:02 PM
>To: u-boot@lists.denx.de
>Cc: Joe Hershberger <joe.hershberger@ni.com>
>Subject: [PATCH 1/2] drivers: net: phy: aquantia: drop XGMII as a valid system
>interface proto
>
>Use either USXGMII or XFI in aquantia_set_proto and drop XGMII as a valid
>protocol configuration.  The PHY doesn't support it, it's just used as an alias
>for one of the other two protocols.
>
>Signed-off-by: Florin Chiculita <florinlaurentiu.chiculita@nxp.com>
>Signed-off-by: Alex Marginean <alexandru.marginean@nxp.com>
>---
>
>Depends on:
>https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpatchw
>ork.ozlabs.org%2Fproject%2Fuboot%2Flist%2F%3Fseries%3D142879&amp;data
>=02%7C01%7Cpriyanka.jain%40nxp.com%7Ca188babb8ac44ea01a0f08d778c32
>b7a%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C637110651953798
>880&amp;sdata=09%2Fd1o844AoHOs4YdedTEK5FznY3FBHqlzBcC82EVZs%3D&
>amp;reserved=0
>
> drivers/net/phy/aquantia.c | 17 +++++++++--------
> 1 file changed, 9 insertions(+), 8 deletions(-)
>
>diff --git a/drivers/net/phy/aquantia.c b/drivers/net/phy/aquantia.c index
>7817d3cb8d..2af09907a1 100644
>--- a/drivers/net/phy/aquantia.c
>+++ b/drivers/net/phy/aquantia.c
>@@ -303,30 +303,29 @@ struct {
>
>AQUANTIA_VND1_GSTART_RATE_1G},
> 	[PHY_INTERFACE_MODE_SGMII_2500] = {0x144,
>AQUANTIA_VND1_GSYSCFG_2_5G,
>
>AQUANTIA_VND1_GSTART_RATE_2_5G},
>-	[PHY_INTERFACE_MODE_XGMII] =      {0x100,
>AQUANTIA_VND1_GSYSCFG_10G,
>-
>AQUANTIA_VND1_GSTART_RATE_10G},
> 	[PHY_INTERFACE_MODE_XFI] =        {0x100,
>AQUANTIA_VND1_GSYSCFG_10G,
>
>AQUANTIA_VND1_GSTART_RATE_10G},
> 	[PHY_INTERFACE_MODE_USXGMII] =    {0x080,
>AQUANTIA_VND1_GSYSCFG_10G,
>
>AQUANTIA_VND1_GSTART_RATE_10G},  };
>
>-static int aquantia_set_proto(struct phy_device *phydev)
>+static int aquantia_set_proto(struct phy_device *phydev,
>+			      phy_interface_t interface)
> {
> 	int i;
>
>-	if (!aquantia_syscfg[phydev->interface].cnt)
>+	if (!aquantia_syscfg[interface].cnt)
> 		return 0;
>
> 	/* set the default rate to enable the SI link */
> 	phy_write(phydev, MDIO_MMD_VEND1,
>AQUANTIA_VND1_GSTART_RATE,
>-		  aquantia_syscfg[phydev->interface].start_rate);
>+		  aquantia_syscfg[interface].start_rate);
>
> 	/* set selected protocol for all relevant line side link speeds */
>-	for (i = 0; i <= aquantia_syscfg[phydev->interface].cnt; i++)
>+	for (i = 0; i <= aquantia_syscfg[interface].cnt; i++)
> 		phy_write(phydev, MDIO_MMD_VEND1,
> 			  AQUANTIA_VND1_GSYSCFG_BASE + i,
>-			  aquantia_syscfg[phydev->interface].syscfg);
>+			  aquantia_syscfg[interface].syscfg);
> 	return 0;
> }
>
>@@ -429,6 +428,8 @@ int aquantia_config(struct phy_device *phydev)
> 	 * on FW config
> 	 */
> 	if (interface == PHY_INTERFACE_MODE_XGMII) {
>+		debug("use XFI or USXGMII SI protos, XGMII is not valid\n");
>+
> 		reg_val1 = phy_read(phydev, MDIO_MMD_PHYXS,
> 				    AQUANTIA_SYSTEM_INTERFACE_SR);
> 		if ((reg_val1 & AQUANTIA_SI_IN_USE_MASK) ==
>AQUANTIA_SI_USXGMII) @@ -451,7 +452,7 @@ int aquantia_config(struct
>phy_device *phydev)
> 		mdelay(10);
>
> 		/* configure protocol based on phydev->interface */
>-		aquantia_set_proto(phydev);
>+		aquantia_set_proto(phydev, interface);
> 		/* apply custom configuration based on DT */
> 		aquantia_dts_config(phydev);
>
>--
>2.17.1
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>

Patch
diff mbox series

diff --git a/drivers/net/phy/aquantia.c b/drivers/net/phy/aquantia.c
index 7817d3cb8d..2af09907a1 100644
--- a/drivers/net/phy/aquantia.c
+++ b/drivers/net/phy/aquantia.c
@@ -303,30 +303,29 @@  struct {
 					   AQUANTIA_VND1_GSTART_RATE_1G},
 	[PHY_INTERFACE_MODE_SGMII_2500] = {0x144, AQUANTIA_VND1_GSYSCFG_2_5G,
 					   AQUANTIA_VND1_GSTART_RATE_2_5G},
-	[PHY_INTERFACE_MODE_XGMII] =      {0x100, AQUANTIA_VND1_GSYSCFG_10G,
-					   AQUANTIA_VND1_GSTART_RATE_10G},
 	[PHY_INTERFACE_MODE_XFI] =        {0x100, AQUANTIA_VND1_GSYSCFG_10G,
 					   AQUANTIA_VND1_GSTART_RATE_10G},
 	[PHY_INTERFACE_MODE_USXGMII] =    {0x080, AQUANTIA_VND1_GSYSCFG_10G,
 					   AQUANTIA_VND1_GSTART_RATE_10G},
 };
 
-static int aquantia_set_proto(struct phy_device *phydev)
+static int aquantia_set_proto(struct phy_device *phydev,
+			      phy_interface_t interface)
 {
 	int i;
 
-	if (!aquantia_syscfg[phydev->interface].cnt)
+	if (!aquantia_syscfg[interface].cnt)
 		return 0;
 
 	/* set the default rate to enable the SI link */
 	phy_write(phydev, MDIO_MMD_VEND1, AQUANTIA_VND1_GSTART_RATE,
-		  aquantia_syscfg[phydev->interface].start_rate);
+		  aquantia_syscfg[interface].start_rate);
 
 	/* set selected protocol for all relevant line side link speeds */
-	for (i = 0; i <= aquantia_syscfg[phydev->interface].cnt; i++)
+	for (i = 0; i <= aquantia_syscfg[interface].cnt; i++)
 		phy_write(phydev, MDIO_MMD_VEND1,
 			  AQUANTIA_VND1_GSYSCFG_BASE + i,
-			  aquantia_syscfg[phydev->interface].syscfg);
+			  aquantia_syscfg[interface].syscfg);
 	return 0;
 }
 
@@ -429,6 +428,8 @@  int aquantia_config(struct phy_device *phydev)
 	 * on FW config
 	 */
 	if (interface == PHY_INTERFACE_MODE_XGMII) {
+		debug("use XFI or USXGMII SI protos, XGMII is not valid\n");
+
 		reg_val1 = phy_read(phydev, MDIO_MMD_PHYXS,
 				    AQUANTIA_SYSTEM_INTERFACE_SR);
 		if ((reg_val1 & AQUANTIA_SI_IN_USE_MASK) == AQUANTIA_SI_USXGMII)
@@ -451,7 +452,7 @@  int aquantia_config(struct phy_device *phydev)
 		mdelay(10);
 
 		/* configure protocol based on phydev->interface */
-		aquantia_set_proto(phydev);
+		aquantia_set_proto(phydev, interface);
 		/* apply custom configuration based on DT */
 		aquantia_dts_config(phydev);