1. 26 Jun, 2019 2 commits
    • Jean-Claude BAU's avatar
      [New feature] Check for incoming leap second · 24ea4b97
      Jean-Claude BAU authored
      - Add a new tool (wrs_leapsec) to check for an incoming leap second. It
      is done by parsing the leap second file. If a leap second is detected
      then adjustment parameters for the clock algoritm are set in the kernel.
      - Start the tool at startup
      - With cron, execute the tool every 3 hours
      - As many tools need to parse the leap seconds file, functions have been
      added in the library and then called by these tools
    • Jean-Claude BAU's avatar
      wr_date.c: Add option · 6f18a2ac
      Jean-Claude BAU authored
      The -n option in the wr_date tool is used for a dry run. It execute the
      code without applying changes in the system and the hardware.
      However calling "wr_date -n set host" was not setting the date but
      applying the TAI offset. To make things more consistant, a new option
      has been added. Calling "wr_date set host tai" now sets only the TAI
      The wr_date script has been changed to take into account this
      modification of the behavior.
  2. 07 Jun, 2019 1 commit
  3. 03 Jun, 2019 6 commits
    • Jean-Claude BAU's avatar
      [Issue:#196] WR time not set properly in GM mode · f7c33411
      Jean-Claude BAU authored
      1/ wr_date script:
      - Started before PPSi
      - Set number of NTP retries to 10 if GM otherwise 1. GM info is
      extracted from dot-config
      - Clock source is controlled directly with wr_date tool
      - Can be started any time without any risk to set a wrong date (see
      point 2)
      2/ wr_date
      - 'set host' parameters take into account the time mode ( FR: set
      sec+ns, BC: time cannot be set, GM: set seconds only+wait to be in a
      middle of a second)
      - function substrat_substrat() moved to time_lib.h. Also used by wr_mon
      3/ wr_mon
      - Print TAI-UTC
      - Update Timing Mode & PLL locking state displayed values
    • Benoit Rat's avatar
      tools: wr_date: use ppsg structure as volatile to skip optimization · 28cc5437
      Benoit Rat authored
      By doing this we force to read again the FPGA register inside the loop
           and the compiler can not skip this loop thinking he is reading the
      same value (that was not modified by him).
    • Benoit Rat's avatar
      tools/init.d: wr_date: fix back TAI offset in kernel · 06636adb
      Benoit Rat authored
      Fix TAI offset into kernel was done withing get function but this has
      been removed in commit #91f4c8d. As it is still needed by slave, we
      force its use using -n option. This will only fix tai offset into kernel
      without applying ToD to WR/FPGA time.
    • Benoit Rat's avatar
      tools: wr_date: improve get function · 350479ff
      Benoit Rat authored
      Use gmtime instead of localtime (TAI should never used localtime)
      Add verbose option to also display linux time
    • Benoit Rat's avatar
      tools: wr_date: add diff command to track WR/FPGA (HW) VS linux (SW) time · 4bc75e18
      Benoit Rat authored
      The output will be something like:
      wr_date -v diff
      TAI(HW)-UTC(SW): +36.602286
      UTC(HW)-UTC(SW): -0.397714
    • Benoit Rat's avatar
      tools: wr_date: get function should not set tai into kernel · ad85202f
      Benoit Rat authored
      In the previous version `wr_date get` would override kernel TAI time
      (using local file) and this could cause some problems in case leap
      second from /etc/leap-seconds.list was not the same than from PTP/WR
  4. 10 Apr, 2019 1 commit
    • baujc's avatar
      Bug fixes and new option in wr_date tool · 68f47b7a
      baujc authored
      - Add new option "stat" to display statistic about the evolution between
      WR and Unix time
      - When we set the WR time with the current UNIX time, the driver
      wr_clocksource must be removed first and then reinstalled when the time
      is set. If it is not done, the WR and Unix time are not well
      - When the WR time is set, the sec and ns and set in one call. We don't
      need to call twice the wr_date tool.
  5. 12 Aug, 2016 1 commit
  6. 11 Aug, 2016 1 commit
  7. 05 Dec, 2014 1 commit
    • Alessandro Rubini's avatar
      userspace: fix wr_date to mark tai_offset even at startup · 0098a6bb
      Alessandro Rubini authored
      Also, run "wr_date get" at boot once, so it parses leap-seconds.list
      and configures the kernel for the proper tai_offset.
      With the previous commit it worked with "wr_date get tohost",
      becase after the host is correctly in 2014 or so, all leap seconds are
      in the past.  But if we are not synced, the host is in 1970 and
      no leap second has already happened.
      If this code is unchanged in 2018, we'd better be off by 2 seconds
      than 37, so if linux reports a date earlier than 2014, use 2014 and
      fix tai_offset at 35.
      Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
  8. 20 Nov, 2014 1 commit
    • Alessandro Rubini's avatar
      userspace: wr_date can now set system time from WR time · 402abf96
      Alessandro Rubini authored
      This is a short-term fix to actual user needs. We'll soon
      have a kernel module to track WR time, but most likely people
      won't use that module until the next release.
      Meanwhile, the normal "wr_date get" is enhanced to report both UTC and
      This wr_date is a simple plug-in replacement for installed switches.
      Example, after setting a wrong host time on purpose:
      (the example above includes extra blank lines to separate the output
      from the various commands)
         wrs- get; date; wr_date get tohost; date
         1416482191.851373280 TAI
         2014-11-20 11:16:31.851373280 TAI
         2014-11-20 11:15:56.851373280 UTC
         Mon Nov 10 09:08:14 UTC 2014
         1416482191.895071872 TAI
         2014-11-20 11:16:31.895071872 TAI
         2014-11-20 11:15:56.895071872 UTC
         Thu Nov 20 11:15:56 UTC 2014
      Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
  9. 18 Sep, 2014 1 commit
  10. 21 Jul, 2014 2 commits
  11. 10 Jun, 2014 1 commit
  12. 14 Nov, 2013 1 commit
  13. 17 Jul, 2013 1 commit