Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2253298imj; Mon, 18 Feb 2019 02:46:27 -0800 (PST) X-Google-Smtp-Source: AHgI3IakTaLkCnH365GfTa64uhO2wJIqqP31/9PUhAOCjokzR7zsnUleSWvv7V5gM9V0zd4AyRND X-Received: by 2002:a62:1e82:: with SMTP id e124mr14169750pfe.258.1550486787537; Mon, 18 Feb 2019 02:46:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550486787; cv=none; d=google.com; s=arc-20160816; b=G2g35fkatDaIMdaVHe3rsbruEmLB1Drp2yZBtYTLABkliDpe4zhDsaddq07Y9ICKf0 tsugnGr+Eg4jxFm77lQWfJcZjxblXOm7TiZZzLCqow9d20aI7Qdm2MnxUlGDanCzDrAk E+G6WoXHNNK/dX04/uDs26truUaAUJpfiZ1T3OjTzlS1Iw4NJgLvJ/8BqzKHe7DOn33D ZKbJn8HYP14DiE294L/Nzl/0GCx2jwkSTrBLuV5w8vZDqsm9YnbpS23LOGBvJL6jFEQP /wYmhmpaG7GTN9/xr+n+ZFpvihHZLjZey+L3OSEDsyP0fcSbFgY+XpHHUycRdciJuSkX Zimw== 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=/DKlYEmqXPTI3lo8snMiKtkaeLmKNXUC2wyCN6A2wsI=; b=DdfuHeCXCQJrJ7ghJEnL+z8pyNcw4WbnzDdmn1YoYvEiXUMB7TJPIli/ufkRyv+5pH WJIUuubwKvyyDGetqCZnvHOVyg6UfPoFXU2aWoBt4r8J+r31bDPIqq1jbOqtXj++GQ1r M+4SkncVHRb907z3KkomM5PUemG/wbu28pwOOgs5AX1v6+6gHx1YVqeo9hPFMuQDcibD Jd1sUr7xN++lbbc6DIgM/bDbGSqCnkVnv84YGp4ExE9KkQGij4cSosaq70cpzkge6dQy kvYQ9G9osAPN/6A92UVzAn52o7A/MNUelxyhbrjc5APh60OtdFab9iL9nNijtZ6YdN1U A9aw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=gIoLm4bB; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d72si12009021pfm.284.2019.02.18.02.46.11; Mon, 18 Feb 2019 02:46:27 -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=pass header.i=@kernel.org header.s=default header.b=gIoLm4bB; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728258AbfBRKpt (ORCPT + 99 others); Mon, 18 Feb 2019 05:45:49 -0500 Received: from mail.kernel.org ([198.145.29.99]:47248 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729842AbfBRKps (ORCPT ); Mon, 18 Feb 2019 05:45:48 -0500 Received: from localhost (unknown [106.200.226.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3FA912147A; Mon, 18 Feb 2019 10:45:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1550486748; bh=GFZVWA3DUAPaviHEMyhsZNaqoPwYPRa4vK8mDF19qPo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=gIoLm4bBWbpwl98mlyU+HV8t1ZxqCG+2/6h1Ue2028EOJNUu0B9Wu5ox841rvXxpp A4emtnTvJXVz/AC/Lu7tgufLZWYpbF2vOF5XOFwVIR9G+JAmfbKo5a5BQDxEUjiVmi aNYPReDdYgEbVqbzqJmcjb/j6J59t89OcmDClFRQ= Date: Mon, 18 Feb 2019 16:15:39 +0530 From: Vinod Koul To: Andrew Lunn Cc: Michal =?utf-8?B?Vm9rw6HEjQ==?= , "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: <20190218104539.GL21884@vkoul-mobl> References: <0c7428dc-736e-c5c4-13e7-b42052c60cd7@ysoft.com> <20190215152356.GP708@lunn.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20190215152356.GP708@lunn.ch> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 15-02-19, 16:23, Andrew Lunn wrote: > 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. In the hindsight I should not have removed the comment, let me ressurect that as well as add handling of the RGMII modes... Please do test Thanks -- ~Vinod