Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp6541020rwb; Wed, 18 Jan 2023 06:31:23 -0800 (PST) X-Google-Smtp-Source: AMrXdXuQT6t0KBwIQglgZyJMKhmyC1cuPPiJHYC1ucnphYVIcJRyPSFqtd6mfhPmn46q4yb4MiPi X-Received: by 2002:aa7:cd69:0:b0:499:bffb:7e58 with SMTP id ca9-20020aa7cd69000000b00499bffb7e58mr19205154edb.20.1674052283281; Wed, 18 Jan 2023 06:31:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674052283; cv=none; d=google.com; s=arc-20160816; b=nOW/smczjF3lhYqu1b06gW8ncaqeQIINUg8Dcsx4ntraRzaQsc/Sx6By3xBxnFCHe7 UsJvskgIzI4Ydro6VvP2KmlzpkdOiVaJOFav3fUEW4yn4UE11bL488o77RnVjcUJ2TZ3 osWnWNBcgdAkANoipe9+/OhuM6f/Tpjc9mAD0V9J2LhpNSxxl9WgvL07GLpD5GdGIVMT PScdDUiZ5RmfoPZhu6Cq2YCSb9lzGA1FpfmQUxvc1clndBOtuwCQiaoKqxXnFgfPXyHH 2vDLUNQKCXUpKRsf62rzpLvqs8q/jg/z+sOFc0WfqOKNuq3rSZZkr0eznlJam68nKqtU F2HQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=2QcbDYHnM4a3YLo7hIdVvZnhWZb4/tSVbe2++CBXB9g=; b=FUJS5xbcQNGBp/N4GO9ng41LRdk4+nEO/V4b+JMJ08wZ1SHdAxLgEiIPV2ewhyj1WD pNdTItrdp6FM7i2srH30pyCEIuxXk79eH3TZAGoRo1YSBtr4+t2ugG5kvhX3SKR6MwNK fM/MUr1nE//Q+irv1Cqod271WbwcM4rBXKIUlIz6YPi6vXyo9+9imCAo4E8V9i14uZw+ cfbFamzC3GOaH0QsssL4N9EwT3aUqRBY+eVZIvUnUCy2y16oSzrBLleJ3B2DrlBDIga0 Nw+eCmqAVjHYS0wo4TxAjArtHumbsAQsxI1n8j86Tn7Rb77QloDwKglj3jW9xTvmcFfl fU9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=SJknLVJB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id go32-20020a1709070da000b0085224016f61si26220706ejc.486.2023.01.18.06.31.11; Wed, 18 Jan 2023 06:31:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=SJknLVJB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230040AbjAROFR (ORCPT + 47 others); Wed, 18 Jan 2023 09:05:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60590 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230516AbjAROEk (ORCPT ); Wed, 18 Jan 2023 09:04:40 -0500 Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D4757C879; Wed, 18 Jan 2023 05:41:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=2QcbDYHnM4a3YLo7hIdVvZnhWZb4/tSVbe2++CBXB9g=; b=SJknLVJBnEys14G+7GP/TIHz5k Y764E0y+eowQj/szyhxYjbR7Y9GV87ccwevhJUOpYwpGXwgg9v28drNZh1OYKrb5cUnNZo0N+sBFc /JZpgphtcqK9xNu3yFA71hxAeGmYXjL12fD8Hc1krI9a4mwD52WTICKXxIGZ7HOpTL8M=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1pI8gR-002RYT-0m; Wed, 18 Jan 2023 14:40:55 +0100 Date: Wed, 18 Jan 2023 14:40:55 +0100 From: Andrew Lunn To: "Frank.Sae" Cc: Peter Geis , Heiner Kallweit , Russell King , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , xiaogang.fan@motor-comm.com, fei.zhang@motor-comm.com, hua.sun@motor-comm.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Subject: Re: [PATCH net-next v1 1/3] dt-bindings: net: Add Motorcomm yt8xxx ethernet phy Driver bindings Message-ID: References: <20230105073024.8390-1-Frank.Sae@motor-comm.com> <20230105073024.8390-2-Frank.Sae@motor-comm.com> <83fd7a69-7e6a-ab93-b05a-4eba8af4d245@motor-comm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <83fd7a69-7e6a-ab93-b05a-4eba8af4d245@motor-comm.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 11, 2023 at 05:20:18PM +0800, Frank.Sae wrote: > Hi Andrew, > > On 2023/1/6 21:55, Andrew Lunn wrote: > >>> Why is this needed? When the MAC driver connects to the PHY, it passes > >>> phy-mode. For RGMII, this is one of: > >> > >>> linux/phy.h: PHY_INTERFACE_MODE_RGMII, > >>> linux/phy.h: PHY_INTERFACE_MODE_RGMII_ID, > >>> linux/phy.h: PHY_INTERFACE_MODE_RGMII_RXID, > >>> linux/phy.h: PHY_INTERFACE_MODE_RGMII_TXID, > >>> > >>> This tells you if you need to add a delay for the RX clock line, the > >>> TX clock line, or both. That is all you need to know for basic RGMII > >>> delays. > >>> > >> > >> This basic delay can be controlled by hardware or the phy-mode which > >> passes from MAC driver. > >> Default value depends on power on strapping, according to the voltage > >> of RXD0 pin (low = 0, turn off; high = 1, turn on). > >> > >> Add this for the case that This basic delay is controlled by hardware, > >> and software don't change this. > > > > You should always do what phy-mode contains. Always. We have had > > problems in the past where a PHY driver ignored the phy-mode, and left > > the PHY however it was strapped. Which worked. But developers put the > > wrong phy-mode value in DT. Then somebody had a board which actually > > required that the DT value really did work, because the strapping was > > wrong. So the driver was fixed to respect the PHY mode, made that > > board work, and broke all the other boards which had the wrong > > phy-mode in DT. > > > > If the user want the driver to leave the mode alone, use the > > strapping, they should use PHY_INTERFACE_MODE_NA. It is not well > > documented, but it is used in a few places. However, i don't recommend > > it. > > > > RX delay = rx-delay-basic (0ns or 1.9ns) + x-delay-additional-ps > (N*150ps, N = 0 ~ 15) > If rx-delay-basic is removed and controlled by phy-mode. > when phy-mode is rgmii-id or rgmii-rxid, RX delay is 1.9ns + N*150ps. > But sometimes 1.9ns is still too big, we just need 0ns + N*150ps. > > For this case, can we do like following ? > rx-internal-delay-ps: > enum: [ 0, 150, 300, 450, 600, 750, 900, 1050, 1200, 1350, 1500, > 1650, 1800, 1900, 1950, 2050, 2100, 2200, 2250, 2350, 2500, 2650, 2800, > 2950, 3100, 3250, 3400, 3550, 3700, 3850, 4000, 4150 ] > default: 0 > rx-internal-delay-ps is 0ns + N*150ps and 1.9ns + N*150ps. > And check whether need rx-delay-basic (1.9ns) by the val of > rx-internal-delay-ps? Please take a look at phy_get_internal_delay() and the drivers which use it. Andrew