Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp2423487rwl; Fri, 6 Jan 2023 06:19:03 -0800 (PST) X-Google-Smtp-Source: AMrXdXtX+AEcPxFH+q3cVubkZn1kuxGJs1NypU7rvaNZQiPfo659c4+NwQQtxEEAwAgZWqfGSTHZ X-Received: by 2002:aa7:96f9:0:b0:582:7007:3fec with SMTP id i25-20020aa796f9000000b0058270073fecmr19153127pfq.11.1673014742829; Fri, 06 Jan 2023 06:19:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673014742; cv=none; d=google.com; s=arc-20160816; b=wHyPBe3+5IU8+fA3QiUrxDoVTbS/qKSSzVzmixUoqi1jipGI6bW9UVyty643aopWIS ZpB4zeWWOJGBASrDgbRgvPrqI/NO2bvR+ZihRxHSmZUnptpyhBNk3XZprlO7Q9vpYPl/ JO7n2CT5Q2drep2Hr1evAsPV4L1go2tKgUhBobAaMCCO5mh7QSxqB970ryG2q9DW01ID x8FjrNc8opJ7RUVMEeLCK6bD0BQsO1SR4WThNRroXS4H/M78cxye9uOG5OJ9NoZ4gPtp X4TKBPpC8jwjRIZ7OtuM1EhlgX7mSUw5Jx6AMA52C6ShHSyY9jrsB1k+b9RkoshhjHz0 mBVQ== 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=vRe6UFQkbe43pVVwnShYMb3rFh8R0WSwAihI2zUUTrs=; b=fUCzxKfXNEsNK8++9McEKY7z025oQdTWk4JSCARL8aErhO4hyIIy8yADy8MASOJjff /Tf6SBri+tgLZ1HdllthrguPA6PFRCBJol9PiAsjc0Pta9WBq8QJfvCI82YAB/xmeT2l bX4Sro6i3ZtHLzByZ61wpbOgEB2DbqWff4OjMn/ztB9nSHMWdoEXyvfLLu9LXW1uM/pq okEKU2pN3Cr/RLJEcis/yt/lPo4El4Bv57Fsi+1/qnj4i0u6fIwf4GO2zbYzgk/nU0XR b3dn1HTPUdyUYDPS/QMPgN76vZzG9bsChQyBYbJOfR8gdhGbOPFYYDk0oGk7ByRdCzzV D/Vw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=AqhYRzo2; 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 a9-20020a621a09000000b005824fa27f76si1530530pfa.54.2023.01.06.06.18.55; Fri, 06 Jan 2023 06:19:02 -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=AqhYRzo2; 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 S232785AbjAFN4E (ORCPT + 54 others); Fri, 6 Jan 2023 08:56:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45958 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230294AbjAFNz7 (ORCPT ); Fri, 6 Jan 2023 08:55:59 -0500 Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8D116687B1; Fri, 6 Jan 2023 05:55:57 -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=vRe6UFQkbe43pVVwnShYMb3rFh8R0WSwAihI2zUUTrs=; b=AqhYRzo2jKPl5b1J+Wvk545wX7 gphCsR8eivL7VCRo7FBIXzYCTewA86LPyCUY4NUQ8EHvbogTrjy4Kco8PkaCQvBoE08cmN9tF/aRn B0zlcNubhWWpedfwdout3768rEREWgfBgcEemfw2UGNgX1/4efOMnUFjCMQZOy3PB/ls=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1pDnC9-001KzV-SK; Fri, 06 Jan 2023 14:55:41 +0100 Date: Fri, 6 Jan 2023 14:55:41 +0100 From: Andrew Lunn To: Frank 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 > > 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. > >> + motorcomm,tx-delay-fe-ps: > > > > So you can only set the TX delay? What is RX delay set to? Same as 1G? > > I would suggest you call this motorcomm,tx-internal-delay-fe-ps, so > > that it is similar to the standard tx-internal-delay-ps. > > > > TX delay has two type: tx-delay-ge-ps for 1G and tx-delay-fe-ps for 100M. > > RX delay set for 1G and 100M, but it has two type, rx-delay-basic and > rx-delay-additional-ps, RX delay = rx-delay-basic + rx-delay-additional-ps. > > I will rename to tx-internal-delay-fe-ps and tx-internal-delay-ge-ps. So you can set the TX delay for 1G and Fast, but RX delay has a single setting for both 1G and Fast? Have you seen boards what actually need different TX delays like this? Just because the hardware supports something does not mean Linux needs to support it. Unless there is a real need for it. So i would suggest your drop this DT property, and set the Fast delay to the same as the 1G delay. If any board actually requires this in the future, the property can be added then. > > > These two i can see being useful. But everything afterwards seems like > > just copy/paste from vendor SDK for things which the hardware can do, > > but probably nobody ever uses. Do you have a board using any of the > > following properties? > > > > tx-clk-adj-enabled, tx-clk-10-inverted, tx-clk-100-inverted and > tx-clk-1000-inverted is used and tested by Yanhong > Wang. They used yt8531 on > jh7110-starfive-visionfive-v2. This will provide an additional way to > adjust the tx clk delay on yt8531. O.K. So they are used with a real board. Can we reduce this down to tx-clk-inverted? Have you ever seen a board which only needs the invert for one speed and not the others? To me, that would be a very odd design. > sds-tx-amplitude can be tested on my yt8531s board. Does the board break with the default value? Just because you can test it on your RDK does not mean anybody will ever use it. Andrew