jsln / pps-gen-gpio

Linux kernel PPS generator using GPIO pins
GNU General Public License v2.0
32 stars 25 forks source link
driver ethernet gpio-pins kernel linux pps pps-generator

pps-gen-gpio

Linux kernel PPS generator using GPIO pins.

In kernel 4.14 there is no support for using a GPIO pin as a PPS generator, only a GPIO PPS client is available. This driver is derived from the current parallel port PPS generator and provides a PPS signal through a GPIO pin specified in the device tree. The PPS signal is synchronized to the tv_sec increment of the wall clock.

We have tested the driver with kernel 4.14.20 on a Beaglebone Black where P9 pin 16 (GPIO1_19) is used as PPS output. The corresponding modified device tree file is here shown.

Usage

If you use a Beaglebone Black and want to change the PPS output pin, you have to modify your device tree file (am335x-boneblack.dts) accordingly:

Check the BBB System Reference Manual and the am335x Technical Reference Manual to find out the correct pinmux table offset of the chosen pin.

Please note that in order to use the module with any other board using the device tree infrastructure, the following matching definitions are required in the device tree:

    pps-gen               node defined for the PPS GPIO
    pps-gen-gpio          value of ".compatible" property in pps-gen node
    pps-gen-gpio          property in pps-gen node that defines which GPIO pin is used

After modifying the device tree, add the files into drivers/pps/generators and configure the driver to be built as a module. You need to enable PPS support in the kernel.