Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp632260pxj; Fri, 14 May 2021 11:36:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJywy5eL9ezoZcmMvSk1WsrjON2n07oTJH/Y1R9tfz07J9DQXMTLiE9s6VZxR5/fePu6C3i2 X-Received: by 2002:a05:6e02:ed2:: with SMTP id i18mr1720722ilk.22.1621017397319; Fri, 14 May 2021 11:36:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621017397; cv=none; d=google.com; s=arc-20160816; b=TKEvug+SKlRL8/pOzajvF9VyDU1W5JVbiGGJI1sijS862Zg7hDBjviWY+uEJeAk9QQ sBUdl6E9IoVnUUqwm+zxbCoRN+Skb4CQEYS8Lr3P7aEimCDGPB5tlxzvEtnWWMuf8Jxu nyywpgyIwRRL4upwn6BfLUmi6SVBnUzNsYcw41Llod6HzaKDVsijHnkSu1TTx6j8cuTJ E4RCAjL7Dl5lxMpC2eXqe1Sh8WxxsMURe7bslpqHigdkk29lYwKVbDL+5PR5Q2iDikic VXcsR0O1nfqEj/FcxtX6SJ/0BtkZCMieEuexnjXfakFqxNlwbg5e7mlxVAphBF1IQgF0 kFAQ== 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=bKrIdux+WQDhbsuj/L6O78Gu9Fpi7TdC9aFvwWVLPns=; b=Cw8o7C1gTetFpVXKiYOxqduJKLxzOk1Lv1o1eqGpUQRoDpB2inhfIGwW1By9CqPoQe ZJND8G6jUWFX5NcRqvONSW6hZ+10oS2iVGy4wVbzxIjTRhkywQP/Qqzfs+n/ZY9K3S7L w2jHlgGF2gPw79l6A4cpwMXv1uSG8z52qtgWsIl1AmQmVprxEovlJTV6apIE4aL9u8I6 miI8qu0mGWofynevX0Gj1dMSTuucvnbD7G2BsDPci4B7pS2Bj2k19QGT45BIj9ibPcGZ zgUStP2g2MuoDJ2NIkjZ5hQiFKaGfgJfvMPwkuSI20gqKj3JRDNDvacl/cmLAZ8t6D2A YmFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@lunn.ch header.s=20171124 header.b=Uu7s+m0w; 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 v3si8099849ilq.36.2021.05.14.11.36.24; Fri, 14 May 2021 11:36:37 -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; dkim=fail header.i=@lunn.ch header.s=20171124 header.b=Uu7s+m0w; 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 S233952AbhENN0C (ORCPT + 99 others); Fri, 14 May 2021 09:26:02 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:40250 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230075AbhENN0C (ORCPT ); Fri, 14 May 2021 09:26:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding: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=bKrIdux+WQDhbsuj/L6O78Gu9Fpi7TdC9aFvwWVLPns=; b=Uu7s+m0wpC6i6cokaQjN2ujZPy 46SprCmSQxX+gHsLgzdWIUPaC9JeDRtKNZh9U+08/n3Uf2SG6hGMEmCcbC5UHLqBXrzd48DFJ2NaX XzWrdLAk3WP9OOzcX1jfQqypi2sbqw70RFOrOweG/bdCxUOUElNSDsOjni+IxUiSisNM=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1lhXo3-004BmE-AI; Fri, 14 May 2021 15:24:43 +0200 Date: Fri, 14 May 2021 15:24:43 +0200 From: Andrew Lunn To: Peter Geis Cc: Heiner Kallweit , Russell King , "David S . Miller" , Jakub Kicinski , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-rockchip@lists.infradead.org Subject: Re: [PATCH v3] net: phy: add driver for Motorcomm yt8511 phy Message-ID: References: <20210514115826.3025223-1-pgwipeout@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210514115826.3025223-1-pgwipeout@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 14, 2021 at 07:58:26AM -0400, Peter Geis wrote: > Add a driver for the Motorcomm yt8511 phy that will be used in the > production Pine64 rk3566-quartz64 development board. > It supports gigabit transfer speeds, rgmii, and 125mhz clk output. Thanks for adding RGMII support. > +#define PHY_ID_YT8511 0x0000010a No OUI in the PHY ID? Humm, the datasheet says it defaults to zero. That is not very good. This could be a source of problems in the future, if some other manufacture also does not use an OUI. > +/* RX Delay enabled = 1.8ns 1000T, 8ns 10/100T */ > +#define YT8511_DELAY_RX BIT(0) > + > +/* TX Delay is bits 7:4, default 0x5 > + * Delay = 150ps * N - 250ps, Default = 500ps > + */ > +#define YT8511_DELAY_TX (0x5 << 4) > + > + switch (phydev->interface) { > + case PHY_INTERFACE_MODE_RGMII: > + val &= ~(YT8511_DELAY_RX | YT8511_DELAY_TX); > + break; This is not correct. YT8511_DELAY_TX will only mask the 2 bits in 0x5, not all the bits in 7:4. And since the formula is Delay = 150ps * N - 250ps setting N to 0 is not what you want. You probably want N=2, so you end up with 50ps > + case PHY_INTERFACE_MODE_RGMII_ID: > + val |= YT8511_DELAY_RX | YT8511_DELAY_TX; > + break; > + case PHY_INTERFACE_MODE_RGMII_RXID: > + val &= ~(YT8511_DELAY_TX); > + val |= YT8511_DELAY_RX; The delay should be around 2ns. For RX you only have 1.8ns, which is probably good enough. But for TX you have more flexibility. You are setting it to the default of 500ps which is too small. I would suggest 1.85ns, N=14, so it is the same as RX. I also wonder about bits 15:12 of PHY EXT ODH: Delay and driver strength CFG register. Andrew