Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp924873ybt; Fri, 10 Jul 2020 16:25:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzvkTajKS0TZyw4KhgYGwNhQeWHKUwlN4W4CnKfYRliGaQOTaAjpJUfwhlPbiO4gsVW2/zy X-Received: by 2002:a17:906:2b12:: with SMTP id a18mr62302155ejg.186.1594423550219; Fri, 10 Jul 2020 16:25:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594423550; cv=none; d=google.com; s=arc-20160816; b=IJIeKlA9KCHUVP6w9AcqQGx5rgsQbRGLJ72BZoCB1h+onlFT5BQAR0FSfMxW+1HNFk uFdJpJY1XQmidH4zxs9it83pb2LNfSEsJaRI/z0T+5c1aR20yJw18cP1jphgaGS8x8BO HGbZDQO0xQiNhb4AK1yTxRDMTVacFyNO3Cwvy++jOvidv0KbTtJiCmWbIxqB1dnTXurg VsBCuH72psfSBc9G7ftVnej0/AGfLlinGBqkxVO4lwy92zy53oU7/HFo00WHGsJcW8fI hE232JRgbcenHOBust/W5d0imYszuLdTjm092xX8jrwFgNygG0zTvjjUy9mh79VUrgGE tRvw== 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=mbMKlqBn118KHYyMAclP1/o3MRSSOznFIEn6BMOcQ5k=; b=O3smN1DGfsGJmsCYuIx1H04ubk+zsMmcbq7clIfVg9adkuZoO4ZwcQjp8aB0k4svPK gylBKnGy9BV5/VP7Fhtnce+mqFb5Sylcf3Tn235sZl3g17bnbe8YxqU8gqzd+otV9ikj bxRzWAtkmQDJMhRZ9XVjufcUEpjwCWOu0z/amwqN37ZWiUmiufIgi3P8sDX7I9YyGYxK VCgM2+PvcSlE8U1PgZa6NxUQE9BDSGeTTuNzMi3bcV7hPBOQHmR8Hp9G+uM7hGHNLkiK 0GtMtnnqbN/6xMZyELHRG9AdH8RduFe0JZDvmjmplafohmobJxEsf9aTqakMHJ7ZJl4d WZKw== 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 mh4si4665148ejb.339.2020.07.10.16.25.25; Fri, 10 Jul 2020 16:25:50 -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 S1726645AbgGJXZV (ORCPT + 99 others); Fri, 10 Jul 2020 19:25:21 -0400 Received: from relay3-d.mail.gandi.net ([217.70.183.195]:45877 "EHLO relay3-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726465AbgGJXZV (ORCPT ); Fri, 10 Jul 2020 19:25:21 -0400 X-Originating-IP: 90.65.108.121 Received: from localhost (lfbn-lyo-1-1676-121.w90-65.abo.wanadoo.fr [90.65.108.121]) (Authenticated sender: alexandre.belloni@bootlin.com) by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id A241060002; Fri, 10 Jul 2020 23:25:16 +0000 (UTC) Date: Sat, 11 Jul 2020 01:25:16 +0200 From: Alexandre Belloni To: Andrew Lunn 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: <20200710232516.GE3759@piout.net> References: <20200422072137.8517-1-o.rempel@pengutronix.de> <20200710223610.GC3759@piout.net> <20200710225453.GK1014141@lunn.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200710225453.GK1014141@lunn.ch> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/07/2020 00:54:53+0200, Andrew Lunn wrote: > 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? > This is exactly what happens. I'll send patches. Thanks Andrew! > Rather than bp->phy_interface == PHY_INTERFACE_MODE_RGMII, > phy_interface_mode_is_rgmii() might work better. -- Alexandre Belloni, Bootlin Embedded Linux and Kernel engineering https://bootlin.com