Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3291522pxk; Mon, 28 Sep 2020 13:25:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxgWbA93YrvarFXOYKyr2LlutuUisvaKec1RC8k/LzK5wNGnSr7C+nera6SSumTgCibOJF7 X-Received: by 2002:a17:906:6a54:: with SMTP id n20mr485750ejs.401.1601324729058; Mon, 28 Sep 2020 13:25:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601324729; cv=none; d=google.com; s=arc-20160816; b=S9De6ybOyJtaMs7jK1xWrmu7sCNye4v30PzT9hMxj2s0SH4Aiug4NK7/S0ogANLD5a fBku6FyEzQWPPzQhPjrOpnS+uWwLy74zEhMriWC+nvZbmbh7ynJGG+7QZI3mIsdPSUiQ EqEyusCyaFJGem0g3G+GGZUWdj5VyT0M+e5p1QWoINKGgYVzAU7bKtvg228Xv7c2b161 Anlf2hjHrcb3Xny32G5mEPCiTgp7FSKeCPxxqOj8u++FUVw+y58ivriX+rOGMARKNeZw lWCB6dhy/3vh20g2ELn/VgwVeTqFmW0uYMyBJU1QtkR2h+dYfLj6bNj+Gzbqj/TE4yiC eZzA== 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=1J3xfX6mi+yH7vokRWfQjm7Vu2SF03BqzqPZ3nviNoE=; b=uCG4t63huzkKSOqeUOF93IDJhWpsBzqoUEsgK+rvePMvskIH9vx9oxa+g6DUwqmYS6 aoooEb+xUth1FHauRkxN49ufzLsQI8egq2ClBli/d/Kv7yyotY6AmXT0SD9xececeEFE DP23xbpjHCEIhZh9W/Kq21p4ELTaUi3OlezcoopP6C11ixl6g4bJXak8J3wP1ccqEu0f fx+W7AEc8wYB2oSznrymNBKFjHj1Xm5unJ7ziRqTD9vafdvfm6qOkSpLtYY0NF5bg1/p FPoGvOvZGz+gWsC12dkMn4wUNhbzHL3dyLK0tmNYGqQ376LaNgeKRZhvGnFZORAgfPQP uDaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@googlemail.com header.s=20161025 header.b=qcxx8srT; 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=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=googlemail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k13si1322642ejr.21.2020.09.28.13.25.06; Mon, 28 Sep 2020 13:25:29 -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=pass header.i=@googlemail.com header.s=20161025 header.b=qcxx8srT; 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=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=googlemail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726757AbgI1UYF (ORCPT + 99 others); Mon, 28 Sep 2020 16:24:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38422 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726393AbgI1UYE (ORCPT ); Mon, 28 Sep 2020 16:24:04 -0400 Received: from mail-ej1-x643.google.com (mail-ej1-x643.google.com [IPv6:2a00:1450:4864:20::643]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8DFA5C061755; Mon, 28 Sep 2020 13:24:03 -0700 (PDT) Received: by mail-ej1-x643.google.com with SMTP id r7so10866457ejs.11; Mon, 28 Sep 2020 13:24:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=1J3xfX6mi+yH7vokRWfQjm7Vu2SF03BqzqPZ3nviNoE=; b=qcxx8srT7SomaH8XuJ4Kl7Kwksp5hSYaB/IYqbbZl8eINeqiD5PSu86lQ5BkdDBNkS 8rG4BTru6BYE8xCZRH0+lUWWPvgLjyvhz6Ng+xGjnEZpL1lAyQu/SLmWIpRWII4PcE7Q M303xrS51KomeLbXTDGh+T6C8Vbng/sqUQZX1lmKFF5pBfbUgoNOrik3dqzCht+45X+e b+6wfsIaz6xd/b5DzpvzmrwOBD8Hko/AArruIRiVs5NyPEzqhXa380+HR3B3F8YlRvNP bBF8gm1/IVLUTW/lB9erkPt4Wkg9qTxPSAnzgQvcCT7GvU0zJp8VW06yyrtwhu98VoBT E25Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=1J3xfX6mi+yH7vokRWfQjm7Vu2SF03BqzqPZ3nviNoE=; b=FC4hkkJztw5jbx0eyV/91uBeSfRDqgS0VYiWhA/+yiOs/i9e1YB1cShC+JvVK12yUj 9A7AfEk77ftgMLq4ShNW5Mi59LePYAQ9M6600ldrurI/XK+vnpq9A8oyQkLLdjP0EKBC 8o1QJMn1AuzZJy07hTRS0mPY9/3YFcn7mJejvUtFaiidH0TcbfMatC8pfYie/I9K1vTz QsEjPRvgWcE62Qox1aQ3IGz+EWYgn10UF79re31WobBGm3Qj5QP5mpIXiAwxeq7bNEj5 IhZSuMow0tKvhd4zQsu6xSWCMsbLoy6h6Pjaa2JXRiu/Qo4/b8CoKrKovuOBOozfQfJS SwAw== X-Gm-Message-State: AOAM532wBNecXit65SEkaJBrRptuIBEhfyqcP72eVYQEuab3iZHPvr8i 8pJVnwK1yt08J8/WNejSXx78h93y9Uwx1UnMqaVjWg0bVVs= X-Received: by 2002:a17:906:e216:: with SMTP id gf22mr529801ejb.2.1601324641833; Mon, 28 Sep 2020 13:24:01 -0700 (PDT) MIME-Version: 1.0 References: <20200925221403.GE3856392@lunn.ch> <20200926004129.GC3850848@lunn.ch> <20200926144513.GD3850848@lunn.ch> In-Reply-To: <20200926144513.GD3850848@lunn.ch> From: Martin Blumenstingl Date: Mon, 28 Sep 2020 22:23:50 +0200 Message-ID: Subject: Re: RGMII timing calibration (on 12nm Amlogic SoCs) - integration into dwmac-meson8b To: Andrew Lunn Cc: netdev@vger.kernel.org, linux-amlogic@lists.infradead.org, alexandre.torgue@st.com, linux-kernel@vger.kernel.org, linux@armlinux.org.uk, joabreu@synopsys.com, kuba@kernel.org, peppe.cavallaro@st.com, davem@davemloft.net, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Andrew, On Sat, Sep 26, 2020 at 4:45 PM Andrew Lunn wrote: > > > I checked this again for the vendor u-boot (where Ethernet is NOT > > working) as well as the Android kernel which this board was shipped > > with (where Ethernet is working) > > - in u-boot the MAC side adds a 2ns TX delay and the PHY side adds a > > 2ns RX delay > > So that suggest there is nothing on the PCB. It is all down to MAC and > PHY adding delays. u-boot with it's 2ns RX delay is the non-working case only if I manually turn off the 2ns RX delay generated by the PHY in u-boot (phyreg w 0x1f 0xd08; phyreg w 0x11 0x9; phyreg w 0x15 0x11; phyreg w 0x1f 0x0; phyreg w 0x0 0x9200) I can get ping/tftpboot to work the Android kernel disables the 2ns RX delay on the PHY side (and as far as I can tell does NOT enable it on the MAC side). with that Ethernet is working > > yes, there's only one calibration value > > the reference code is calculating the calibration setting for four > > configuration variants: > > - 2ns TX delay on the MAC side, no RX or TX delay on the PHY side, RGMII RX_CLK not inverted > > - 2ns TX delay on the MAC side, no RX or TX delay on the PHY side, RGMII RX_CLK inverted > > - 2ns TX delay on the MAC side, 2ns RX delay on the PHY side, RGMII RX_CLK not inverted > > - 2ns TX delay on the MAC side, 2ns RX delay on the PHY side, RGMII RX_CLK inverted > > > > now that I'm writing this, could it be a calibration of the RX_CLK > > signal? > > Yes, seems like it. Which of these four does it end up using? I'm > guessing the 3rd? I need to double-check but if I remember correctly was close between the first and last one (and I think the first case won) > So i would forget about configuration clock inversion. Hard code it to > whatever works. It is not something you see other MAC/PHY combinations > allow to configure. we have inversion hard-coded to "off". I'm not planning to take this into consideration unless there's a good reason to do so > I think you said a value of 0x2 works. I wonder if that corresponds to > something slightly larger than 0ns if option 3 is being used? I have tested 0x0, 0x3, 0x4 and 0xf the first three values are working, but 0xf isn't. I'll try to reach someone at Amlogic to clarify the meaning of these new register bits. I guess Florian's patch is a good starting point for what I need - thanks again for the suggestion Vladimir. Thank you all! Best regards, Martin