diff mbox

[U-Boot,v2,37/45] net: mvpp2: Read phy-speed from DT to select between 1GB and 2.5GB SGMII

Message ID 20170323160211.18072-38-sr@denx.de
State Accepted
Commit 9acb7da14ebb55b2a9819c34a24f4ce6e99202c4
Delegated to: Stefan Roese
Headers show

Commit Message

Stefan Roese March 23, 2017, 4:02 p.m. UTC
Read the "phy-speed" DT property to differentiate between 1 and 2.5GB
SGMII operations. Please note that its unclear right now, if this
DT property will be accepted in mainline Linux. If not, we need to
revisit this code and change it to use the accepted property.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Joe Hershberger <joe.hershberger@ni.com>

---

Changes in v2:
- New patch

 drivers/net/mvpp2.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

Comments

Joe Hershberger March 25, 2017, 9:31 p.m. UTC | #1
On Thu, Mar 23, 2017 at 12:02 PM, Stefan Roese <sr@denx.de> wrote:
> Read the "phy-speed" DT property to differentiate between 1 and 2.5GB
> SGMII operations. Please note that its unclear right now, if this
> DT property will be accepted in mainline Linux. If not, we need to
> revisit this code and change it to use the accepted property.
>
> Signed-off-by: Stefan Roese <sr@denx.de>
> Cc: Joe Hershberger <joe.hershberger@ni.com>

Acked-by: Joe Hershberger <joe.hershberger@ni.com>
diff mbox

Patch

diff --git a/drivers/net/mvpp2.c b/drivers/net/mvpp2.c
index ecefa21097..6f9a4137f8 100644
--- a/drivers/net/mvpp2.c
+++ b/drivers/net/mvpp2.c
@@ -839,6 +839,8 @@  struct mvpp2_port {
 	unsigned int duplex;
 	unsigned int speed;
 
+	unsigned int phy_speed;		/* SGMII 1Gbps vs 2.5Gbps */
+
 	struct mvpp2_bm_pool *pool_long;
 	struct mvpp2_bm_pool *pool_short;
 
@@ -3859,6 +3861,15 @@  static int phy_info_parse(struct udevice *dev, struct mvpp2_port *port)
 		return -EINVAL;
 	}
 
+	/*
+	 * ToDo:
+	 * Not sure if this DT property "phy-speed" will get accepted, so
+	 * this might change later
+	 */
+	/* Get phy-speed for SGMII 2.5Gbps vs 1Gbps setup */
+	port->phy_speed = fdtdec_get_int(gd->fdt_blob, port_node,
+					 "phy-speed", 1000);
+
 	phyaddr = fdtdec_get_int(gd->fdt_blob, phy_node, "reg", 0);
 
 	port->id = id;