I’ve been digging through the numberous articles on getting PPS support working on various carrier boards. I think i’m getting close, but need some help decyphering how the DTS file gets updated and how it know which GPIO to use.
It calls out P00 on P13 (pin 15), sysfs # 216. But the Pin is sourced via a TCA9539 at address 0x77.
I can’t find any reference in any of the Connect Tech DTS files that would show assigning one of the expansion GPIO to a special function like this.
My guess is my selection of the pin via the tegra_gpio_main 216 0 is wrong. Now looking through other DTS files, i can find:
(tegra186-tx2i-cti-base.dts)
i2c@3160000 {
gpio@77{
status = “disabled”;
/delete-node/ lcd-bias-rails;
};
};
Does my pps section need to reside inside the gpio@77? does anyone have any experience in how to assign a gpio pin from a port expander to the pps gpio cell?
you should added pps{} device tree node into device tree, you may adding it anywhere inside dtb blob.
may I know which TX2 platform you’re used?
you could disassembler the dtb file into dts file for modification, $ dtc -I dtb -O dts -o temp.dts tegra-xxx.dtb
after that, please convert the DTS into a new DTB file, $ dtc -I dts -O dtb -o output.dtb temp.dts
the node, for example, $ ls /sys/class/pps/pps0/
it should be able to see via system filesystem after the device tree were added correctly.
I’m using a TX2i with the Connect Tech Spacely carrier board.
My main question is: what is the format of the gpios line when I would like to use the spacely gpio pin 216 which is provided via a gpio expander (TCA9539).
I will check if the /sys/class/pps/pps0 is being created, i was under the impression it was /dev/pps0, so it could be there for all I know. will post once i confirm
along with the kernel config options i listed in the original message, on build, flash, boot up. You will now have a /dev/pps0 and /dev/pps1
The /dev/pps0 is the ktimer pps source, and /dev/pps1 will be triggered from the GPIO Port Y, Pin 6, which on the CTI Spacely carrier is P12, pin 17 (GPIO-IN). I beleive the ‘IN’ represents interrupt not input.
Once you have all that:
sudo apt install pps-tools
sudo ppstest /dev/pps0
should show timer triggers for each second the kernel timer is going.
sudo ppstest /dev/pps1
will show timer triggers for each pulse on the GPIO-IN pin. I can’t remember if it is rising or falling edge, but either way you get one timer trigger for each pulse.