From patchwork Thu Mar 23 16:02:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Roese X-Patchwork-Id: 742768 X-Patchwork-Delegate: sr@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3vpsTr03rkz9s0m for ; Fri, 24 Mar 2017 03:30:07 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id ACFFAC21D41; Thu, 23 Mar 2017 16:09:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 0BB40C21D42; Thu, 23 Mar 2017 16:02:54 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 1CD17C21D4D; Thu, 23 Mar 2017 16:02:39 +0000 (UTC) Received: from mx1.mailbox.org (mx1.mailbox.org [80.241.60.212]) by lists.denx.de (Postfix) with ESMTPS id CE57BC21C75 for ; Thu, 23 Mar 2017 16:02:33 +0000 (UTC) Received: from smtp1.mailbox.org (smtp1.mailbox.org [80.241.60.240]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.mailbox.org (Postfix) with ESMTPS id A5B6F459AD; Thu, 23 Mar 2017 17:02:33 +0100 (CET) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp1.mailbox.org ([80.241.60.240]) by spamfilter01.heinlein-hosting.de (spamfilter01.heinlein-hosting.de [80.241.56.115]) (amavisd-new, port 10030) with ESMTP id YyNUlGTGQ7EZ; Thu, 23 Mar 2017 17:02:29 +0100 (CET) From: Stefan Roese To: u-boot@lists.denx.de Date: Thu, 23 Mar 2017 17:02:03 +0100 Message-Id: <20170323160211.18072-38-sr@denx.de> In-Reply-To: <20170323160211.18072-1-sr@denx.de> References: <20170323160211.18072-1-sr@denx.de> Cc: Nadav Haklai , Stefan Chulski , Thomas Petazzoni , Joe Hershberger Subject: [U-Boot] [PATCH v2 37/45] net: mvpp2: Read phy-speed from DT to select between 1GB and 2.5GB SGMII X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" 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 Cc: Joe Hershberger Acked-by: Joe Hershberger --- Changes in v2: - New patch drivers/net/mvpp2.c | 11 +++++++++++ 1 file changed, 11 insertions(+) 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;