SD card -image- for the beaglebone

Ian Lepore ian at FreeBSD.org
Wed Feb 6 04:18:39 UTC 2013


On Thu, 2013-01-31 at 21:27 +0000, Iain Young wrote:
> On 31/01/13 15:36, Ian Lepore wrote:
> 
> > So you're interested in a PPS driver for BeagleBone?  That would be fun
> > to play with, I wonder what the BB's timer hardware looks like?  It'd be
> > easy enough to do with a gpio interrupt I suspect, but the timing geek
> > in me can't resist going for the nanosecond-accurate measurements when
> > possible, even if it is kind of pointless for millisecond-accurate NTP.
> 
> Yep. Planning on hooking up MSF, DCF, and TDF clocks to GPIO pins, as
> well as some GPS units. Originally planned for doing this with some
> Pi, but found the bone had serial ports and things developed from there
> 
> Planning on abusing UART3's CTS pin for initial basic testing, as
> radioclkd and radioclkd2 have only support for serial ports, but
> then it will be working out what if anything I need to patch into the
> kernel to get the PPS subsystem to listen to particular GPIO pins.
> 
> Also planning to test PHK's ntpns, which has DCF support,
> and should be easy to modify for MSF. Anyway, this is heading far
> too quickly to being on-topic for time-nuts but off-topic here

Check out what I taught my beaglebone to do today...

root at bb:/ # ntpq -p
     remote           refid  st t when poll reach   delay   offset  jitter
==========================================================================
oPPS(0)          .PPS.        0 l    4   16  377    0.000    0.399   0.008
+dvb.hippie.lan  .GPS.        1 u   55   64  377    1.411    0.666   0.126
+tflex.hippie.la .GPS.        1 u   15   64  377    0.901    1.867   0.904
+paranoia.hippie .PPS.        1 u   61   64  377    0.396    0.426   0.025
xutcnist2.colora .ACTS.       1 u   71   64  376   34.136  -11.277   4.656
xnist1.symmetric .ACTS.       1 u   63   64  377   59.880   12.327   2.113
-ntp.your.org    .CDMA.       1 u    4   64  377   51.185   -4.212   4.215
xntp1.conectiv.c .IRIG.       1 u   51   64  377   99.067   17.784   3.445

It turns out the chip has nice timer hardware that can latch the
freeruning timercounter in response to the PPS signal.  That allows for
a PPS driver that doesn't use interrupts at all.  The timecounter code
has a specific interface for such hardware, but there isn't much example
code in the base for how to use it.  Soon there'll be more.  :)

I'll attach a patch in case anyone else wants to play with this.  To use
it, apply the patch, add "options PPS_SYNC" to the kernel config, and
choose which timer pin you want to put the pps on.  The attached patch
uses the timer4 pin, which is exposed on the P8 connector as pin #7.
You can use any of the timer4-timer7 pins, just set the one you want to
use to "input" in the dts and the driver will use it.

-- Ian

-------------- next part --------------
A non-text attachment was scrubbed...
Name: dmtimer_pps_full.diff
Type: text/x-patch
Size: 26571 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-arm/attachments/20130205/cba1ba80/attachment.bin>


More information about the freebsd-arm mailing list