I've thrashed through this here with an Odroid-C2 running PRETTY_NAME="Armbian 23.02.1 Bullseye"
I confirmed that with current, "stock" kernels, the suggestions to manually configure a pin for the pps-gpio module are no longer useful.
At least on the C2 and perhaps on other devices, the gpioinfo utility can reveal the proper line (and chip) for a given pin, without needing to refer to the DTS, such as at https://elixir.bootlin.com/linux/v6.1.11/source/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts#L304
$ sudo gpioinfo | egrep 'gpiochip|Pin7'
gpiochip0 - 15 lines:
line 11: "J7 Header Pin7" unused input active-high
gpiochip1 - 119 lines:
line 113: "J2 Header Pin7" unused input active-high
Decompiling the "live" device tree with dtc -I fs -O dts /sys/firmware/devicetree/base or similar will reveal the phandle for the GPIO bank
In my case, I needed the pin to be active high, without any pull-up/down. When you create the file, use the .dts extension for compatibility with the Armbian compile/install script.
/dts-v1/;
/plugin/;
/*
* bank@4b0 is at phandle = <0x23>;
* GPIO 113 is "J2 Header Pin7"
* GPIO_ACTIVE_HIGH is 0
*/
/ {
compatible = "hardkernel,odroid-c2", "amlogic,meson-gxbb";
fragment@0 {
target-path = "/";
__overlay__ {
pps0: pps-gpio0 {
compatible = "pps-gpio";
gpios = <0x23 113 0>;
};
};
};
};
Running sudo armbian-add-overlay pps-gpio.dts will compile the source, install it into /boot/overlay-user/ and add a line to /boot/armbianEnv.txt to load it through U-Boot. It won't add the line if it is already there, so re-running the utility should be "safe".
While looking at /boot/armbianEnv.txt it is worth noting that the boot script has two useful U-Boot variables, extraargs and extraboardargs. At least on the C2 these seem to be unused elsewhere.
These can be set in /boot/armbianEnv.txt to adjust the kernel cmdline, such as adding
extraargs=nohz=off
if appropriate for your application.
Success should create /dev/pps0 and gpioinfo now showing
gpiochip1 - 119 lines:
line 113: "J2 Header Pin7" "pps-gpio0" input active-high [used]
With a source connected to the expected pin, the function can be checked with
$ sudo ppstest /dev/pps0
trying PPS source "/dev/pps0"
found PPS source "/dev/pps0"
ok, found 1 source(s), now start fetching data...
source 0 - assert 1678986077.000000404, sequence: 44681 - clear 0.000000000, sequence: 0
source 0 - assert 1678986078.000000575, sequence: 44682 - clear 0.000000000, sequence: 0
source 0 - assert 1678986079.000000371, sequence: 44683 - clear 0.000000000, sequence: 0
^C
Configuration of gpsd and chronyd did not seem to have any notable differences from other platforms. That is a topic on its own, but not specific to Armbian.