Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp361133ybh; Sat, 18 Jul 2020 06:21:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyIltjt0tLbHVtwf4U2wg+c/y0K9e0gkUGo5kIAQRsTGp67p9ebAhTHCNGnQBZjldwayS36 X-Received: by 2002:a17:906:3e54:: with SMTP id t20mr12585795eji.471.1595078483928; Sat, 18 Jul 2020 06:21:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595078483; cv=none; d=google.com; s=arc-20160816; b=t1yOtnjl7eB8xJjeth+xJ3G+/UX3NWqqNr3hny/eUH37Wvpj+4l2i6L5azfLY3WD2C D9l6CweB+7AhgDS6kgOrJCLupkiPrtv3PzBKTk1BUkhAKzw0LbtDIFkFXaxEVDEWTlt2 FpnZ3RQT851rqRVTrNiQzqTK6SF9I2U57pLc2o/IgNub+trC93gCMfAXgTxhtZEH/s1a Zff5cqnxvH1QwydGLH/qOIVoJnncqSzR/YK7EasSTSn/qZBeDl34xIXRG7+6dX68jNaT ALSCsO1wUPpO10b2yyVnm4mppeo25T9mMFhxMlc9BbzlEZBW4YNg3p5NCZydwv7flJyT jWGg== 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-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=u1Ta43l8ivno0FCtWUhrqwGXsKGzaaP+vzxnn7dCRs0=; b=Ozh8ESHGhm1zpwrOnD5kmtnuDrkJsikKwAS9Xa8DHgLruPh71orbosDla30P621c8J 0tQpyoWvYYTA4kTH2f0864VyVAvZccGHotcm2fTLPQ4cJgzW3HnmCwO4LILUSFykh0DR gQrI53if/v5sYkKVOEYRuPch7vDwzNVoSwtaG6FidaWcwIwcoJ1HPiLY3C703olkLfrM sFmFpLmraP5BeQpJcQ0y2FS8hu191VRN4e2rkA/MV1kKbkf3X/WTL0iNSkoII5SAVPkf zlNb4GGH33ZGbAj7lentmwC1TTVtCpYMvP4DlloJefqshrdgPwSgat0TLVZ8R5yd/HjU qFnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=hraSxEa8; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j18si7534529eja.217.2020.07.18.06.21.00; Sat, 18 Jul 2020 06:21:23 -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 (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=hraSxEa8; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727037AbgGRNUW (ORCPT + 99 others); Sat, 18 Jul 2020 09:20:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56662 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726566AbgGRNUW (ORCPT ); Sat, 18 Jul 2020 09:20:22 -0400 Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [IPv6:2001:4d48:ad52:32c8:5054:ff:fe00:142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 05149C0619D2; Sat, 18 Jul 2020 06:20:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: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=u1Ta43l8ivno0FCtWUhrqwGXsKGzaaP+vzxnn7dCRs0=; b=hraSxEa8sSRapBAnEdTMHrFww Ws8wbtC3pEWdiPCtvVN0dWA7gC8fH8K68gMZm2aBwDTQ5MLzW6PvXrytg2JhLfYosQs/XtjMQDNL/ om5EXahWcp7QwGUyvypqKNWgIhLEmxqjaVi+6vkHizFSWB4LCzL43ge1Hlr0AQvd4TBBqcGvoDsfe duVMfvA2fCgIBQp/ZnN638bEdngPfn/rKugJasNr8X8Mw1me/J/PBHwly1Y7PCdQ0HBmEvSrnSx+K fxva4v0RRLfMFh/UW8/WjxlHNtdT+1KCfUCT6Jrph84E3ik03Qg5Qjv3p0qjdadO2soOA0mda5ffC 2v1aC27bw==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:41078) by pandora.armlinux.org.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jwmlD-0001bu-P8; Sat, 18 Jul 2020 14:20:15 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.92) (envelope-from ) id 1jwml9-0002yE-BN; Sat, 18 Jul 2020 14:20:11 +0100 Date: Sat, 18 Jul 2020 14:20:11 +0100 From: Russell King - ARM Linux admin To: John Crispin Cc: Matthew Hagan , Jakub Kicinski , Andrew Lunn , Vivien Didelot , Florian Fainelli , "David S. Miller" , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Jonathan McDowell , Rob Herring , devicetree@vger.kernel.org Subject: Re: [PATCH 2/2] dt-bindings: net: dsa: qca8k: Add PORT0_PAD_CTRL properties Message-ID: <20200718132011.GQ1551@shell.armlinux.org.uk> References: <2e1776f997441792a44cd35a16f1e69f848816ce.1594668793.git.mnhagan88@gmail.com> <20200716150925.0f3e01b8@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> <53851852-0efe-722e-0254-8652cdfea8fc@phrozen.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <53851852-0efe-722e-0254-8652cdfea8fc@phrozen.org> 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 Fri, Jul 17, 2020 at 10:44:19PM +0200, John Crispin wrote: > in regards to the sgmii clk skew. I never understood the electrics fully I > am afraid, but without the patch it simply does not work. my eletcric foo is > unfortunately is not sufficient to understand the "whys" I am afraid. Do you happen to know what frequency the clock is? Is it 1.25GHz or 625MHz? It sounds like it may be 1.25GHz if the edge is important. If the clock is 1.25GHz, the "why" is because of hazards (it has nothing to do with delays in RGMII being propagated to SGMII). Quite simply, a flip-flop suffers from metastability if the clock and data inputs change at about the same time. Amongst the parametrics of flip-flops will be a data setup time, and a data hold time, referenced to the clock signal. If the data changes within the setup and hold times of the clock changing, then the output of the flip-flop is unpredictable - it can latch a logic 1 or a logic 0, or oscillate between the two until settling on one state. So, if data is clocked out on the rising edge of a clock signal, and clocked in on the rising edge of a clock signal - and the data and clock edges arrive within the setup and hold times at the flip-flop that is clocking the data in, there is a metastability hazard, and the data bit that is latched is unpredictable. One way to solve this is to clock data out on one edge, and clock data in on the opposite edge - this is used on buses such as SPI. Other buses such as I2C define minimum separation between transitions between the SDA and SCL signals. These solutions don't work with RGMII - the RGMII TXC clocks data on both edges. The only solution there is to ensure a delay is introduced between the data and clock changes seen at the receiver - which can be done by introducing delays at the transmitter or at the receiver, or by serpentine routing of the traces to induce delays to separate the clock and data transitions sufficiently to avoid metastability. If the clock is 625MHz (as with some Marvell devices for SGMII) then both clock edges are used, and both edges are used just like RGMII. Therefore, the same considerations as RGMII apply there to ensure that the data setup and hold times are not violated. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!