Subject: Does PPS_SYNC work ?
To: None <netbsd-users@NetBSD.org>
From: Tatoku Ogaito <tacha@tack.fukui-med.ac.jp>
List: netbsd-users
Date: 12/03/2003 20:32:47
----Next_Part(Wed_Dec__3_20:32:47_2003_836)--
Content-Type: Text/Plain; charset=iso-2022-jp
Content-Transfer-Encoding: 7bit

Dear NetBSD users

Is there anybody who uses NetBSD as stratum 1 NTP server with GPS ?
On my server ntptime(8) never reports status PPSFREQ$B!"(BPPSTIME$B!"(BPPSSIGNAL.

Since opt_ntp.h is not included by serial interface driver
(for ex. /sys/dev/ic/com.c), they are compiled w/o #ifdef PPS_SYNC blocks, 
even if I add "options PPS_SYNC" to my kernel configuration file.

Furthermore, PPS_HARDPPSON{ASSERT,CLEAR} are not defined anywhere in
/sys tree, compiling com.c with -DPPS_SYNC causes compilation error.

I dug up the CVS repository and found PPS_HARDPPSON{ASSERT,CLEAR} definition
in /sys/sys/timepps.h at revision 1.1. But ntptime on a kernel, compiled
with following patch, does not report status PPSFREQ$B!"(BPPSTIME$B!"(BPPSSIGNAL, too.

# ntptime
ntp_gettime() returns code 0 (OK)
  time c37843ff.9f473000  Wed, Dec  3 2003 20:14:07.622, (.622180),
  maximum error 26937 us, estimated error 0 us.
ntp_adjtime() returns code 0 (OK)
  modes 0x0 (),
  offset 389.000 us, frequency 42.010 ppm, interval 4 s,
  maximum error 26937 us, estimated error 0 us,
  status 0x1 (PLL),
  time constant 2, precision 1.000 us, tolerance 512 ppm,
  pps frequency 0.000 ppm, stability 512.000 ppm, jitter 200.000 us,
  intervals 0, jitter exceeded 0, stability exceeded 0, errors 0.

How can I use PPS ?

Regards

Tacha
----Next_Part(Wed_Dec__3_20:32:47_2003_836)--
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="pps_sync.patch"

Index: sys/dev/ic/com.c
===================================================================
RCS file: /cvsroot/NetBSD-cvs/main/src/sys/dev/ic/com.c,v
retrieving revision 1.196
diff -u -r1.196 com.c
--- sys/dev/ic/com.c	13 Apr 2002 17:05:16 -0000	1.196
+++ sys/dev/ic/com.c	3 Dec 2003 10:54:50 -0000
@@ -82,6 +82,7 @@
 #include "opt_com.h"
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
+#include "opt_ntp.h"
 
 #include "rnd.h"
 #if NRND > 0 && defined(RND_COM)
Index: sys/sys/timepps.h
===================================================================
RCS file: /cvsroot/NetBSD-cvs/main/src/sys/sys/timepps.h,v
retrieving revision 1.4
diff -u -r1.4 timepps.h
--- sys/sys/timepps.h	23 Jul 2000 22:56:14 -0000	1.4
+++ sys/sys/timepps.h	3 Dec 2003 10:54:50 -0000
@@ -93,6 +93,8 @@
 #define PPS_CAPTUREASSERT	0x01
 #define PPS_CAPTURECLEAR	0x02
 #define PPS_CAPTUREBOTH		0x03
+#define PPS_HARDPPSONASSERT	0x04
+#define PPS_HARDPPSONCLEAR	0x08
 #define PPS_OFFSETASSERT	0x10
 #define PPS_OFFSETCLEAR		0x20
 #define PPS_CANWAIT		0x100

----Next_Part(Wed_Dec__3_20:32:47_2003_836)----