From patchwork Fri Aug 2 17:54:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nevo Hed X-Patchwork-Id: 1141344 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=starry.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=starry.com header.i=@starry.com header.b="J1NNYY2h"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 460ZcQ0l49z9s3Z for ; Sat, 3 Aug 2019 03:57:10 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id B5DADC21E1A; Fri, 2 Aug 2019 17:55:58 +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=T_DKIM_INVALID 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 54457C21DED; Fri, 2 Aug 2019 17:55:17 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 936C5C21D8E; Fri, 2 Aug 2019 17:54:58 +0000 (UTC) Received: from mail-qt1-f195.google.com (mail-qt1-f195.google.com [209.85.160.195]) by lists.denx.de (Postfix) with ESMTPS id 494A0C21DDC for ; Fri, 2 Aug 2019 17:54:55 +0000 (UTC) Received: by mail-qt1-f195.google.com with SMTP id h18so74790587qtm.9 for ; Fri, 02 Aug 2019 10:54:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=starry.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=7Aj26SyMZj+m338k2r1+s1oRL6hBYuPdY4Ja4wbJNE4=; b=J1NNYY2hZ2J34uFCKuVS7W/QoowRDwpTQ116j/SeID3hHG7z532nUUbz83x3n5FQ22 XrLsu5LYm6q1U2s7tkjShOmyAzGA7XhEblSpsQXMbX+TJAu+XonSHfTH43hVcgTRdeDV 6ICdzR/EYgqF+JeG4oGwZi1zyeD0TyXiuCUPY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=7Aj26SyMZj+m338k2r1+s1oRL6hBYuPdY4Ja4wbJNE4=; b=H5pJsHEPZl1vv1tDaRT51ock/emhJcuPbYOvAQYdJupBpdCRjPKY8Nd751b+MhgpC7 N7zOjYO0Aav892oy0sStHf/0LpyZm3r/88Fl834Nkg2A2YgPOZF7jFlR9ajRLUJy/zeY SW2RWri/brqCpt3pBpEi4LCYSHR2qnZn36ZiYNP8oM/MfU+526NcuDr9dQhIDd2tuUxw f8M4mBsFec8tOEI9dyQIqxxERsmJoREOmjJOhQzqSSS91USAD5JTLXWLQhlBgnahbNV5 spU1AkUo/LmoYppDwLyRnmCpm19KPlP+RPsWQiOZMLUxhUu7yJb+gkPe1VP8NQmnRWuq UDcA== X-Gm-Message-State: APjAAAVycFwd1P3lwABjEsvj49+r3fE7r+fdGi20V/aBT8ftAqK8VSxf BWj/32viFNzCaxWkGgo467K3ig== X-Google-Smtp-Source: APXvYqwYwrMRXwKikea05bvkB6h4hvUu/7XAJkDF0PsJwVsAjzia3R3Q7XMgGlDww5GODUItvJn0RA== X-Received: by 2002:ac8:1a3c:: with SMTP id v57mr95566874qtj.339.1564768494248; Fri, 02 Aug 2019 10:54:54 -0700 (PDT) Received: from nhed-lt1 (205-201-16-55.starry-inc.net. [205.201.16.55]) by smtp.gmail.com with ESMTPSA id p23sm29790438qkm.55.2019.08.02.10.54.53 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 02 Aug 2019 10:54:53 -0700 (PDT) From: nhed+uboot@starry.com To: u-boot@lists.denx.de Date: Fri, 2 Aug 2019 13:54:31 -0400 Message-Id: <20190802175435.10441-4-nhed+uboot@starry.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190802175435.10441-1-nhed+uboot@starry.com> References: <20190802175435.10441-1-nhed+uboot@starry.com> MIME-Version: 1.0 Cc: make@marvell.com, Grzegorz Jaszczyk , Nevo Hed Subject: [U-Boot] [PATCH 3/7] net: mvpp2: mark phy as invalid in case of missing appropriate driver 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: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" From: Grzegorz Jaszczyk If the phy doesn't match with any existing u-boot drivers the phy framework will connect it to generic one which uid == 0xffffffff. In this case act as if the phy wouldn't be declared in dts. Otherwise in case of 3310 (for which the driver doesn't exist) the link will be marked as always down. Removing phy entry from dts in case of 3310 is not good option because it is required for the phy_fw_down procedure. This patch fixes the issue with the link always down on MCBIN board. Signed-off-by: Grzegorz Jaszczyk Reviewed-by: Igal Liberman Tested-by: Igal Liberman Signed-off-by: Nevo Hed --- drivers/net/mvpp2.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/drivers/net/mvpp2.c b/drivers/net/mvpp2.c index b6dfed5c54..fae7090121 100644 --- a/drivers/net/mvpp2.c +++ b/drivers/net/mvpp2.c @@ -4484,6 +4484,27 @@ static void mvpp2_phy_connect(struct udevice *dev, struct mvpp2_port *port) if (!port->init || port->link == 0) { phy_dev = phy_connect(port->bus, port->phyaddr, dev, port->phy_interface); + + /* If the phy doesn't match with any existing u-boot drivers the + * phy framework will connect it to generic one which + * uid == 0xffffffff. In this case act as if the phy wouldn't be + * declared in dts. Otherwise in case of 3310 (for which the + * driver doesn't exist) the link will not be correctly + * detected. Removing phy entry from dts in case of 3310 is not + * an option because it is required for the phy_fw_down + * procedure. + */ + if (phy_dev->drv->uid == 0xffffffff) {/* Generic phy */ + netdev_warn(port->dev, + "Marking phy as invalid, link will not be checked\n"); + /* set phy_addr to invalid value */ + port->phyaddr = PHY_MAX_ADDR; + mvpp2_egress_enable(port); + mvpp2_ingress_enable(port); + + return; + } + port->phy_dev = phy_dev; if (!phy_dev) { netdev_err(port->dev, "cannot connect to phy\n");