All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] driver: net: ldpaa_eth: Add PHY-less SGMII support
@ 2017-11-06  9:09 Ashish Kumar
  2017-11-08 20:37 ` York Sun
  0 siblings, 1 reply; 5+ messages in thread
From: Ashish Kumar @ 2017-11-06  9:09 UTC (permalink / raw)
  To: u-boot

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

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;
 	}
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [U-Boot] [PATCH] driver: net: ldpaa_eth: Add PHY-less SGMII support
  2017-11-06  9:09 [U-Boot] [PATCH] driver: net: ldpaa_eth: Add PHY-less SGMII support Ashish Kumar
@ 2017-11-08 20:37 ` York Sun
  2017-11-09  5:16   ` Ashish Kumar
  0 siblings, 1 reply; 5+ messages in thread
From: York Sun @ 2017-11-08 20:37 UTC (permalink / raw)
  To: u-boot

On 11/06/2017 01:09 AM, Ashish Kumar 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
> 
> Signed-off-by: Ashish Kumar <Ashish.Kumar@nxp.com>
> Signed-off-by: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
> ---
>  drivers/net/ldpaa_eth/ldpaa_eth.c | 9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
> 
> 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;
>  	}
> 

How was this patch tested?

A little off-topic. I remember a similar discussion somewhere (maybe
internal) for PowerPC-based boards regarding fixed SGMII port. When the
port doesn't have a PHY, it fails due to PHY id check. I don't find the
change in U-Boot code. Does anyone remember it?

York

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [U-Boot] [PATCH] driver: net: ldpaa_eth: Add PHY-less SGMII support
  2017-11-08 20:37 ` York Sun
@ 2017-11-09  5:16   ` Ashish Kumar
  2017-11-09 17:48     ` York Sun
  2018-01-02  5:44     ` Ashish Kumar
  0 siblings, 2 replies; 5+ messages in thread
From: Ashish Kumar @ 2017-11-09  5:16 UTC (permalink / raw)
  To: u-boot

-----Original Message-----
From: York Sun 
Sent: Thursday, November 09, 2017 2:07 AM
To: Ashish Kumar <ashish.kumar@nxp.com>; u-boot at lists.denx.de
Cc: joe.hershberger at ni.com; Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
Subject: Re: [PATCH] driver: net: ldpaa_eth: Add PHY-less SGMII support

On 11/06/2017 01:09 AM, Ashish Kumar 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
> 
> Signed-off-by: Ashish Kumar <Ashish.Kumar@nxp.com>
> Signed-off-by: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
> ---
>  drivers/net/ldpaa_eth/ldpaa_eth.c | 9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
> 
> 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;
>  	}
> 

How was this patch tested?

>It can be tested with PHY-less SGMII riser cards after adding patches attached. 
>With the existing Riser card, which are PHY enabled, the test is that PHYs are not configured by adding these to patches.

>Do you suggest to add these patches in upstream?

Regards
Ashish

A little off-topic. I remember a similar discussion somewhere (maybe
internal) for PowerPC-based boards regarding fixed SGMII port. When the port doesn't have a PHY, it fails due to PHY id check. I don't find the change in U-Boot code. Does anyone remember it?

York
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-armv8-ls1088-introduce-CONFIG_SGMII_PHYLIB.patch
Type: application/octet-stream
Size: 1184 bytes
Desc: 0001-armv8-ls1088-introduce-CONFIG_SGMII_PHYLIB.patch
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20171109/09b9f7cb/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-ls1088aqds-Add-CONFIG_SGMII_PHYLIB-in-header-file-fo.patch
Type: application/octet-stream
Size: 1179 bytes
Desc: 0002-ls1088aqds-Add-CONFIG_SGMII_PHYLIB-in-header-file-fo.patch
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20171109/09b9f7cb/attachment-0001.obj>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [U-Boot] [PATCH] driver: net: ldpaa_eth: Add PHY-less SGMII support
  2017-11-09  5:16   ` Ashish Kumar
@ 2017-11-09 17:48     ` York Sun
  2018-01-02  5:44     ` Ashish Kumar
  1 sibling, 0 replies; 5+ messages in thread
From: York Sun @ 2017-11-09 17:48 UTC (permalink / raw)
  To: u-boot

On 11/08/2017 09:16 PM, Ashish Kumar wrote:
> -----Original Message-----
> From: York Sun 
> Sent: Thursday, November 09, 2017 2:07 AM
> To: Ashish Kumar <ashish.kumar@nxp.com>; u-boot at lists.denx.de
> Cc: joe.hershberger at ni.com; Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
> Subject: Re: [PATCH] driver: net: ldpaa_eth: Add PHY-less SGMII support
> 
> On 11/06/2017 01:09 AM, Ashish Kumar 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
>>
>> Signed-off-by: Ashish Kumar <Ashish.Kumar@nxp.com>
>> Signed-off-by: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
>> ---
>>  drivers/net/ldpaa_eth/ldpaa_eth.c | 9 +++++++--
>>  1 file changed, 7 insertions(+), 2 deletions(-)
>>
>> 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;
>>  	}
>>
> 
> How was this patch tested?
> 
>> It can be tested with PHY-less SGMII riser cards after adding patches attached. 
>> With the existing Riser card, which are PHY enabled, the test is that PHYs are not configured by adding these to patches.
> 
>> Do you suggest to add these patches in upstream?
> 

Ashish,

This patch seems OK. But it is only effective with the other two patches
you mentioned, isn't it? Please find a proper way to enable SGMII_PHYLIB
using Kconfig.

York

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [U-Boot] [PATCH] driver: net: ldpaa_eth: Add PHY-less SGMII support
  2017-11-09  5:16   ` Ashish Kumar
  2017-11-09 17:48     ` York Sun
@ 2018-01-02  5:44     ` Ashish Kumar
  1 sibling, 0 replies; 5+ messages in thread
From: Ashish Kumar @ 2018-01-02  5:44 UTC (permalink / raw)
  To: u-boot



> -----Original Message-----
> From: U-Boot [mailto:u-boot-bounces at lists.denx.de] On Behalf Of Ashish
> Kumar
> Sent: Thursday, November 09, 2017 10:46 AM
> To: York Sun <york.sun@nxp.com>; u-boot at lists.denx.de; Prabhakar Kushwaha
> <prabhakar.kushwaha@nxp.com>
> Cc: joe.hershberger at ni.com
> Subject: Re: [U-Boot] [PATCH] driver: net: ldpaa_eth: Add PHY-less SGMII
> support
> 
> -----Original Message-----
> From: York Sun
> Sent: Thursday, November 09, 2017 2:07 AM
> To: Ashish Kumar <ashish.kumar@nxp.com>; u-boot at lists.denx.de
> Cc: joe.hershberger at ni.com; Prabhakar Kushwaha
> <prabhakar.kushwaha@nxp.com>
> Subject: Re: [PATCH] driver: net: ldpaa_eth: Add PHY-less SGMII support
> 
> On 11/06/2017 01:09 AM, Ashish Kumar 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
> >
> > Signed-off-by: Ashish Kumar <Ashish.Kumar@nxp.com>
> > Signed-off-by: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
> > ---
> >  drivers/net/ldpaa_eth/ldpaa_eth.c | 9 +++++++--
> >  1 file changed, 7 insertions(+), 2 deletions(-)
> >
> > 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;
> >  	}
> >
> 
> How was this patch tested?
> 
> >It can be tested with PHY-less SGMII riser cards after adding patches attached.
> >With the existing Riser card, which are PHY enabled, the test is that PHYs are
> not configured by adding these to patches.
> 
> >Do you suggest to add these patches in upstream?
> 
> Regards
> Ashish
> 
> A little off-topic. I remember a similar discussion somewhere (maybe
> internal) for PowerPC-based boards regarding fixed SGMII port. When the port
> doesn't have a PHY, it fails due to PHY id check. I don't find the change in U-Boot
> code. Does anyone remember it?

Hello York,

Please provide more details of the PowerPC target in which this these changes may be required?

Regards
Ashish
> 
> York

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-01-02  5:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-06  9:09 [U-Boot] [PATCH] driver: net: ldpaa_eth: Add PHY-less SGMII support Ashish Kumar
2017-11-08 20:37 ` York Sun
2017-11-09  5:16   ` Ashish Kumar
2017-11-09 17:48     ` York Sun
2018-01-02  5:44     ` Ashish Kumar

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.