Pps-gpio for s905x

I am running Le Potato on Libre computer’s raspbian release. I am trying to use GPIOAO_6 for pps from a GPS module. This is the dts I have written:

/*
 * Overlay to enable PPS on GPIOAO_6
 */

/dts-v1/;
/plugin/;

#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/gpio/meson-gxl-gpio.h>

/ {
	compatible = "libretech,cc", "amlogic,s905x", "amlogic,meson-gxl";

	fragment@0 {
		target-path = "/";
		__overlay__ {
			pps {
				compatible = "pps-gpio";
				gpios = <&gpio GPIOAO_6 GPIO_ACTIVE_HIGH>;
			};
		};
	};
};

I compile, enable and merge this and get the following error in dmesg

[    8.309319] pps-gpio pps: failed to map GPIO to IRQ: -6
[    8.309343] pps-gpio: probe of pps failed with error -22

What should my .dts look like to use GPIOAO_6 for gpio-pps? Thanks.

I’m having the same issue - I tried on a different pin (gpios = <&gpio GPIOCLK_0 GPIO_ACTIVE_HIGH>;) and I got the same dmesg error.

I tried several different pins too. I can confirm that GPAIOAO_9 and GPIOAO_6 give the same error. I think the problem has something to do with how this Amlogic chip handles mapping interrupts to GPIO. I tried several different approaches with interrupts in the .dts too, but no success. Hopefully someone from libre will chime in with an example that works.

1 Like

Same problem for me too.

The overlay is incorrect. You cannot just create a root pps node. Take a look at other overlays.

@librecomputer Thank you for the reply. This is how Armbian handles a rockchip board and is what I used as my model.

/dts-v1/;
/plugin/;

/ {
  compatible = "pine64,rock64", "rockchip,rk3328";

  fragment@0 {
    target-path = "/";
    __overlay__ {
      pps: pps@0 {
        compatible = "pps-gpio";
        gpios = <&gpio GPIOAO_6 GPIO_ACTIVE_HIGH>;
      };
    };
  };
};

And this is how Armbian handles a H5 board.

/dts-v1/;
/plugin/;

/ {
	compatible = "allwinner,sun50i-h5";

	fragment@0 {
		target = <&pio>;
		__overlay__ {
			pps_pins: pps_pins {
				pins = "PD14";
				function = "gpio_in";
			};
		};
	};

	fragment@1 {
		target-path = "/";
		__overlay__ {
			pps@0 {
				compatible = "pps-gpio";
				pinctrl-names = "default";
				pinctrl-0 = <&pps_pins>;
				gpios = <&pio 3 14 0>; /* PD14 */
				status = "okay";
			};
		};
	};
};

Which .dts examples should I be looking at for pps-gpio on s905x? I have looked at the overlays here:

But there aren’t any pps examples. I realize now my pps { line should probably be pps@0 { but that didn’t work either. Any suggestion of an example would be appreciated.

GPIO_AO is part of the gpio_ao and not part of the gpio handle.