netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Daniel Glöckner" <dg@emlix.com>
To: Richard Cochran <richardcochran@gmail.com>
Cc: Christian Riesch <christian.riesch@omicron.at>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: PTP_PEROUT_REQUEST and clock stepping
Date: Fri, 12 Sep 2014 17:19:29 +0200	[thread overview]
Message-ID: <54130F01.3080404@emlix.com> (raw)
In-Reply-To: <20140912144025.GA20712@netboy>

On 09/12/14 16:40, Richard Cochran wrote:
>> Taking the Intel i210 as an example, the third option (doing nothing)
>> would lead to the following behavior:
>>
>>  - If the clock is stepped back, the periodic output stops until the
>>    clock reaches the point when it was adjusted.
>>
>>  - If the clock is stepped forward, the periodic output oscillates at
>>    62,5 MHz to catch up.
> 
> That is a good example of "the results are undefined".
> 
> So, how would you reprogram the i210 to keep the period output
> continuous?

0. I'm assuming here that new_time >= start
1. stop the periodic output via TSAUXC
2. set the clock via SYSTIM* to new_time
3a. if (new_time - start) % period < period / 2
	set the TRGTTIM* regs to new_time - (new_time - start) % period
3b. else
	set the TRGTTIM* regs to new_time - (new_time - start) % period
	                                  + period
4. start the periodic output via TSAUXC

Best Regards,

  Daniel

-- 
Dipl.-Math. Daniel Glöckner, emlix GmbH, http://www.emlix.com
Fon +49 551 30664-0, Fax +49 551 30664-11,
Bertha-von-Suttner-Straße 9, 37085 Göttingen, Germany
Sitz der Gesellschaft: Göttingen, Amtsgericht Göttingen HR B 3160
Geschäftsführer: Dr. Uwe Kracke, Ust-IdNr.: DE 205 198 055

emlix - your embedded linux partner

  reply	other threads:[~2014-09-12 15:19 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-10 16:16 PTP_PEROUT_REQUEST and clock stepping Daniel Glöckner
2014-09-10 17:26 ` Richard Cochran
2014-09-11  9:52   ` Daniel Glöckner
2014-09-12  6:17     ` Christian Riesch
2014-09-12  6:24     ` Christian Riesch
2014-09-12  6:33       ` Richard Cochran
2014-09-12 11:40         ` Daniel Glöckner
2014-09-12 14:40           ` Richard Cochran
2014-09-12 15:19             ` Daniel Glöckner [this message]
2014-09-13  9:19               ` Richard Cochran

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54130F01.3080404@emlix.com \
    --to=dg@emlix.com \
    --cc=christian.riesch@omicron.at \
    --cc=netdev@vger.kernel.org \
    --cc=richardcochran@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).