Trying to add pps-gpio BPI-M4 Berry

I recently bought a BPI-M4 Berry to replace an older RPi. I used the Ubuntu Jammy 22.04 minimal image. By the way, the only image available at the site that works. Some severe quality control is needed to assert that images available are all functional.

I had to compile the pps-gpio module, that wasn’t enabled on the original image. Also the pps-gpio overlay wasn’t available. Using a .dts for other Allwinner SOC models (H3, H5) I modifed and compiled a .dtbo overlay and added it to /boot/bananapiEnv.txt. I used the PG11 pin, that seemed a good choice, from the schematics. Overlays examples at GitHub - armbian/sunxi-DT-overlays: Device Tree overlays for sunxi devices running Armbian images with mainline kernel

cat /root/Downloads/bpi-m4berry-pps-gpio.dts

/dts-v1/;
/plugin/;

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

        fragment@0 {
                target = <&pio>;
                __overlay__ {
                        pps_pins: pps_pins {
                                pins = "PG11";  /* the name of PG11 */
                                function = "gpio_in";
                        };
                };
        };

        fragment@1 {
                target-path = "/";
                __overlay__ {
                        pps@0 {
                                compatible = "pps-gpio";
                                pinctrl-names = "default";
                                pinctrl-0 = <&pps_pins>;
                                gpios = <&pio 6 11 0>;  /* definition of PG11 */
                                status = "okay";
                        };
                };
        };
};

Here comes the troublesome part: the overlay is loaded, but, by some reason, it isn’t passed to the pps-gpio.ko module.

[    5.822450] pps_core: no symbol version for module_layout
[    5.822461] pps_core: loading out-of-tree module taints kernel.
[    5.822575] pps_core: module verification failed: signature and/or required key missing - tainting kernel
[    5.823203] pps_core: LinuxPPS API ver. 1 registered
[    5.823206] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <[email protected]>
[    5.825209] sun50iw9-pinctrl 300b000.pinctrl: pin PG11 already requested by pps@0; cannot claim for 300b000.pinctrl:203
[    5.825217] sun50iw9-pinctrl 300b000.pinctrl: pin-203 (300b000.pinctrl:203) status -22
[    5.825222] pps-gpio pps@0: failed to request PPS GPIO
[    5.825247] pps-gpio: probe of pps@0 failed with error -22

I tried variations on pins, all failed. But if I put a wrong pin name, it is passed to the module and I have pps working. I.E, if modify pins to pins = "PG11x"; /* the WRONG name of PG11 */, or any wrong name, the pin is passed to pps-gpio.ko module and everything works fine.

[    5.718588] pps_core: no symbol version for module_layout
[    5.718599] pps_core: loading out-of-tree module taints kernel.
[    5.718722] pps_core: module verification failed: signature and/or required key missing - tainting kernel
[    5.719378] pps_core: LinuxPPS API ver. 1 registered
[    5.719381] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <[email protected]>
[    5.724412] sun50iw9-pinctrl 300b000.pinctrl: unknown pin PG11x
[    5.724821] pps pps0: new PPS source [email protected]
[    5.724869] pps pps0: Registered IRQ 229 as PPS source

If someone with more experience could verify this and explain the proper way to do this, I would appreciate!

TIA

remove pinctrl property

1 Like

Thank you! It worked!

Can you ellaborate why this works and consequences (or not) of not using the **pinctrl-0 = <&pps_pins>;** property?