Having difficulty getting 1PPS input on a GPIO1_IO08 tp work. My device tree fragments are:
pinctrl@30330000 {
compatible = "fsl,imx8mm-iomuxc";
reg = <0x0 0x30330000 0x0 0x10000>;
pinctrl-names = "default";
pinctrl-0 = <0x13>;
ucm-imx8m-mini {
ppsgrp {
//
fsl,pins = <MX8MM_IOMUXC_GPIO1_IO08_GPIO1_IO8 0x19>;
linux,phandle = <0x60>;
phandle = <0x60>;
};... etc ...
gpio@30200000 {
compatible = "fsl,imx8mm-gpio", "fsl,imx35-gpio";
reg = <0x0 0x30200000 0x0 0x10000>;
interrupts = <0x0 0x40 0x4 0x0 0x41 0x4>;
gpio-controller;
#gpio-cells = <0x2>;
interrupt-controller;
#interrupt-cells = <0x2>;
linux,phandle = <0x21>;
phandle = <0x21>;
};... etc ...
pps {
compatible = "pps-gpio";
pinctrl-names = "default";
pinctrl-0 = <0x60>;
input-gpios = <0x21 0x08 0x01>;
assert-rising-edge;
status = "okay";
};
I have also enabled CONFIG_PPS=y and CONFIG_PPS_CLIENT_GPIO=m in the kernel config. I've compiled pps-gpio.ko against the same kernel version and .config and place it in the /lib/modules/$(uname -r)/ directory.
However during the boot process I ge the following messages:
[ 6.072774] pps-gpio pps: failed to get GPIO from device tree
[ 6.078646] pps-gpio: probe of pps failed with error -2
It would seem pretty clear that the reference to which GPIO pin to use is incorrectly configured but I can't see a problem at all. The gpios=<0x21 0x08 0x00>; should correctly point to the gpiochip0 controller pin 8 and the pinctrl fragment should select the gpio function.
There must be some core concept I'm missing here because as far as I can tell I'm doing what //linux/Documentaion/devicetree/bindings/pps/pps.txt is saying to do.
Solved! Go to Solution.
For anyone looking to do this we did get it working.
I think some of the problems we had was the yocto build environment not being ideal. So we switched to a VM using an offically supported version of ubuntu.
The solution isn't far off from my OP:
// add to pinctrl
ppsgrp {
fsl,pins = <MX8MM_IOMUXC_GPIO1_IO08_GPIO1_IO8 0x19>;
};
// add to root
pps {
compatible = "pps-gpio";
pinctrl-names = "default";
pinctrl-0 = <&ppsgrp>;
gpios = <&gpio1 8 0>;
status = "okay";
};// ensure following set in kernel config
CONFIG_PPS=y
CONFIG_PPS_CLIENT_GPIO=m
For anyone looking to do this we did get it working.
I think some of the problems we had was the yocto build environment not being ideal. So we switched to a VM using an offically supported version of ubuntu.
The solution isn't far off from my OP:
// add to pinctrl
ppsgrp {
fsl,pins = <MX8MM_IOMUXC_GPIO1_IO08_GPIO1_IO8 0x19>;
};
// add to root
pps {
compatible = "pps-gpio";
pinctrl-names = "default";
pinctrl-0 = <&ppsgrp>;
gpios = <&gpio1 8 0>;
status = "okay";
};// ensure following set in kernel config
CONFIG_PPS=y
CONFIG_PPS_CLIENT_GPIO=m
Hi Aaron
I am afraid PPS drivers are not supported in nxp bsps, supported
are described in linux documentation (Release Notes, Linux Manual)
on link i.MX Software and Development Tools | NXP
One can try to debug it using description pps drivers on
PPS - Pulse Per Second — The Linux Kernel documentation
Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Igor,
So are you saying that instead of trying to figure out why my imx8mm evk 1pps signal isn't working with ptp4l very well, that I should be looking at linuxPPS instead???
Regards,
Brian