K0FTT
March 12, 2023, 3:59pm
#1
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.
n3uuo
March 18, 2023, 6:23am
#2
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.
K0FTT
March 19, 2023, 4:01am
#3
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
The overlay is incorrect. You cannot just create a root pps node. Take a look at other overlays.
K0FTT
March 27, 2023, 11:01pm
#6
@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.