From patchwork Mon Jan 4 23:38:08 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 562905 X-Patchwork-Delegate: sbabic@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id BF3341402A9 for ; Tue, 5 Jan 2016 10:39:00 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=raY/B9Bn; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id E751B4B7DD; Tue, 5 Jan 2016 00:38:58 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Uumz9boeFgCG; Tue, 5 Jan 2016 00:38:58 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 34A414B7AF; Tue, 5 Jan 2016 00:38:56 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id BBB4F4B7AF for ; Tue, 5 Jan 2016 00:38:50 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 49t-IrOnxFfl for ; Tue, 5 Jan 2016 00:38:50 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-yk0-f174.google.com (mail-yk0-f174.google.com [209.85.160.174]) by theia.denx.de (Postfix) with ESMTPS id 976C54B794 for ; Tue, 5 Jan 2016 00:38:45 +0100 (CET) Received: by mail-yk0-f174.google.com with SMTP id k129so242560450yke.0 for ; Mon, 04 Jan 2016 15:38:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=6XZniVtDgo40zKXULGHwdKqZT4WD+GfWU/MPd/dezrU=; b=raY/B9BnHt7ZMg7RibNXE77JAAuQCSembQRGAhGbeU/3iqQMuizMNhP3mVLZUA43X0 pXOo2rIU+cY2h4XKJJEPeY6uTmg/sg6FF7rkuOlfieCinSATdN+sBiAW7WN6bAOknrz7 HbAZtqe22rtkQj7XVr5b1ejYpYK3Yozw8y6lcX39vEIt7LNGXw8TPnspC7dORzdRSOdt gV6NMaYZJRuFWcjYv1M6PzBSyaWTS2ksptk+QYqRVKnh0eqsEwjeFkjsD8eTLZp/PAby 3SEd/OoEQRhm1badZhYRW+ZI1oaYtQOsL8bhGW5zhXjmo9KYRQI+NoauIvLmEGULqmVE wz4A== X-Received: by 10.129.98.86 with SMTP id w83mr67115770ywb.37.1451950723719; Mon, 04 Jan 2016 15:38:43 -0800 (PST) Received: from localhost.localdomain ([187.64.228.119]) by smtp.gmail.com with ESMTPSA id s129sm41045699ywe.25.2016.01.04.15.38.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 04 Jan 2016 15:38:43 -0800 (PST) From: Fabio Estevam To: sbabic@denx.de Date: Mon, 4 Jan 2016 21:38:08 -0200 Message-Id: <1451950688-10549-1-git-send-email-festevam@gmail.com> X-Mailer: git-send-email 1.9.1 Cc: u-boot@lists.denx.de, trini@konsulko.com, Fabio Estevam Subject: [U-Boot] [PATCH v2] mx6cuboxi: Fix the reset delay for the AR8035 PHY X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 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" From: Fabio Estevam Since commit 59370f3fcd1350 ("net: phy: delay only if reset handler is registered") Ethernet is no longer functional: Booting from net ... FEC Waiting for PHY auto negotiation to complete......... TIMEOUT ! BOOTP broadcast 1 BOOTP broadcast 2 BOOTP broadcast 3 BOOTP broadcast 4 This commit does not have an issue in itself, but it revelead a problem with the Ethernet initialization. As per the AR8035 datasheet: "For a reliable power on reset, suggest to keep asserting the reset low long enough (10ms) to ensure the clock is stable and clock-to-reset 1ms requirement is satisfied." So do as suggested and keep the reset low for 10ms. Also add a 100us delay after deasserting the reset line to guarantee that the PHY ID can be read correctly and the Atheros PHY can be loaded as per Troy Kisky's suggestion. Signed-off-by: Fabio Estevam Tested-by: Tom Rini --- Changes since v1: - Fix the issue in a single patch by adding an extra udelay(100) as suggested by Troy. board/solidrun/mx6cuboxi/mx6cuboxi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/board/solidrun/mx6cuboxi/mx6cuboxi.c b/board/solidrun/mx6cuboxi/mx6cuboxi.c index fc37f1e..18b08d1 100644 --- a/board/solidrun/mx6cuboxi/mx6cuboxi.c +++ b/board/solidrun/mx6cuboxi/mx6cuboxi.c @@ -143,8 +143,9 @@ static void setup_iomux_enet(void) SETUP_IOMUX_PADS(enet_pads); gpio_direction_output(ETH_PHY_RESET, 0); - mdelay(2); + mdelay(10); gpio_set_value(ETH_PHY_RESET, 1); + udelay(100); } int board_phy_config(struct phy_device *phydev)