diff mbox series

[U-Boot,RFC] Support for SGMII 2500

Message ID DB3PR0402MB38492E028D1B09AFE15A5D4EEC3A0@DB3PR0402MB3849.eurprd04.prod.outlook.com
State RFC
Delegated to: Joe Hershberger
Headers show
Series [U-Boot,RFC] Support for SGMII 2500 | expand

Commit Message

Madalin Bucur Nov. 28, 2017, 7:25 a.m. UTC
Hi,

There is a disconnect between the SGMII 2500 support in u-boot and Linux.
Bhaskar is trying to add support for a SGMII interface working at 2.5Gbps
by using the PHY connection type "sgmii-2500" in the device tree:

	phy-connection-type = "sgmii-2500";

This is supported by u-boot, in include/phy.h:

	typedef enum {
	        PHY_INTERFACE_MODE_MII,
	        PHY_INTERFACE_MODE_GMII,
	        PHY_INTERFACE_MODE_SGMII,
	        PHY_INTERFACE_MODE_SGMII_2500,
	...

	static const char *phy_interface_strings[] = {
	        [PHY_INTERFACE_MODE_MII]                = "mii",
	        [PHY_INTERFACE_MODE_GMII]               = "gmii",
	        [PHY_INTERFACE_MODE_SGMII]              = "sgmii",
	        [PHY_INTERFACE_MODE_SGMII_2500]         = "sgmii-2500",
	...

since this commit:

	commit c35f8693942d8284c635592f263a0fe11abe1d1d	
	Author: Shengzhou Liu <Shengzhou.Liu@freescale.com>
	Date:   Thu Oct 23 17:20:57 2014 +0800

	    net/fm: add 2.5G SGMII support

	    As auto-negotiation is not supported for 2.5G SGMII, we need
	    to add a new type PHY_INTERFACE_MODE_SGMII_2500 to differentiate
	    SGMII-1G and SGMII-2.5G with different setting for auto-negotiation.

	    Signed-off-by: Shaohui Xie <Shaohui.Xie@freescale.com>
	    Signed-off-by: Shengzhou Liu <Shengzhou.Liu@freescale.com>
	    Reviewed-by: York Sun <yorksun@freescale.com>

In the Linux kernel we do not have a separate define for SGMII_2500, should we add
something like the change below?

Thanks,
Madalin

---

Comments

Bhaskar Upadhaya Nov. 28, 2017, 7:27 a.m. UTC | #1
+ Anji, Calvin, Prabhakar, Poonam.

-----Original Message-----
From: Madalin-cristian Bucur 
Sent: Tuesday, November 28, 2017 12:56 PM
To: Andrew Lunn <andrew@lunn.ch>; f.fainelli@gmail.com; netdev@vger.kernel.org
Cc: Bhaskar Upadhaya <bhaskar.upadhaya@nxp.com>; Shengzhou Liu <shengzhou.liu@nxp.com>; York Sun <york.sun@nxp.com>; u-boot@lists.denx.de
Subject: [RFC] Support for SGMII 2500

Hi,

There is a disconnect between the SGMII 2500 support in u-boot and Linux.
Bhaskar is trying to add support for a SGMII interface working at 2.5Gbps by using the PHY connection type "sgmii-2500" in the device tree:

	phy-connection-type = "sgmii-2500";

This is supported by u-boot, in include/phy.h:

	typedef enum {
	        PHY_INTERFACE_MODE_MII,
	        PHY_INTERFACE_MODE_GMII,
	        PHY_INTERFACE_MODE_SGMII,
	        PHY_INTERFACE_MODE_SGMII_2500,
	...

	static const char *phy_interface_strings[] = {
	        [PHY_INTERFACE_MODE_MII]                = "mii",
	        [PHY_INTERFACE_MODE_GMII]               = "gmii",
	        [PHY_INTERFACE_MODE_SGMII]              = "sgmii",
	        [PHY_INTERFACE_MODE_SGMII_2500]         = "sgmii-2500",
	...

since this commit:

	commit c35f8693942d8284c635592f263a0fe11abe1d1d	
	Author: Shengzhou Liu <Shengzhou.Liu@freescale.com>
	Date:   Thu Oct 23 17:20:57 2014 +0800

	    net/fm: add 2.5G SGMII support

	    As auto-negotiation is not supported for 2.5G SGMII, we need
	    to add a new type PHY_INTERFACE_MODE_SGMII_2500 to differentiate
	    SGMII-1G and SGMII-2.5G with different setting for auto-negotiation.

	    Signed-off-by: Shaohui Xie <Shaohui.Xie@freescale.com>
	    Signed-off-by: Shengzhou Liu <Shengzhou.Liu@freescale.com>
	    Reviewed-by: York Sun <yorksun@freescale.com>

In the Linux kernel we do not have a separate define for SGMII_2500, should we add something like the change below?

Thanks,
Madalin

---
diff --git a/include/linux/phy.h b/include/linux/phy.h index dc82a07..086f7a3 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -68,6 +68,7 @@ typedef enum {
	PHY_INTERFACE_MODE_MII,
	PHY_INTERFACE_MODE_GMII,
	PHY_INTERFACE_MODE_SGMII,
+	PHY_INTERFACE_MODE_SGMII_2500,
	PHY_INTERFACE_MODE_TBI,
	PHY_INTERFACE_MODE_REVMII,
	PHY_INTERFACE_MODE_RMII,
@@ -123,6 +124,8 @@ static inline const char *phy_modes(phy_interface_t interface)
		return "gmii";
	case PHY_INTERFACE_MODE_SGMII:
		return "sgmii";
+	case PHY_INTERFACE_MODE_SGMII_2500:
+		return "sgmii-2500";
	case PHY_INTERFACE_MODE_TBI:
		return "tbi";
	case PHY_INTERFACE_MODE_REVMII:
Prabhakar Kushwaha Nov. 28, 2017, 8:16 a.m. UTC | #2
Hi Madalin,

> -----Original Message-----
> From: Bhaskar Upadhaya
> Sent: Tuesday, November 28, 2017 12:57 PM
> To: Madalin-cristian Bucur <madalin.bucur@nxp.com>; Andrew Lunn
> <andrew@lunn.ch>; f.fainelli@gmail.com; netdev@vger.kernel.org; Anji
> Jagarlmudi <anji.jagarlmudi@nxp.com>; Calvin Johnson
> <calvin.johnson@nxp.com>; Prabhakar Kushwaha
> <prabhakar.kushwaha@nxp.com>; Poonam Aggrwal
> <poonam.aggrwal@nxp.com>
> Cc: Shengzhou Liu <shengzhou.liu@nxp.com>; York Sun <york.sun@nxp.com>; u-
> boot@lists.denx.de
> Subject: RE: [RFC] Support for SGMII 2500
> 
> + Anji, Calvin, Prabhakar, Poonam.
> 
> -----Original Message-----
> From: Madalin-cristian Bucur
> Sent: Tuesday, November 28, 2017 12:56 PM
> To: Andrew Lunn <andrew@lunn.ch>; f.fainelli@gmail.com;
> netdev@vger.kernel.org
> Cc: Bhaskar Upadhaya <bhaskar.upadhaya@nxp.com>; Shengzhou Liu
> <shengzhou.liu@nxp.com>; York Sun <york.sun@nxp.com>; u-
> boot@lists.denx.de
> Subject: [RFC] Support for SGMII 2500
> 
> Hi,
> 
> There is a disconnect between the SGMII 2500 support in u-boot and Linux.
> Bhaskar is trying to add support for a SGMII interface working at 2.5Gbps by
> using the PHY connection type "sgmii-2500" in the device tree:
> 
> 	phy-connection-type = "sgmii-2500";
> 
> This is supported by u-boot, in include/phy.h:
> 
> 	typedef enum {
> 	        PHY_INTERFACE_MODE_MII,
> 	        PHY_INTERFACE_MODE_GMII,
> 	        PHY_INTERFACE_MODE_SGMII,
> 	        PHY_INTERFACE_MODE_SGMII_2500,
> 	...
> 
> 	static const char *phy_interface_strings[] = {
> 	        [PHY_INTERFACE_MODE_MII]                = "mii",
> 	        [PHY_INTERFACE_MODE_GMII]               = "gmii",
> 	        [PHY_INTERFACE_MODE_SGMII]              = "sgmii",
> 	        [PHY_INTERFACE_MODE_SGMII_2500]         = "sgmii-2500",
> 	...
> 
> since this commit:
> 
> 	commit c35f8693942d8284c635592f263a0fe11abe1d1d
> 	Author: Shengzhou Liu <Shengzhou.Liu@freescale.com>
> 	Date:   Thu Oct 23 17:20:57 2014 +0800
> 
> 	    net/fm: add 2.5G SGMII support
> 
> 	    As auto-negotiation is not supported for 2.5G SGMII, we need
> 	    to add a new type PHY_INTERFACE_MODE_SGMII_2500 to
> differentiate
> 	    SGMII-1G and SGMII-2.5G with different setting for auto-negotiation.
> 
> 	    Signed-off-by: Shaohui Xie <Shaohui.Xie@freescale.com>
> 	    Signed-off-by: Shengzhou Liu <Shengzhou.Liu@freescale.com>
> 	    Reviewed-by: York Sun <yorksun@freescale.com>
> 
> In the Linux kernel we do not have a separate define for SGMII_2500, should we
> add something like the change below?
> 

If there is no separate define in Linux. Than how it deals with auto-negotiation.
Can same approach be used in u-boot?

--pk
Andrew Lunn Nov. 28, 2017, 1:30 p.m. UTC | #3
On Tue, Nov 28, 2017 at 07:25:48AM +0000, Madalin-cristian Bucur wrote:
> Hi,
> 
> There is a disconnect between the SGMII 2500 support in u-boot and Linux.
> Bhaskar is trying to add support for a SGMII interface working at 2.5Gbps
> by using the PHY connection type "sgmii-2500" in the device tree:

Hi Madalin

What MAC and PHY are you using?

I did a quick search for SGMII 2.5, and all i keep coming across is
2500BASE-X. I just want to make sure you really do need SGMII at 2500,
and not 2500BASE-X, which is already supported.

Thanks
	Andrew
Madalin Bucur Nov. 28, 2017, 1:55 p.m. UTC | #4
> -----Original Message-----
> From: Andrew Lunn [mailto:andrew@lunn.ch]
> Sent: Tuesday, November 28, 2017 3:30 PM
> Subject: Re: [RFC] Support for SGMII 2500
> 
> On Tue, Nov 28, 2017 at 07:25:48AM +0000, Madalin-cristian Bucur wrote:
> > Hi,
> >
> > There is a disconnect between the SGMII 2500 support in u-boot and
> Linux.
> > Bhaskar is trying to add support for a SGMII interface working at
> 2.5Gbps
> > by using the PHY connection type "sgmii-2500" in the device tree:
> 
> Hi Madalin
> 
> What MAC and PHY are you using?
> 
> I did a quick search for SGMII 2.5, and all i keep coming across is
> 2500BASE-X. I just want to make sure you really do need SGMII at 2500,
> and not 2500BASE-X, which is already supported.
> 
> Thanks
> 	Andrew

Hi Andrew,

Bhaskar is working on enabling a PFE [1] MAC connected to an Aquantia AQR107 
PHY [2] on a LS1012AQDS board. Initially I've indicated 2500Base-X too, but it
seems the HW actually works in SGMII mode. The QDS boards are lower volume,
higher spec boards than the RDBs [3], they exercise most of the HW capabilities.

Regards,
Madalin

[1] https://www.nxp.com/products/processors-and-microcontrollers/arm-based-processors-and-mcus/qoriq-layerscape-arm-processors/qoriq-layerscape-1012a-low-power-communication-processor:LS1012A
[2] https://www.aquantia.com/products/enterprise/aqr107/
[3] https://www.nxp.com/support/developer-resources/software-development-tools/qoriq-developer-resources/qoriq-ls1012a-reference-design-board:LS1012A-RDB
Andrew Lunn Nov. 28, 2017, 2:13 p.m. UTC | #5
> Hi Andrew,
> 
> Bhaskar is working on enabling a PFE [1] MAC connected to an Aquantia AQR107 
> PHY [2] on a LS1012AQDS board. Initially I've indicated 2500Base-X too, but it
> seems the HW actually works in SGMII mode. The QDS boards are lower volume,
> higher spec boards than the RDBs [3], they exercise most of the HW capabilities.

The webpage for the AQR107 lists 2500Base-X, so i assume the issue is
with the MAC? Ideally you want to use 2500Base-X, since this is wider
known.

Anyway, you seem to have a legitimate need for it.

However, i would prefer a different name. The convention is to put the
number first. So PHY_INTERFACE_MODE_2500SGMII.

       Andrew
Madalin Bucur Nov. 28, 2017, 3:37 p.m. UTC | #6
> -----Original Message-----
> From: Andrew Lunn [mailto:andrew@lunn.ch]
> Sent: Tuesday, November 28, 2017 4:13 PM
> To: Madalin-cristian Bucur <madalin.bucur@nxp.com>
> Subject: Re: [RFC] Support for SGMII 2500
> 
> > Hi Andrew,
> >
> > Bhaskar is working on enabling a PFE [1] MAC connected to an Aquantia
> AQR107
> > PHY [2] on a LS1012AQDS board. Initially I've indicated 2500Base-X too,
> but it
> > seems the HW actually works in SGMII mode. The QDS boards are lower
> volume,
> > higher spec boards than the RDBs [3], they exercise most of the HW
> capabilities.
> 
> The webpage for the AQR107 lists 2500Base-X, so i assume the issue is
> with the MAC? Ideally you want to use 2500Base-X, since this is wider
> known.
> 
> Anyway, you seem to have a legitimate need for it.
> 
> However, i would prefer a different name. The convention is to put the
> number first. So PHY_INTERFACE_MODE_2500SGMII.
> 
>        Andrew

OK,

I just wanted to make sure 2.5G SGMII is to be added separately from the
"normal" SGMII, as it was done in u-boot. Thanks also for the naming hint.

Madalin
Florian Fainelli Nov. 28, 2017, 5:51 p.m. UTC | #7
On 11/28/2017 07:37 AM, Madalin-cristian Bucur wrote:
>> -----Original Message-----
>> From: Andrew Lunn [mailto:andrew@lunn.ch]
>> Sent: Tuesday, November 28, 2017 4:13 PM
>> To: Madalin-cristian Bucur <madalin.bucur@nxp.com>
>> Subject: Re: [RFC] Support for SGMII 2500
>>
>>> Hi Andrew,
>>>
>>> Bhaskar is working on enabling a PFE [1] MAC connected to an Aquantia
>> AQR107
>>> PHY [2] on a LS1012AQDS board. Initially I've indicated 2500Base-X too,
>> but it
>>> seems the HW actually works in SGMII mode. The QDS boards are lower
>> volume,
>>> higher spec boards than the RDBs [3], they exercise most of the HW
>> capabilities.
>>
>> The webpage for the AQR107 lists 2500Base-X, so i assume the issue is
>> with the MAC? Ideally you want to use 2500Base-X, since this is wider
>> known.
>>
>> Anyway, you seem to have a legitimate need for it.
>>
>> However, i would prefer a different name. The convention is to put the
>> number first. So PHY_INTERFACE_MODE_2500SGMII.
>>
>>        Andrew
> 
> OK,
> 
> I just wanted to make sure 2.5G SGMII is to be added separately from the
> "normal" SGMII, as it was done in u-boot. Thanks also for the naming hint.

Sorry for chiming in that late, but what is 2.5G SGMII exactly? Either
you can use SGMII auto-negotiation, and in which case, why is not 2.5G
selected, or you can't and you might want to use a fixed-link property then.
diff mbox series

Patch

diff --git a/include/linux/phy.h b/include/linux/phy.h
index dc82a07..086f7a3 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -68,6 +68,7 @@  typedef enum {
	PHY_INTERFACE_MODE_MII,
	PHY_INTERFACE_MODE_GMII,
	PHY_INTERFACE_MODE_SGMII,
+	PHY_INTERFACE_MODE_SGMII_2500,
	PHY_INTERFACE_MODE_TBI,
	PHY_INTERFACE_MODE_REVMII,
	PHY_INTERFACE_MODE_RMII,
@@ -123,6 +124,8 @@  static inline const char *phy_modes(phy_interface_t interface)
		return "gmii";
	case PHY_INTERFACE_MODE_SGMII:
		return "sgmii";
+	case PHY_INTERFACE_MODE_SGMII_2500:
+		return "sgmii-2500";
	case PHY_INTERFACE_MODE_TBI:
		return "tbi";
	case PHY_INTERFACE_MODE_REVMII: