PPS GPIO Working

Hey @frank-w, Maybe add this into your wiki? Getting pps working to a gpio pin.
I have one of these https://learn.adafruit.com/adafruit-ultimate-gps
It has a dedicated pps pin that I previously had working on a Raspberry Pi.
I got it working on the BPI by adding the following to mt7623n-bananapi-bpi-r2.dts
Under the main section:
pps {
   pinctrl-names = “default”;
   compatible = “pps-gpio”;
   gpios = <&pio 72 0>;
   status = “okay”;
};
You will need to set CONFIG_PPS=m, CONFIG_PPS_CLIENT_LDISC=m & CONFIG_PPS_CLIENT_GPIO=m in the kernel for GPIO PPS support.

I didn’t need to add anything else to see the pulse on gpio 72 using Debian with kernel 4.9.

Also perhaps a pinmux is needed for other kernels. I’m not sure.
If is is perhaps the following would work (untested):
pps {
   pinctrl-names = “default”;
   pinctrl-0 = <&pinctrl_pps>;
   compatible = “pps-gpio”;
   gpios = <&pio 72 0>;
   status = “okay”;
};

&pio {
   pinctrl_pps: pps@0 {
      pins_pps {
      pinmux = <MT7623_PIN_72_I2S0_DATA_IN_FUNC_GPIO72>;
      };
   };
}

mt7623n-bananapi-bpi-r2.dts (19.3 KB)

Can you please test with newer kernel (4.14/4.19)?

what is pps exactly?

Maybe 4.14 as I and using the BPI as a router now and I need it working. :slight_smile:
Here you go: http://mtnstormdaq.com/blog/2012/10/gps-pps-use-as-a-time-reference/

have added to my wiki…

https://www.fw-web.de/dokuwiki/doku.php?id=en:bpi-r2:gpio

Tested and working under kernel 4.14.

2 Likes