[U-Boot,v2,1/2] driver: net: ldpaa_eth: Add PHY-less SGMII support

Message ID 1510565855-2664-1-git-send-email-Ashish.Kumar@nxp.com
State Changes Requested
Delegated to: Joe Hershberger
Headers show
Series
  • [U-Boot,v2,1/2] driver: net: ldpaa_eth: Add PHY-less SGMII support
Related show

Commit Message

Ashish Kumar Nov. 13, 2017, 9:37 a.m.
In case of PHY-less mode, there is no interaction with PHY
so auto-neg etc is not required and link will have fixed
attributes

Signed-off-by: Ashish Kumar <Ashish.Kumar@nxp.com>
Signed-off-by: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
---
v2:
Add dependent patch set

 drivers/net/ldpaa_eth/ldpaa_eth.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

Comments

Ashish Kumar Nov. 30, 2017, 5:45 a.m. | #1
Hello Joe, York,


Any comments on V2 series?

http://patchwork.ozlabs.org/project/uboot/list/?series=13261


Regards

Ashish
York Sun Nov. 30, 2017, 5:47 p.m. | #2
On 11/29/2017 09:45 PM, Ashish Kumar wrote:
> Hello Joe, York,
> 
> 
> Any comments on V2 series?
> 

Ashish,

I can't see if this set is correct. Did you look into the similar
PHY-less situation for Power-based platform? We don't have PHY-less
SGMII support there. I was hoping you can add the same.

York
Joe Hershberger Dec. 5, 2017, 8:34 p.m. | #3
On Mon, Nov 13, 2017 at 3:37 AM, Ashish Kumar <Ashish.Kumar@nxp.com> wrote:
> In case of PHY-less mode, there is no interaction with PHY
> so auto-neg etc is not required and link will have fixed
> attributes

It appears that the commit message does not match the code. It appears
you are adding SGMII support. I don't see any thing that would affect
auto-neg. Please either correct the patch or make the message more
clear.

Thanks,
-Joe

Patch

diff --git a/drivers/net/ldpaa_eth/ldpaa_eth.c b/drivers/net/ldpaa_eth/ldpaa_eth.c
index 21be79a..85e7faa 100644
--- a/drivers/net/ldpaa_eth/ldpaa_eth.c
+++ b/drivers/net/ldpaa_eth/ldpaa_eth.c
@@ -440,12 +440,17 @@  static int ldpaa_eth_open(struct eth_device *net_dev, bd_t *bd)
 	bus = wriop_get_mdio(priv->dpmac_id);
 	enet_if = wriop_get_enet_if(priv->dpmac_id);
 	if ((bus == NULL) &&
-	    (enet_if == PHY_INTERFACE_MODE_XGMII)) {
+	   ((enet_if == PHY_INTERFACE_MODE_XGMII) ||
+	   (enet_if == PHY_INTERFACE_MODE_SGMII))) {
 		priv->phydev = (struct phy_device *)
 				malloc(sizeof(struct phy_device));
 		memset(priv->phydev, 0, sizeof(struct phy_device));
 
-		priv->phydev->speed = SPEED_10000;
+		if (enet_if == PHY_INTERFACE_MODE_XGMII)
+			priv->phydev->speed = SPEED_10000;
+		else
+			priv->phydev->speed = SPEED_1000;
+
 		priv->phydev->link = 1;
 		priv->phydev->duplex = DUPLEX_FULL;
 	}