From patchwork Fri Jan 22 19:16:56 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: amessier.tyco@gmail.com X-Patchwork-Id: 571773 X-Patchwork-Delegate: joe.hershberger@gmail.com 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 5641C140B0E for ; Sat, 23 Jan 2016 06:17:14 +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=k7H7x0g2; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id E35954BF0B; Fri, 22 Jan 2016 20:17:12 +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 s-0ibC7i_eIV; Fri, 22 Jan 2016 20:17:12 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 126BF4BEE7; Fri, 22 Jan 2016 20:17:12 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 636A74BEE8 for ; Fri, 22 Jan 2016 20:17:09 +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 1ZhktC7_sYuz for ; Fri, 22 Jan 2016 20:17:09 +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-io0-f171.google.com (mail-io0-f171.google.com [209.85.223.171]) by theia.denx.de (Postfix) with ESMTPS id 121F64BEE3 for ; Fri, 22 Jan 2016 20:17:02 +0100 (CET) Received: by mail-io0-f171.google.com with SMTP id 1so97914390ion.1 for ; Fri, 22 Jan 2016 11:17:02 -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=xoZES9vBWhIgBY44I0z2bGCBERqOJGdeUuVMDNmmFXY=; b=k7H7x0g2RDlLwxiXtXk71ZgS6MrJNlHtoHbrgB/6ifl37y4s6qc7KdFcU2LZoiu+Q9 PFV22gaKmD0QS5ncVmnQ4b3m3pcgc+GZVQydg9UZ2n1R2NsE447UKA139xktNnCCSo8o ylcB93vHh0bfSU3zgeC9OlWbTxygLVFP5g1EH6u+yRkHee+aEdQGohLBKNnM/Ksbmp3A LOdxbw3PqBu8qV0hTRMf02QlLYwbCH50RFmcG+A2mKi/9llxDtKJgLsnzh5XhCsOlX5c o73FQ0eyjTJwNuz9ntj7Kn1MCNMoIUc1qDW9DzfKWkUchAvrGBCtTcfqURVWYlvYVUZR HfGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=xoZES9vBWhIgBY44I0z2bGCBERqOJGdeUuVMDNmmFXY=; b=Vcr73eU8rgghd6DjrPNgSTx+D9UacOTqeGyc2BzeQOw9senwSlnI311wWBQQkwxIF3 UFZ6+zCsUMoZqszusD15E93txlWo5Qbz37O2qi98bmBbBZ6iOftLB8u+hA6OfkFZk3Qq ldfrO4JoxaaSwEca7ews7ebcppWLgTiLxE1atuowazmqN4tnDUY2Dvz8nBEPqLofAKfx 5RKyZcOALukjlkyagLSosr+HV+P0NxRjW2gQuBSl7OKfhQ1xzGvE7RwB8Irf90DB9D25 g99ekOiwbJ8MgptKmjwuZU7PIZG7EckQ08SEs4H4xRTDjSkeTLhoEHQiQqW1Tphh070R i/8Q== X-Gm-Message-State: AG10YOTtCz+kKj4FYYvXjrze0MlVJX4zUd8I6qVssKoKbjGpmrbhRTVJdoN1YQOHzCfleg== X-Received: by 10.107.137.67 with SMTP id l64mr5401743iod.102.1453490221565; Fri, 22 Jan 2016 11:17:01 -0800 (PST) Received: from cabro3emblnx061.americas.tsp.ad ([74.51.240.241]) by smtp.gmail.com with ESMTPSA id ki7sm1783043igb.2.2016.01.22.11.17.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 22 Jan 2016 11:17:01 -0800 (PST) From: amessier.tyco@gmail.com To: u-boot@lists.denx.de Date: Fri, 22 Jan 2016 14:16:56 -0500 Message-Id: <1453490216-15156-1-git-send-email-amessier.tyco@gmail.com> X-Mailer: git-send-email 2.7.0 Cc: joe.hershberger@ni.com, amessier@tycoint.com Subject: [U-Boot] [PATCH] net: phy: Use 'autoneg' flag from phydev 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: Alexandre Messier Use the 'autoneg' flag available in phydev when checking if autoneg is in use. The previous implementation was checking directly in the PHY if autoneg was supported. Some PHYs will report that autoneg is supported, even when it is disabled. Thus it is not possible to use that bit to determine if autoneg is currently in use or not. Signed-off-by: Alexandre Messier Acked-by: Joe Hershberger --- drivers/net/phy/phy.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c index 1d8eed5..10a7b30 100644 --- a/drivers/net/phy/phy.c +++ b/drivers/net/phy/phy.c @@ -223,7 +223,8 @@ int genphy_update_link(struct phy_device *phydev) if (phydev->link && mii_reg & BMSR_LSTATUS) return 0; - if ((mii_reg & BMSR_ANEGCAPABLE) && !(mii_reg & BMSR_ANEGCOMPLETE)) { + if ((phydev->autoneg == AUTONEG_ENABLE) && + !(mii_reg & BMSR_ANEGCOMPLETE)) { int i = 0; printf("%s Waiting for PHY auto negotiation to complete", @@ -279,7 +280,7 @@ int genphy_parse_link(struct phy_device *phydev) int mii_reg = phy_read(phydev, MDIO_DEVAD_NONE, MII_BMSR); /* We're using autonegotiation */ - if (phydev->supported & SUPPORTED_Autoneg) { + if (phydev->autoneg == AUTONEG_ENABLE) { u32 lpa = 0; int gblpa = 0; u32 estatus = 0;