From patchwork Fri Apr 27 12:52:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Six X-Patchwork-Id: 905736 X-Patchwork-Delegate: joe.hershberger@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=gdsys.cc Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 40XZ0X47TJz9s08 for ; Fri, 27 Apr 2018 23:05:00 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 26918C22194; Fri, 27 Apr 2018 12:59:44 +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=RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS 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 1DE6DC22118; Fri, 27 Apr 2018 12:58:55 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 5184DC2212B; Fri, 27 Apr 2018 12:53:20 +0000 (UTC) Received: from smtprelay05.ispgateway.de (smtprelay05.ispgateway.de [80.67.18.28]) by lists.denx.de (Postfix) with ESMTPS id 09643C2215D for ; Fri, 27 Apr 2018 12:53:16 +0000 (UTC) Received: from [80.151.34.241] (helo=bob3.testumgebung.local) by smtprelay05.ispgateway.de with esmtpa (Exim 4.90_1) (envelope-from ) id 1fC2sF-0006ms-0T; Fri, 27 Apr 2018 14:53:15 +0200 From: Mario Six To: Joe Hershberger , U-Boot Mailing List Date: Fri, 27 Apr 2018 14:52:57 +0200 Message-Id: <20180427125257.1081-2-mario.six@gdsys.cc> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180427125257.1081-1-mario.six@gdsys.cc> References: <20180427125257.1081-1-mario.six@gdsys.cc> X-Df-Sender: bWFyaW8uc2l4QGdkc3lzLmNj Subject: [U-Boot] [PATCH v2 2/2] tsec: Fix reading phy registers from DT 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" Bus translations should be applied when reading the address of the sgmii phy registers from the DT. Use ofnode_get_addr_index instead of the plain ofnode_read_u32_default to fix this. Signed-off-by: Mario Six Acked-by: Joe Hershberger --- v1 -> v2: No changes --- drivers/net/tsec.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/tsec.c b/drivers/net/tsec.c index 6829e32dae..7a7ae1dccc 100644 --- a/drivers/net/tsec.c +++ b/drivers/net/tsec.c @@ -797,8 +797,9 @@ int tsec_probe(struct udevice *dev) parent = ofnode_get_parent(phandle_args.node); if (ofnode_valid(parent)) { - int reg = ofnode_read_u32_default(parent, "reg", 0); - priv->phyregs_sgmii = (struct tsec_mii_mng *)(reg + 0x520); + int reg = ofnode_get_addr_index(parent, 0); + + priv->phyregs_sgmii = (struct tsec_mii_mng *)reg; } else { debug("No parent node for PHY?\n"); return -ENOENT;