Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp908850ybt; Fri, 10 Jul 2020 15:55:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzP+3X15A4C2BIx4le6LMAe7Ka8DZ73LyHOL3BaELy/flGRjeQ+TrJrZYC9OzOHWu6dUrs4 X-Received: by 2002:a17:906:ca56:: with SMTP id jx22mr62297879ejb.494.1594421752775; Fri, 10 Jul 2020 15:55:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594421752; cv=none; d=google.com; s=arc-20160816; b=dBh6yZCYnptOP4jmEm7rDfy03zBQl6qfo7uM4EvAX2CzbgFr/b5Uhgt7w/SMWMmD1T 0TXIHeB3eou8XgxGHWPLxHVC//TrnYnFEtobG4paC2znFjoGHicqLM7xySsykcZno6HS iQRszs1CbokpTuMiH9RW+85A9t5M1AZ+jq/BK4JszpX0HWYIJwH5mxYWLPXfDwLIo9lR eYBoBWJCqOyUh6GQxs+cotGQe8kSSx6S6KqGLZ/ZCHy4Ni+iigElsfF3578sfwEF8HBC i7BIXAj29dtmqdko9JK/EPELzJfV7MB2yEI/RkuUzvws+vccaWqEQp7OQIWALLlCRsha nQeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=8vbN33CKiH9QPWVurCFhLVdSQNSyEJaBJWAhuyj8SpY=; b=MOv7frY59VAbZdBJ8xB5G0GKk+t9h3BPHiAaOtij9uTXDPqC1d5Sh7FtHdKzTs52bd 2OFkojjADv5b4WoJAROsDrCtfOxpCDusZhQeZgvFGP6BelOaE7kf8yTDMNGTsTjQAT47 1PmlRGNY8I6g2TUN08Ghxziu0gNZOoIRDDpS97EsiMXMFKnPPVbaQwPlK20hyy+lxC1r cxiHK/o4g2F0aaO5s5RdGZZcieEk/Q4qjcs5Mq8jIXonF7Hx8LTnokmDMunotzd37Hzb mHqCkJwqM1h1/svhnIZIZZMwyIP+d2bvjk41o57ZoXHiNFPGLZ9uRkJzbSxT0Jv632vX UDYA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g5si4808288ejx.63.2020.07.10.15.55.29; Fri, 10 Jul 2020 15:55:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726762AbgGJWzE (ORCPT + 99 others); Fri, 10 Jul 2020 18:55:04 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:58166 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726510AbgGJWzD (ORCPT ); Fri, 10 Jul 2020 18:55:03 -0400 Received: from andrew by vps0.lunn.ch with local (Exim 4.94) (envelope-from ) id 1ju1uv-004Xkc-AU; Sat, 11 Jul 2020 00:54:53 +0200 Date: Sat, 11 Jul 2020 00:54:53 +0200 From: Andrew Lunn To: Alexandre Belloni Cc: Oleksij Rempel , Florian Fainelli , Heiner Kallweit , David Jander , "David S. Miller" , kernel@pengutronix.de, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, Philippe Schenker , Russell King Subject: Re: [PATCH net-next v3] net: phy: micrel: add phy-mode support for the KSZ9031 PHY Message-ID: <20200710225453.GK1014141@lunn.ch> References: <20200422072137.8517-1-o.rempel@pengutronix.de> <20200710223610.GC3759@piout.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200710223610.GC3759@piout.net> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Jul 11, 2020 at 12:36:10AM +0200, Alexandre Belloni wrote: > Hi Oleksij, > > This patch breaks Ethernet on the sama5d3 Xplained and I have not been > able to unbreak it. Hi Alexandre macb0: ethernet@f0028000 { phy-mode = "rgmii"; #address-cells = <1>; #size-cells = <0>; status = "okay"; ethernet-phy@7 { reg = <0x7>; }; }; So DT says it wants rgmii. How are the delays being added? Could the bootloader be configuring the PHY into rgmii-id mode, which is now getting cleared? Or by strapping of pins on the PHY? Also, looking at macb_main.c is seen: if (!(bp->caps & MACB_CAPS_USRIO_DISABLED)) { val = 0; if (bp->phy_interface == PHY_INTERFACE_MODE_RGMII) val = GEM_BIT(RGMII); else if (bp->phy_interface == PHY_INTERFACE_MODE_RMII && (bp->caps & MACB_CAPS_USRIO_DEFAULT_IS_MII_GMII)) val = MACB_BIT(RMII); else if (!(bp->caps & MACB_CAPS_USRIO_DEFAULT_IS_MII_GMII)) val = MACB_BIT(MII); if (bp->caps & MACB_CAPS_USRIO_HAS_CLKEN) val |= MACB_BIT(CLKEN); macb_or_gem_writel(bp, USRIO, val); } I don't know if this applies for your hardware, but if you tried fixing the PHY by setting phy-mode to "rgmii-id", it could be macb then did not set GEM_BIT(RGMII) and so broken even more? Rather than bp->phy_interface == PHY_INTERFACE_MODE_RGMII, phy_interface_mode_is_rgmii() might work better. Andrew