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=-2.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 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 E5CC6C433E1 for ; Thu, 14 May 2020 13:53:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B0730205CB for ; Thu, 14 May 2020 13:53:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="cJFAY7WC" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726176AbgENNx2 (ORCPT ); Thu, 14 May 2020 09:53:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57960 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726011AbgENNx2 (ORCPT ); Thu, 14 May 2020 09:53:28 -0400 Received: from mail-pg1-x541.google.com (mail-pg1-x541.google.com [IPv6:2607:f8b0:4864:20::541]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7BE79C061A0C for ; Thu, 14 May 2020 06:53:28 -0700 (PDT) Received: by mail-pg1-x541.google.com with SMTP id r22so1262440pga.12 for ; Thu, 14 May 2020 06:53:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=MZSp0YwiO2rsC2nKIM503+bxDjAtfKmJYZ3o95i/lPs=; b=cJFAY7WCXYnEbrXhasmao6UCv9i1mZAJfRA+rdc+NKz0UOYBVOA7j+X8iPhSdYtF38 zep0c9iJjRkXjihZocX/qzBLTBqR4b08mLq4ZTDUMPAQCbq5hSNpAp8F+3crPDvlvNsM OprcNpwI1OLQse3gDglQCKgO2pUpx62jKqihrYzrkhU6TNndeb/mw3D9e6qGpWln7FkE tED4zfD7J4lfnsmqMGIGqFiRQwZ4X18GB8ieeUspQm22OGKL5ohnWLrdeXuaWGkK3q7D 6Zj3Pf2qa4SAkUDyBhSa0SikwAcsN7HRtxmxUFtA141m0d6HUOI/EEprVeNfhX05gnMO UYGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=MZSp0YwiO2rsC2nKIM503+bxDjAtfKmJYZ3o95i/lPs=; b=tPp++wJ64omiwmL9OjcdYu+mUCxDt8K16+/UYzl5cg3STy2NQ1mEB+n9eMSz5hnkL6 s2HCkBQqVQvDgtU49hr+mU7zVMWmmVKbwesBhA9gY20qSdwfvC/J8rX7YGQejB+p9Hd4 LuBIs3D1xRkznj0cNw3vQ1gmGxfnQcwhOnnwCOjbs2rI0l6n0u3NKosCj5aTmgZRykBD zuSK68T8uiMlrYKpqxYpSsCZmwOG8U74TsgYT59z+JCYKnGWbgh1nlp+5h5T/yVZCnJO gi93nPrkNmfCSkg1uoghSMku8fXWdYVBM6pD7E1paGQfsmFk/vOQ2+urEPEbn+30qpL5 f7Jw== X-Gm-Message-State: AOAM532oa+uwJL8HfPftzT923ILNap5lbjavwh0Pbi9kcYdw8YQueW7d mh9OJKWcn5EbfTXSkvsCcYQ= X-Google-Smtp-Source: ABdhPJz/TwfWFlDHi5SIZ70MrTL+5bc2ATQEjG9ATTB3erLte/u4QIiTGbehCM4Bnh36A60bzLDBFw== X-Received: by 2002:a62:5289:: with SMTP id g131mr4757956pfb.318.1589464407997; Thu, 14 May 2020 06:53:27 -0700 (PDT) Received: from localhost (c-73-241-114-122.hsd1.ca.comcast.net. [73.241.114.122]) by smtp.gmail.com with ESMTPSA id y8sm2419184pfg.216.2020.05.14.06.53.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 May 2020 06:53:27 -0700 (PDT) Date: Thu, 14 May 2020 06:53:25 -0700 From: Richard Cochran To: Olivier Dautricourt Cc: Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S . Miller" , netdev@vger.kernel.org Subject: Re: [PATCH 0/3] Patch series for a PTP Grandmaster use case using stmmac/gmac3 ptp clock Message-ID: <20200514135325.GB18838@localhost> References: <20200514102808.31163-1-olivier.dautricourt@orolia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200514102808.31163-1-olivier.dautricourt@orolia.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Thu, May 14, 2020 at 12:28:05PM +0200, Olivier Dautricourt wrote: > This patch series covers a use case where an embedded system is > disciplining an internal clock to a GNSS signal, which provides a > stable frequency, and wants to act as a PTP Grandmaster by disciplining > a ptp clock to this internal clock. Have you seen the new GM patch series on the linuxptp-devel mailing list? You may find it interesting... > In our setup a 10Mhz oscillator is frequency adjusted so that a derived > pps from that oscillator is in phase with the pps generated by > a gnss receiver. > > An other derived clock from the same disciplined oscillator is used as > ptp_clock for the ethernet mac. > > The internal pps of the system is forwarded to one of the auxiliary inputs > of the MAC. > > Initially the mac time registers are considered random. > We want the mac nanosecond field to be 0 on the auxiliary pps input edge. > > > PATCH 1/3: > The stmmac gmac3 version used in the setup is patched to retrieve a > timestamp at the rising edge of the aux input and to forward > it to userspace. > > * What matters here is that we get the subsecond offset between the aux > edge and the edge of the PHC's pps. * > > > PATCH 2,3/3: > > We want the ptp clock to be in time with our aux pps input. > Since the ptp clock is derived from the system oscillator, we > don't want to do frequency adjustements. > > The stmmac driver is patched to allow to set the coarse correction > mode which avoid to adjust the frequency of the mac continuously > (the default behavior), but instead, have just one > time adjustment. You can use the new ts2phc program (in the linuxptp-devel patch series, soon to be merged) by configuring it to use the nullf servo. Thanks, Richard