Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp2758566pxb; Thu, 3 Feb 2022 13:43:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJyBEURML6OEW4TSc1mtLGSAVXadeyEmsPnPaNP/+TzjcD7eBsvBywNYUz/LtBgMvhdGmihc X-Received: by 2002:a17:90b:3e82:: with SMTP id rj2mr15997063pjb.206.1643924580992; Thu, 03 Feb 2022 13:43:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643924580; cv=none; d=google.com; s=arc-20160816; b=H2iW/ItbSgJdsRpm2mxV5k0GOFw2mktGUESEQr5QWmgXRCdDeBs0Bs8PvrD2OH/tG0 XquxrssdQ6wMZglprxuK26m8GShfyyO+pCT2c0g8e3ed57jaQLcOG5xpK6nmaZzasTW9 hF2D3jPQPbMoqzGLNc1t3GrmyaFOjHrJsulC8d50GZcQ4uqPWk41eS6GmjzA0EqG7C8+ 1N/w8/soEuqXTacSk4xX69FI7sAux/oF/5Ny+F3lIZhwKqMfaywrjaiS6gSRSKLKY0MM 4BLi7xJfEOfFyUW3sJ6fgMTDPuOknfSzRg8KRdWRQJ8NXtWTcfg90CxqMkL+ptZlDFtI I3pg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=096Ppq5v8Exvtmmsnsq3gHfM11D+76/nsWqV7r8Kxok=; b=GP+cc2hwh47t7DRALHQDlWwMSX8NdMfW/RNq51tSJDWgBEzNsE0tTcsHfHChRF58gj wsczj9XOQazso3sfQnUl0co4eBBzd3jqWqFqypyOblBtqTF5ibj717H+Wv5zOH+EB8K0 jRGms8Q3Zq+oitXniw311WaF2rThQmgUxicVzvv1HDR0BPbZR+VQjui+3oG2w/Z1H4wz Ar/lp+SWW9QhxJlNCiPEh0/grmkc/q1ETp34TAHrl5Z/3ZzvRh2dWrJM6ijWVXGjndb6 qUxGruciL4y0uAo95+NQAQZOiPVM6HqF9djne0DXLNFRmKNNbkZH0MgsMgU18dsFjRvi ct+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gateworks-com.20210112.gappssmtp.com header.s=20210112 header.b=PnF08dof; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t3si48039pfg.55.2022.02.03.13.42.49; Thu, 03 Feb 2022 13:43:00 -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=@gateworks-com.20210112.gappssmtp.com header.s=20210112 header.b=PnF08dof; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353143AbiBCRyF (ORCPT + 99 others); Thu, 3 Feb 2022 12:54:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49446 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353307AbiBCRxn (ORCPT ); Thu, 3 Feb 2022 12:53:43 -0500 Received: from mail-pj1-x1035.google.com (mail-pj1-x1035.google.com [IPv6:2607:f8b0:4864:20::1035]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2F25FC0613EB for ; Thu, 3 Feb 2022 09:52:15 -0800 (PST) Received: by mail-pj1-x1035.google.com with SMTP id d5so3108618pjk.5 for ; Thu, 03 Feb 2022 09:52:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gateworks-com.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=096Ppq5v8Exvtmmsnsq3gHfM11D+76/nsWqV7r8Kxok=; b=PnF08dofvWXcv72TAexoUaadFvfHBM8r3Otq6zZ7PSRzUn5O8pjTtWm/+PLhONb43g Q+yDjaO6TN3OjkXWGhRp5M/rBD1sFx6hrrZgNDsgTl2k+ceMoGdDhnWgbHpg2Nm9icaP SmBVfJlgPVy+TpIDQlqA+OO4tLp7Y8lko3ZqO7tQZcObZljgGpFo+Ecy2LHhgTe/RE51 /GmiMTuicrN2xN8YkRZxM5XEXKomgXM7Tu+rCpOoV5soDZ1LKeKRUHPPTJVbprKBo+oh 5TwtKsvZV14q2Xh7hyFheLcoyPM+DoZqMJcBpg6RBI/1+dgzPeqvQoINxVnoMl4cD4Sr DA/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=096Ppq5v8Exvtmmsnsq3gHfM11D+76/nsWqV7r8Kxok=; b=D1XehYyczg5xPQEdWzUD2MhyePZRvauwVO56epGZshv4BKhmtjJY2AvQ0zM//SiDo5 XtRp/DdhebUZ/zJmNJ7WUKQIieXToLnJtHQdZQAs/fCQGhX0QiIcX1emloQTXlnXzf97 m40Vnrl9bk9M4EHfuSXobbjL3+VbAda7M9NRnNYiSwY4QP4plu5uGtV7Z/WtN/b9AAUj BTcQ0mum2U9V7sd5/JOHDqNUeIO2fjdwFtj1ZkRxk/TRctY9jN4JuQTQ+RXqSvHV2sTi 22g0Tqj3+21pj+PLLOrL/B8JDLCULjG4uDM/tgz7ayCZtpBawYaXOiBt7slEBR4/HtoT qesw== X-Gm-Message-State: AOAM532kBd6QYyJEfPaRXGGZ51fPig8X6i0kvyYXAr9AbnF+pTcicCu8 tkJH6NF4/izAE8fLhTNYadiMouY1+UVSIcWQDy7CtA== X-Received: by 2002:a17:90b:4a82:: with SMTP id lp2mr15210577pjb.179.1643910734453; Thu, 03 Feb 2022 09:52:14 -0800 (PST) MIME-Version: 1.0 References: <20210421055047.22858-1-ms@dev.tdt.de> In-Reply-To: From: Tim Harvey Date: Thu, 3 Feb 2022 09:52:03 -0800 Message-ID: Subject: Re: [PATCH net v3] net: phy: intel-xway: enable integrated led functions To: Andrew Lunn Cc: Martin Schiller , Hauke Mehrtens , martin.blumenstingl@googlemail.com, Florian Fainelli , hkallweit1@gmail.com, Russell King - ARM Linux , David Miller , kuba@kernel.org, netdev , open list Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 3, 2022 at 8:37 AM Andrew Lunn wrote: > > > Andrew, > > > > I agree with the goal of having PHY drivers and dt-bindings in Linux > > to configure everything but in the case I mention in the other thread > > adding rgmii delay configuration which sets a default if a new dt > > binding is missing is wrong in my opinion as it breaks backward > > compatibility. If a new dt binding is missing then I feel that the > > register fields those bindings act on should not be changed. > > I would like that understand this specific case in more detail. We > have seen a few cases were the DT is broken, yet works. This is often > caused by having a wrong phy-mode, which historically the PHY driver > was ignoring. Then support for honouring the phy-mode was added to the > PHY driver, and all the boards with broken DT files actually break. > > So it could be that is what has happened here. Or it could be the > driver is plan wrong. If i understand correctly, you say it is adding > a default delay of 2ns. That would be correct for a phy-mode of > rgmii-id, but wrong for a phy-mode of rgmii. > > > > LEDs are trickier. There is a slow on going effort to allow PHY LEDs > > > to be configured as standard Linux LEDs. That should result in a DT > > > binding which can be used to configure LEDs from DT. > > > > Can you point me to something I can look at? PHY LED bindings don't at > > all behave like normal LED's as they are blinked internally depending > > on a large set of rules that differ per PHY. > > Yes, this is what is slowing the work done, agreeing on details like > this, and how the user space API would actually work. In the end, i > suspect a subset of LED modes will be supported, covering the common > blink patterns. > > > Completely off topic, but due to the chip shortage we have had to > > redesign many of our boards with different PHY's that now have > > different bindings for RGMII delays so I have to add multiple PHY > > configurations to DT's if I am going to support the use of PHY > > drivers. What is your suggestion there? Using DT overlays I suppose is > > the right approach. > > I would try to only use phy-mode, and avoid all PHY specific tweaks. > So long as the track lengths don't change too much on your redesign, > and are kept about the same length, the standard 2ns delay should > work. > Andrew, The issue is that in an ideal world where all parts adhere to the JEDEC standards 2ns would be correct but that is not reality. In my experience with the small embedded boards I help design and support not about trace lengths as it would take inches to skew 0.5ns but instead differences in setup/hold values for various MAC/PHY parts that are likely not adhering the standards. Some examples from current boards I support: - CN8030 MAC rgmii-rxid with intel-xway GPY111 PHY: we need to configure this for rx_delay=1.5ns and tx_delay=0.5ns - CN8030 MAC rgmii-rxid with dp83867 GPY111 PHY: we need to configure this for rx_delay=2.0ns and tx_delay=2.0ns (as would be expected) - IMX8MM FEC MAC rgmii-id with intel-xway PHY: we need to configure this for rx_delay=2ns and tx_delay=2.5ns - IMX8MM FEC MAC rgmii-id with dp83867 PHY: we need to configure this for rx_delay=2.0ns and tx_delay=2.0ns (as would be expected) The two boards above have identical well matched trace-lengths between the two PHY variant designs so you can see here that the intel-xway GPY111 PHY needs an extra 0.5ps delay to avoid RX errors on the far-off board. I really hate this GPY111 PHY but it's the only PHY we can source currently; it's full of errata and to make things worse the only available pin strapping options are for 0ns or 1.5ns (how is 1.5ns useful?) so we must rely on software configuration. So having the intel-xway PHY driver set the delays to 2.0ns delays in the absence of dt props (vs leaving them untouched) is what bothered me there. The LED blink configuration has much more flexible strapping options which we are able to use until this driver goes and changes them to something else. The way I determine the correct delay values is by looking for MAC RX errors on the RX side and by looking for RX errors on the off-board receiving end (typically via a managed switch). I know of no better way to do this because the timing happens inside the MAC and PHY thus scope measurements don't help here. Best regards, Tim