Kernel PPS processing

Dan Drown dan-ntp at drown.org
Tue Jul 5 00:27:50 UTC 2016


Quoting "Gary E. Miller" <gem at rellim.com>:
> Good stuff, but I find no mention of GPIO timestamping..

pps-gpio takes the timestamp in the kernel interrupt handler.

The code is here:  
http://lxr.free-electrons.com/source/drivers/pps/clients/pps-gpio.c?v=4.6#L60

To do this, the GPIO peripheral in the BCM2835 is configured to  
interrupt on an edge, with this code:

http://lxr.free-electrons.com/source/drivers/pinctrl/bcm/pinctrl-bcm2835.c?v=4.5#L416

GPREN0 / GPFEN0 are defined in  
https://www.raspberrypi.org/documentation/hardware/raspberrypi/bcm2835/BCM2835-ARM-Peripherals.pdf

as "GPIO Falling Edge Detect Enable Registers (GPRENn)"
and "GPIO Rising Edge Detect Enable Registers (GPRENn)"

You can also see the interrupt in the proc filesystem:

$ grep pps /proc/interrupts
170:     900414          0          0          0  pinctrl-bcm2835   4  
Edge      pps.-1



More information about the devel mailing list