From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D0AEAC47094 for ; Thu, 10 Jun 2021 05:48:23 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A8ABF613E7 for ; Thu, 10 Jun 2021 05:48:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A8ABF613E7 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 55EA582B71; Thu, 10 Jun 2021 07:48:20 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="ameONyUd"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 0692982CA0; Thu, 10 Jun 2021 07:48:18 +0200 (CEST) Received: from mail-oi1-x233.google.com (mail-oi1-x233.google.com [IPv6:2607:f8b0:4864:20::233]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 4BE1A80C67 for ; Thu, 10 Jun 2021 07:48:15 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=rfried.dev@gmail.com Received: by mail-oi1-x233.google.com with SMTP id a26so862875oie.11 for ; Wed, 09 Jun 2021 22:48:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=j92Nb9Zv9x8o5GHivqUaO+E++t5ahZoe0AUIFqS/19E=; b=ameONyUdcWawNFPS/z8EBHukcN+YSAAe+MvbmU+m3f/QTEYCQZlGQ1PtW/PBuMg1y+ R1FjtiacUwbcatqc6cOPDF+JFWd7zVXDaUDLlFoS0iFCughDDylvjdz6iZAMSImOeJfI hqkgxaXu5Y/WjcHLKB9xHbOVDxI+bBPRnM134CHx2WdYw3zap6xKeBAri50V4wTyClOg IpovB6d3dwYSy5+39KqcsOWDyxp5PtUKR9K0tdsUcvj6IYxSNseDMmG2GhFaHAYfsUAt fRA5HgDn0H1imL+FJR0bm4Ibp/Qcq7upBQ7nWqey7ADblYc/lX4M2FHJQKTJT1ANnRRV tegQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=j92Nb9Zv9x8o5GHivqUaO+E++t5ahZoe0AUIFqS/19E=; b=QsufB4l3C7WTp5mP+6wxvEVWj7emaKp5loJeod6tqMpfaOgegpnSrubVFRHcb16pAz oQmP/wFbWdchp8XkNXx6NBwt7vNJYFeaE34E4DyBC0BBZ6F6jcwKONzyVTpO5jD5Vb0p xqo8wd0SAhYoH3pP/aeuJULKlulTBG6uZx9ah75kXpqW6dftyTlGrEhLiGVjrtWOAZ/7 MD+1GkMAaqTAjW2wVmJZGC2mCU0gltiqKFUQuZfRApKLSMd9hWX0yRo/VclqBv30xAJV TP7k4CLlG/EHm0wV5ivYwrnt0UTH9fQnJ2+IKcImQWehgyLklIyZC40CjccibuV3SCS2 mQSA== X-Gm-Message-State: AOAM530BjP488ESZKQCulG/j1n1hwUpAD0065yfzeZF+NLPx9YtYeJRx /16mOVYdPE7h7hxcjQD0yaze8Us3V3mjhF0fmmw= X-Google-Smtp-Source: ABdhPJyEzbSbhtiFGisGTibAQIxsppjLNPchBGoTKs/eXY9lNXXxsjaWH6JUkoe81ViVen7wagBHnEfpGVsngpabB1c= X-Received: by 2002:aca:407:: with SMTP id 7mr281565oie.22.1623304093923; Wed, 09 Jun 2021 22:48:13 -0700 (PDT) MIME-Version: 1.0 References: <20210603075242.96527-1-xypron.glpk@gmx.de> In-Reply-To: <20210603075242.96527-1-xypron.glpk@gmx.de> From: Ramon Fried Date: Thu, 10 Jun 2021 08:48:02 +0300 Message-ID: Subject: Re: [PATCH 1/1] net: sun8i-emac: fix MDIO frequency To: Heinrich Schuchardt Cc: Joe Hershberger , U-Boot Mailing List , Jagan Teki , Andre Przywara Content-Type: text/plain; charset="UTF-8" X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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" X-Virus-Scanned: clamav-milter 0.102.4 at phobos.denx.de X-Virus-Status: Clean On Thu, Jun 3, 2021 at 10:52 AM Heinrich Schuchardt wrote: > > Commit 4f0278dac56a ("net: sun8i-emac: Lower MDIO frequency") leads to > network failure on the OrangePi PC. > > => dhcp > sun8i_emac_eth_start: Timeout > > According to the commit message the change of the MDIO frequency is only > required for external PHYs. > > Fixes: 4f0278dac56a ("net: sun8i-emac: Lower MDIO frequency") > Signed-off-by: Heinrich Schuchardt > --- > drivers/net/sun8i_emac.c | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > > diff --git a/drivers/net/sun8i_emac.c b/drivers/net/sun8i_emac.c > index 5a1b38bf80..d7553fe163 100644 > --- a/drivers/net/sun8i_emac.c > +++ b/drivers/net/sun8i_emac.c > @@ -211,7 +211,9 @@ static int sun8i_mdio_read(struct mii_dev *bus, int addr, int devad, int reg) > * The EMAC clock is either 200 or 300 MHz, so we need a divider > * of 128 to get the MDIO frequency below the required 2.5 MHz. > */ > - mii_cmd |= MDIO_CMD_MII_CLK_CSR_DIV_128 << MDIO_CMD_MII_CLK_CSR_SHIFT; > + if (!priv->use_internal_phy) > + mii_cmd |= MDIO_CMD_MII_CLK_CSR_DIV_128 << > + MDIO_CMD_MII_CLK_CSR_SHIFT; > > mii_cmd |= MDIO_CMD_MII_BUSY; > > @@ -242,7 +244,9 @@ static int sun8i_mdio_write(struct mii_dev *bus, int addr, int devad, int reg, > * The EMAC clock is either 200 or 300 MHz, so we need a divider > * of 128 to get the MDIO frequency below the required 2.5 MHz. > */ > - mii_cmd |= MDIO_CMD_MII_CLK_CSR_DIV_128 << MDIO_CMD_MII_CLK_CSR_SHIFT; > + if (!priv->use_internal_phy) > + mii_cmd |= MDIO_CMD_MII_CLK_CSR_DIV_128 << > + MDIO_CMD_MII_CLK_CSR_SHIFT; > > mii_cmd |= MDIO_CMD_MII_WRITE; > mii_cmd |= MDIO_CMD_MII_BUSY; > -- > 2.31.0 > Reviewed-by: Ramon Fried