xref: /freebsd/share/man/man4/man4.arm/am335x_dmtpps.4 (revision d3c2497caba3d63ccf1f8280ab2e37cfa3856dfc)
14159fbabSIan Lepore.\"
24159fbabSIan Lepore.\" Copyright (c) 2015 Ian Lepore <ian@freebsd.org>
34159fbabSIan Lepore.\" All rights reserved.
44159fbabSIan Lepore.\"
54159fbabSIan Lepore.\" Redistribution and use in source and binary forms, with or without
64159fbabSIan Lepore.\" modification, are permitted provided that the following conditions
74159fbabSIan Lepore.\" are met:
84159fbabSIan Lepore.\"
94159fbabSIan Lepore.\" 1. Redistributions of source code must retain the above copyright
104159fbabSIan Lepore.\"    notice, this list of conditions and the following disclaimer.
114159fbabSIan Lepore.\" 2. Redistributions in binary form must reproduce the above copyright
124159fbabSIan Lepore.\"    notice, this list of conditions and the following disclaimer in the
134159fbabSIan Lepore.\"    documentation and/or other materials provided with the distribution.
144159fbabSIan Lepore.\"
154159fbabSIan Lepore.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
164159fbabSIan Lepore.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
174159fbabSIan Lepore.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
184159fbabSIan Lepore.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
194159fbabSIan Lepore.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
204159fbabSIan Lepore.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
214159fbabSIan Lepore.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
224159fbabSIan Lepore.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
234159fbabSIan Lepore.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
244159fbabSIan Lepore.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
254159fbabSIan Lepore.\"
264159fbabSIan Lepore.\" $FreeBSD$
274159fbabSIan Lepore.\"
284159fbabSIan Lepore.Dd August 12, 2015
294159fbabSIan Lepore.Dt AM335X_DMTPPS 4
304159fbabSIan Lepore.Os
314159fbabSIan Lepore.Sh NAME
324159fbabSIan Lepore.Nm am335x_dmtpps
334159fbabSIan Lepore.Nd RFC 2783 Pulse Per Second API driver for AM335x systems
344159fbabSIan Lepore.Sh SYNOPSIS
354159fbabSIan Lepore.Cd "device am335x_dmtpps"
364159fbabSIan Lepore.Pp
374159fbabSIan LeporeOptional in
384159fbabSIan Lepore.Pa /boot/loader.conf :
394159fbabSIan Lepore.Cd hw.am335x_dmtpps.input="pin name"
404159fbabSIan Lepore.\"
414159fbabSIan Lepore.Sh DESCRIPTION
424159fbabSIan LeporeThe
434159fbabSIan Lepore.Nm
444159fbabSIan Leporedevice driver provides a system time counter that includes precise
454159fbabSIan Leporecapture of Pulse Per Second (PPS) signals emitted by GPS receivers
464159fbabSIan Leporeand other timing devices.
474159fbabSIan LeporeThe
484159fbabSIan Lepore.Nm
494159fbabSIan Leporedriver may be compiled into the kernel or loaded as a module.
504159fbabSIan Lepore.Pp
514159fbabSIan LeporeThe AM335x timer hardware captures the value of the system time counter
524159fbabSIan Leporeon the leading edge of the PPS pulse.
534159fbabSIan LeporeBecause the capture is done by the hardware there is no interrupt
544159fbabSIan Leporelatency in the measurement.
554159fbabSIan LeporeThe time counter runs at 24Mhz, providing a measurement resolution
564159fbabSIan Leporeof 42 nanoseconds.
574159fbabSIan Lepore.Pp
584159fbabSIan LeporeTo use the PPS timing information provided by this driver with
594159fbabSIan Lepore.Xr ntpd 8 ,
604159fbabSIan Leporesymlink the
61*d3c2497cSChristian Brueffer.Pa /dev/dmtpps
624159fbabSIan Leporedevice to
63*d3c2497cSChristian Brueffer.Pa /dev/pps0
644159fbabSIan Leporeand configure server
654159fbabSIan Lepore.Va 127.127.22.0
664159fbabSIan Leporein
674159fbabSIan Lepore.Xr ntp.conf 5
684159fbabSIan Leporeto configure a type 22 (ATOM) refclock.
694159fbabSIan Lepore.\"
704159fbabSIan Lepore.Sh DRIVER CONFIGURATION
714159fbabSIan LeporeThe AM335x hardware provides four timer devices with a capture input
724159fbabSIan Leporepin, DMTimer4 through DMTimer7.
734159fbabSIan LeporeBecause it also provides the active system time counter,
744159fbabSIan Leporeonly one instance of the
754159fbabSIan Lepore.Nm
764159fbabSIan Leporedriver can be active at a time.
774159fbabSIan LeporeThe driver uses system pin configuration to determine which hardware
784159fbabSIan Leporetimer device to use.
794159fbabSIan LeporeConfigure the timer input pin in the system's FDT data, or by
804159fbabSIan Leporesupplying the pin name using a tunable variable in
814159fbabSIan Lepore.Xr loader.conf 5 .
824159fbabSIan Lepore.Pp
834159fbabSIan LeporeTo use a standard kernel and FDT data, use
844159fbabSIan Lepore.Xr loader.conf 5
854159fbabSIan Leporeto load the
864159fbabSIan Lepore.Nm
874159fbabSIan Leporemodule and set the
884159fbabSIan Lepore.Va hw.am335x_dmtpps.input
894159fbabSIan Leporetunable variable to the name of the input pin, one of the following:
904159fbabSIan Lepore.Pp
914159fbabSIan Lepore.Bl -tag -width "GPMC_ADVn_ALE MMMM" -offset MMMM -compact
924159fbabSIan Lepore.It Em Name
934159fbabSIan Lepore.Em Hardware
944159fbabSIan Lepore.It P8-7
954159fbabSIan LeporeDMTimer4; Beaglebone P8 header pin 7.
964159fbabSIan Lepore.It P8-8
974159fbabSIan LeporeDMTimer7; Beaglebone P8 header pin 8.
984159fbabSIan Lepore.It P8-9
994159fbabSIan LeporeDMTimer5; Beaglebone P8 header pin 9.
1004159fbabSIan Lepore.It P8-10
1014159fbabSIan LeporeDMTimer6; Beaglebone P8 header pin 10.
1024159fbabSIan Lepore.It GPMC_ADVn_ALE
1034159fbabSIan LeporeDMTimer4.
1044159fbabSIan Lepore.It GPMC_BEn0_CLE
1054159fbabSIan LeporeDMTimer5.
1064159fbabSIan Lepore.It GPMC_WEn
1074159fbabSIan LeporeDMTimer6.
1084159fbabSIan Lepore.It GPMC_OEn_REn
1094159fbabSIan LeporeDMTimer7.
1104159fbabSIan Lepore.El
1114159fbabSIan Lepore.Pp
1124159fbabSIan LeporeTo configure the
1134159fbabSIan Lepore.Nm
1144159fbabSIan Leporedriver using FDT data, create a new pinctrl node by referencing the standard
1154159fbabSIan Lepore.Va am33xx_pinmux
1164159fbabSIan Leporedriver node (which is defined in am33xx.dtsi) in your dts file.
1174159fbabSIan LeporeFor example:
1184159fbabSIan Lepore.Bd -literal
1194159fbabSIan Lepore   &am33xx_pinmux {
1204159fbabSIan Lepore      timer4_pins: timer4_pins {
1214159fbabSIan Lepore         pinctrl-single,pins = <0x90 (PIN_INPUT | MUX_MODE2)>;
1224159fbabSIan Lepore      };
1234159fbabSIan Lepore   };
1244159fbabSIan Lepore.Ed
1254159fbabSIan Lepore.Pp
1264159fbabSIan LeporeAdd pinctrl properties referencing
1274159fbabSIan Lepore.Va timer4_pins
1284159fbabSIan Leporeto the standard
1294159fbabSIan Lepore.Va timer4
1304159fbabSIan Leporedevice node (also defined in am33xx.dtsi) by referencing it in
1314159fbabSIan Leporeyour dts file as follows:
1324159fbabSIan Lepore.Bd -literal
1334159fbabSIan Lepore   &timer4 {
1344159fbabSIan Lepore      pinctrl-names = "default";
1354159fbabSIan Lepore      pinctrl-0 = <&timer4_pins>;
1364159fbabSIan Lepore   };
1374159fbabSIan Lepore.Ed
1384159fbabSIan Lepore.\"
1394159fbabSIan Lepore.Sh FILES
1404159fbabSIan Lepore.Bl -tag -width ".Pa /dev/dmtpps" -compact
1414159fbabSIan Lepore.It Pa /dev/dmtpps
1424159fbabSIan LeporeThe device providing
1434159fbabSIan Lepore.Xr ioctl 2
1444159fbabSIan Leporeaccess to the RFC 2783 API.
1454159fbabSIan Lepore.El
1464159fbabSIan Lepore.\"
1474159fbabSIan Lepore.Sh SEE ALSO
1484159fbabSIan Lepore.Xr timecounters 4 ,
1494159fbabSIan Lepore.Xr loader.conf 5 ,
1504159fbabSIan Lepore.Xr ntp.conf 5 ,
1514159fbabSIan Lepore.Xr ntpd 8
1524159fbabSIan Lepore.\"
1534159fbabSIan Lepore.Sh HISTORY
1544159fbabSIan LeporeThe
1554159fbabSIan Lepore.Nm
1564159fbabSIan Leporedevice driver first appeared in
1574159fbabSIan Lepore.Fx 11.0 .
1584159fbabSIan Lepore.\"
1594159fbabSIan Lepore.Sh AUTHORS
1604159fbabSIan LeporeThe
1614159fbabSIan Lepore.Nm
1624159fbabSIan Leporedevice driver and this manual page were written by
163*d3c2497cSChristian Brueffer.An Ian Lepore Aq Mt ian@FreeBSD.org .
164