From patchwork Fri Apr 27 12:52:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Six X-Patchwork-Id: 905737 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 40XZ1v0cLVz9s08 for ; Fri, 27 Apr 2018 23:06:10 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id A0F09C221A1; Fri, 27 Apr 2018 12:59:28 +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 B2B90C22119; Fri, 27 Apr 2018 12:58:34 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 88348C2206E; Fri, 27 Apr 2018 12:53:19 +0000 (UTC) Received: from smtprelay05.ispgateway.de (smtprelay05.ispgateway.de [80.67.18.28]) by lists.denx.de (Postfix) with ESMTPS id D329BC22162 for ; Fri, 27 Apr 2018 12:53:15 +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 1fC2sE-0006ms-Pa; Fri, 27 Apr 2018 14:53:14 +0200 From: Mario Six To: Joe Hershberger , U-Boot Mailing List Date: Fri, 27 Apr 2018 14:52:56 +0200 Message-Id: <20180427125257.1081-1-mario.six@gdsys.cc> X-Mailer: git-send-email 2.11.0 X-Df-Sender: bWFyaW8uc2l4QGdkc3lzLmNj Subject: [U-Boot] [PATCH v2 1/2] net: Initialize as many ethernet devices as possible 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" On devices that have their first network interface provided by a FPGA, the initialization of further interfaces will fail if the FPGA is not yet programmed. This leads to problems during factory setup when the data is supposed to be loaded over secondary netowork interfaces. To avoid this, use the uclass_{first,next}_device_check functions to initialize as many ethernet devices as possible. Signed-off-by: Mario Six Acked-by: Joe Hershberger --- v1 -> v2: No changes --- net/eth-uclass.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/eth-uclass.c b/net/eth-uclass.c index 240b596534..2877700ff4 100644 --- a/net/eth-uclass.c +++ b/net/eth-uclass.c @@ -396,7 +396,7 @@ int eth_initialize(void) * This is accomplished by attempting to probe each device and calling * their write_hwaddr() operation. */ - uclass_first_device(UCLASS_ETH, &dev); + uclass_first_device_check(UCLASS_ETH, &dev); if (!dev) { printf("No ethernet found.\n"); bootstage_error(BOOTSTAGE_ID_NET_ETH_START); @@ -425,7 +425,7 @@ int eth_initialize(void) eth_write_hwaddr(dev); - uclass_next_device(&dev); + uclass_next_device_check(&dev); num_devices++; } while (dev); 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;