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 X-Spam-Level: X-Spam-Status: No, score=-3.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BC13EC4727F for ; Mon, 28 Sep 2020 20:24:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 85FB9207E8 for ; Mon, 28 Sep 2020 20:24:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=googlemail.com header.i=@googlemail.com header.b="qcxx8srT" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726799AbgI1UYF (ORCPT ); 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-Google-Smtp-Source: ABdhPJyNwJznKhbkYlvL5tC9TERwX8tgB5MOPOWV37ylEdBY0oUGQGsaTist/nbW+GeLLVJypFukRI5bQks82mNJJuA= 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: netdev@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