Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp891528imj; Fri, 15 Feb 2019 08:29:00 -0800 (PST) X-Google-Smtp-Source: AHgI3IZ4RzEt3leeewCAr27OavRiY15AdkrPnALRhGuwFTXI8j0Sg1llIb2gHMd7DB0wEX0Kg6iG X-Received: by 2002:a65:6242:: with SMTP id q2mr6200758pgv.245.1550248140281; Fri, 15 Feb 2019 08:29:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550248140; cv=none; d=google.com; s=arc-20160816; b=XvgV+m394jKN/nfJTcESOmNDvDOneZurIZgF55mBw3WRitsHCUQAIGOSzx3LFBIMQd LuiEVdiF//uViUJgpDtiHuD3WO5aE8EgyZ1iuhbhonQw3l1b+9KXwpNaaLNfWKQM0MAF vXZRGJEsmsDCSl2jRtYtyQbS/8KOBqD1tmVCr39UkelHfPAv5LHi5Qk6YopWJXNLMf4Q ChAc00cxHrmEffjQYfPe+fcfZnWouBXrt1rVpAUAbsdskYaT+N9kyoM8ZmJUWxYiMvbX XwhSRUCRQMEqqSnp/RuRcYPWqIq1etueZk/gkCv/ZpzVpxu6+3slOEKudeoJM9Ri5sE2 T4vA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=zleyHMTUsHgLyhB3FFf3QLLuYWFs+3Wf02MxpRd1cX4=; b=cx8NrhwvJvIaAUnbpQphM54W0PjgEpcl/ylmihDZcMJoCSXB0ESuMhR74JXyz+k1eB Bgh8NuWaK6iofZQNqjeUXPVgOSmNjZLWn/un4jnKNnCgCFy6ttH9I0KilevcEi1+kjVS aY4tTEHX5Sp722RSGFdCvNsFDNBDgmjUgFX6k8093HSD0alsGya7o8BkDLizQHcfiMte 2I4KQ2xUF2cR1B4kkqwSsw7X6NDIdFw4Hzp6iLRLPEVVQD0KPJU56nR1K3JdL8H517pd br00mJ/S9jV5nIsDL3yKDTdsYLHTmsQ/yhBUkFDqysg5RqVQcO6uolGPohYDqv5hM6OZ mrGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@lunn.ch header.s=20171124 header.b=r2erocUc; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f7si5400496pgo.295.2019.02.15.08.28.44; Fri, 15 Feb 2019 08:29:00 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@lunn.ch header.s=20171124 header.b=r2erocUc; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2395195AbfBOPYB (ORCPT + 99 others); Fri, 15 Feb 2019 10:24:01 -0500 Received: from vps0.lunn.ch ([185.16.172.187]:53902 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726766AbfBOPYB (ORCPT ); Fri, 15 Feb 2019 10:24:01 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Transfer-Encoding:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=zleyHMTUsHgLyhB3FFf3QLLuYWFs+3Wf02MxpRd1cX4=; b=r2erocUcKFFP248L5dweVSJ9JZ FpWjC+twNG17LXwS46PRnw0eRjaxsCq7SU10A56x9o7Ep28uGJvs5ocNrzlvdLolnm1SCbFIZt/4h v/EY/staDhbSF4lZpvaIqNQjNdA+7kSFm9kmaOCeJHAAKq7BJ7Wm6OoKNXPO/a3BWTDo=; Received: from andrew by vps0.lunn.ch with local (Exim 4.89) (envelope-from ) id 1gufLI-0006qy-5s; Fri, 15 Feb 2019 16:23:56 +0100 Date: Fri, 15 Feb 2019 16:23:56 +0100 From: Andrew Lunn To: Michal =?utf-8?B?Vm9rw6HEjQ==?= Cc: Vinod Koul , "David S. Miller" , netdev@vger.kernel.org, "linux-kernel@vger.kernel.org" , Florian Fainelli Subject: Re: [RFC] net: dsa: qca8k: implement rgmii-id mode Message-ID: <20190215152356.GP708@lunn.ch> References: <0c7428dc-736e-c5c4-13e7-b42052c60cd7@ysoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <0c7428dc-736e-c5c4-13e7-b42052c60cd7@ysoft.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 15, 2019 at 04:01:08PM +0100, Michal Vokáč wrote: > Hi, > > networking on my boards [1], which are currently in linux-next, suddently > stopped working. I tracked it down to this commit 5ecdd77c61c8 ("net: dsa: > qca8k: disable delay for RGMII mode") [2]. > > So I think the rgmii-id mode is obviously needed in my case. > I was able to find a couple drivers that read tx/rx-delay or > tx/rx-internal-delay from device tree. Namely: > > drivers/net/ethernet/apm/xgene/xgene_enet_main.c > drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c > drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c > drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c > drivers/net/phy/dp83867.c > > I would appreciate any hints how to add similar function to qca8k driver > if that is the correct way to go. Can I take some of the above mentioned > drivers as a good example for that? How should the binding look like? > > I would expect something like this: > > switch@0 { > compatible = "qca,qca8334"; > reg = <0>; > > switch_ports: ports { > #address-cells = <1>; > #size-cells = <0>; > > ethphy0: port@0 { > reg = <0>; > label = "cpu"; > phy-mode = "rgmii-id"; > qca,tx-delay = <3>; > qca,rx-delay = <3>; > ethernet = <&fec>; > }; Hi Michal Your submission used: + ethphy0: port@0 { + reg = <0>; + label = "cpu"; + phy-mode = "rgmii"; + ethernet = <&fec>; + + fixed-link { + speed = <1000>; + full-duplex; + }; + }; This is good. If you have a fixed-link you can pass a phy-mode. The comment that was removed was: - /* According to the datasheet, RGMII delay is enabled through - * PORT5_PAD_CTRL for all ports, rather than individual port - * registers - */ Is it possible to enable delays per port? Ideally, you want to enable delays for just selected ports. Add another case for PHY_INTERFACE_MODE_RGMII_ID to enable the delays. Andrew