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=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no 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 5C60EC433E5 for ; Fri, 10 Jul 2020 22:55:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3F1A5206E2 for ; Fri, 10 Jul 2020 22:55:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726772AbgGJWzE (ORCPT ); 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