From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0DE9DC433F5 for ; Fri, 15 Oct 2021 17:18:08 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C1376600CD for ; Fri, 15 Oct 2021 17:18:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org C1376600CD Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date: Message-ID:From:References:Cc:To:Subject:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=ne8GEIOkLdcUw3BuAZ+IyHxcO2J7CtDFIsDjgY/ZKkU=; b=qSe1/FnG4X/+8Yet39I4lxrkKV bEZWUncvWzi5wkreoPF/S8hgnFpGPMHdekhNZUwq6pM+fWPYuGOr6/Id0frOYmyrB4ZyNkn0HQbOh JZepWJt4qcLalmaBAh4mpq5TLqk5qh0Z3ahRbsxq8x4RnTz8ElZmPxrDMrBsOFjlBm1qlSfq299B2 rn8zKnAvB04Fjbkq7vqZdUi6dXeBgNV6/24UeitWqEezR4kUxnz+BLk3TltLnb491kMhvXsB2mzcF kJK/mM5hGB6KU8Wf/+eD4t0ctXCLJ6k0cfTkDQTlJoZHFR28BxuBWXdiNlF1IFBnvW1MnfbSvF+CU Tsitb/Ig==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mbQoR-008GzO-Ce; Fri, 15 Oct 2021 17:16:08 +0000 Received: from mail-pg1-x535.google.com ([2607:f8b0:4864:20::535]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mbQoI-008Gxg-5C for linux-arm-kernel@lists.infradead.org; Fri, 15 Oct 2021 17:15:59 +0000 Received: by mail-pg1-x535.google.com with SMTP id 75so9184317pga.3 for ; Fri, 15 Oct 2021 10:15:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=WBU+852C24LCvIYpivfs9O8LFGGPFOo7ZH8BtmCdNC4=; b=TGfr9UStHYoJqjhC96U1rii6CH1JoT64eerkCrevRB1+VHlvfdxYw+8k5YsPgefD12 /TUetV2v90RArPFFuGLnBJhmQO0NgmWGz9GVNWDpTleRdoVEos9skunFO9pizdcwAFRB Gz1r7xFlXZgc+/WUTiyvQ5E7sGUwrYY7XJDB7bN08DQigYuXipQD8BLHQfASkybG84bJ yAi3sQmD+V6h2bHSc+PB9DP1PxsEHZ3xr0RcQiXXKJphtJezEefUd/A0pL2JvyG7nNjb Inz5ZBhrcTRXe2xtG9ZnnReUUJ6Q2AjwG3K65OLbDoBUdxisCC5niKKp9QIVZJQs+H0b EqdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=WBU+852C24LCvIYpivfs9O8LFGGPFOo7ZH8BtmCdNC4=; b=6kNSEtJRV6g05a+dtZIcI7NHT3P7s3AD9nJrn/nFqFkGqYcVqJBzziRFJVeC6jKlRu XxsTfTYaikfV5UlfzFBjBPYF//tcfxhh0EA27NUDsZ6aUsHjB2Rprx/lvDiNOmXd0RX/ h0UA1jvTXpi+1uLucP5Vmt7384RyVkl53VlakUeYrEC8gl0NksFxrzFIAojTUnp2eKy5 WdJmnrnLnKEnnhsZdqNLGflyNWC2lTNMOMlF+Aa6RkD15mco17DKq0QRhxXjxl7o/ipG sRogCoC5RM7eWYqAOCTWd0UaP6I06HAhqdCRR9LRKNoYHgAahofzj4vsKc38CNm+NG2Z fgWA== X-Gm-Message-State: AOAM532u72v4wPSxkwzNsZCQgKDgXuUj9Y6JtWfeQQqdHUf0a6+jvwmA HsJQ11hFdG2iZM8uKbU9oxg= X-Google-Smtp-Source: ABdhPJwgNMSm+od/U5t8OTywgAa7TjHYL+xQLgxBtdELzHFcnmEcyqci9dj4evEifJzdqwOhBJjIBQ== X-Received: by 2002:a62:5297:0:b0:3f4:263a:b078 with SMTP id g145-20020a625297000000b003f4263ab078mr12524004pfb.20.1634318157160; Fri, 15 Oct 2021 10:15:57 -0700 (PDT) Received: from [10.67.48.245] ([192.19.223.252]) by smtp.googlemail.com with ESMTPSA id bb12sm1837350pjb.0.2021.10.15.10.15.48 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 15 Oct 2021 10:15:56 -0700 (PDT) Subject: Re: [PATCH net-next 6/6] net: dsa: sja1105: parse {rx,tx}-internal-delay-ps properties for RGMII delays To: Vladimir Oltean , "David S . Miller" , Jakub Kicinski , netdev@vger.kernel.org Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Rob Herring , Shawn Guo , Andrew Lunn , Heiner Kallweit , Russell King , Vivien Didelot , Vladimir Oltean , Prasanna Vengateshan , Ansuel Smith , =?UTF-8?Q?Alvin_=c5=a0ipraga?= References: <20211013222313.3767605-1-vladimir.oltean@nxp.com> <20211013222313.3767605-7-vladimir.oltean@nxp.com> From: Florian Fainelli Message-ID: Date: Fri, 15 Oct 2021 10:15:41 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: <20211013222313.3767605-7-vladimir.oltean@nxp.com> Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211015_101558_269134_C7461FD5 X-CRM114-Status: GOOD ( 23.93 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 10/13/21 3:23 PM, Vladimir Oltean wrote: > This change does not fix any functional issue or address any real life > use case that wasn't possible before. It is just a small step in the > process of standardizing the way in which Ethernet MAC drivers may apply > RGMII delays (traditionally these have been applied by PHYs, with no > clear definition of what to do in the case of a fixed-link). > > The sja1105 driver used to apply MAC-level RGMII delays on the RX data > lines when in fixed-link mode and using a phy-mode of "rgmii-rxid" or > "rgmii-id" and on the TX data lines when using "rgmii-txid" or "rgmii-id". > But the standard definitions don't say anything about behaving > differently when the port is in fixed-link vs when it isn't, and the new > device tree bindings are about having a way of applying the delays in a > way that is independent of the phy-mode and of the fixed-link property. > > When the {rx,tx}-internal-delay-ps properties are present, use them, > otherwise fall back to the old behavior and warn. > > One other thing to note is that the SJA1105 hardware applies a delay > value in degrees rather than in picoseconds (the delay in ps changes > depending on the frequency of the RGMII clock - 125 MHz at 1G, 25 MHz at > 100M, 2.5MHz at 10M). I assume that is fine, we calculate the phase > shift of the internal delay lines assuming that the device tree meant > gigabit, and we let the hardware scale those according to the link speed. > > Link: https://patchwork.kernel.org/project/netdevbpf/patch/20210723173108.459770-6-prasanna.vengateshan@microchip.com/ > Link: https://patchwork.ozlabs.org/project/netdev/patch/20200616074955.GA9092@laureti-dev/#2461123 > Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli FWIW, this is definitively a step in the right direction, and this is a good way to deal with the phy-mode RGMII mess that has plagued us, thanks! -- Florian _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel