Adding a gpio as pps to the device tree


Could anyone assist me in adding a pps gpio to the device tree. I would like to use a pin on the viola carrier (UART_B_CTS) to receive the pps signal.

Found on this explanation:

Device-Tree Bindings for a PPS Signal on GPIO

These properties describe a PPS (pulse-per-second) signal connected to
a GPIO pin.

Required properties:
- compatible: should be "pps-gpio"
- gpios: one PPS GPIO in the format described by ../gpio/gpio.txt

Optional properties:
- assert-falling-edge: when present, assert is indicated by a falling edge
                       (instead of by a rising edge)

	pps {
		compatible = "pps-gpio";
		gpios = <&gpio2 6 0>;


And found some gpoioX defined in imx6qdl.dtsi but this dont help me with which gpio PIN is where once in the linux environment and if any of those map to the 50 pin header.

Any help would be appreciated


You could use the following resources to find the pin mapping of the viola carrier board to the module pin to the i.MX 6 pin.

Additionally you find either in the Pinout Designer or the Colibri iMX6 datasheet the GPIO alternate function. From that you know the gpio controller number and pin within that controller.

Additionally the pps-gpio driver needs to be enabled in the kernel configuration.


Viola X9 Pin 8 goes to SODIMM Pin 135 goes to i.MX 6 Ball NAND_DATA02 (which has alternate function gpio2.GPIO2_IO02)

The following gives an introduction to device tree customization specific to our modules:

The gpios property would thus become:

gpios = <&gpio2 2  GPIO_ACTIVE_LOW>;

Note that you would also have to make sure that that pin is muxed to be a gpio.


For UART_B_CTS that would boil down to:

Viola X9 Pin 39 goes to SODIMM Pin 32 goes to i.MX 6 Ball SD4_DATA6 (which has alternate function gpio2.GPIO2_IO14)

gpios = <&gpio2 14  GPIO_ACTIVE_LOW>;

Note that this pin is muxed and assigned in the device tree to UART B, so you certainly need to remove that pin from UART B or disable the UART B node entirely.



I’m looking at adding a PPS GPIO also, and I’me getting a syntax error while trying to compile my .dtb file.

I have successfully compiled and loaded my own dtb (dts overlay) and it seems I only get this error when I add the PPS node.

I am using a colibri imx7d 1Gb emmc / colibri evaluation board rev 3.2

Has anybody else had this issue ? Any pointers ? thanks.

Please ask a new question rather than hijacking this one. Plus include the exact changes you did in order for us to be able to reproduce your issue.