I am attempting to add a PPS GPIO to the device tree and get a syntax error while compiling the .dtb
I have successfully compiled and loaded my own dtb (dts overlay) and it seems I only get this error when I add the PPS node. My .dts file is included at the bottom of this post
I noticed on another forum thread with a similar topic on the iMX6 support mentions:
Additionally the pps-gpio driver needs to be enabled in the kernel configuration.
I’m not sure if this needs to be done to just compile the .dts , I have not yet looked into this as during boot I do see:
[ 1.040910] pps pps0: new PPS source ptp0
So I would assume the PPS driver is loaded. Any suggestions ? thoughts ? comments ?
/*
* Copyright 2017 Toradex AG
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*/
/dts-v1/;
#include "imx7d-colibri-emmc.dtsi"
#include "imx7-colibri-eval-v3.dtsi"
/ {
model = "Toradex Colibri iMX7D 1GB on Colibri Evaluation Board V3 Testing for custom carrier";
compatible = "toradex,colibri_imx7d_emmc-eval", "toradex,colibri_imx7d_emmc", \
"fsl,imx7d";
};
&usbotg2 {
vbus-supply = <®_usbh_vbus>;
status = "okay";
};
// UART2 used for M4 debug port
&uart2 {
status = "disabled";
};
//SPI used on M4
&ecspi3 {
status = "disabled";
};
pps {
compatible = "pps-gpio";
gpios = <&gpio1 2 0>;
assert-falling-edge;
};
I just rebuilt the kernel after adding the PPS in the config - but I then realized this had been built into the image provided for the easy installer. No worries, at least now I know I can rebuild the kernel on my local machine if needed (it’s up and running on my target)
Linux version 4.9.166-2.8.6+gd899927728be (oe-user@oe-host) (gcc version 7.3.0 (GCC) ) #1 SMP Mon Apr 1 13:16:28 UTC 2019␍␊
[08:16:41:981] [ 0.109053] pps_core: LinuxPPS API ver. 1 registered␍␊
[08:16:42:025] [ 0.109079] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>␍␊
No, I have not yet solved the dts compile error. I was hoping another member of the community has done this and could share a .dts file. It was the last thing I want to test before laying out my custom carrier board and I had figured it was the one thing that would have worked right away
You may additionally need to to the pinmuxing, i.e. make sure that no other driver muxes and claims the pin function GPIO1_IO02 and to mux the pin to gpio as part of the pps node.
Thanks for your responses - I am very much new to the device tree organization and just learning. I was suspecting it was going to be something straight forward like this.
From the articles I have read my impression was that I should be creating a .dts file that overlays the originals, as oppose to replacing the reference ones. Would it be better practice to redefine the nodes that need changing in the imx7-colibri.dtsi and eval files in my custom .dts file ? Just trying to make sure I start down the correct path. I’ll try to give this a try today.
Just to follow up, I’ve made the changes as per Jaski’s patches and the .dtb does compile. I’m not seeing any new PPS source on boot up with the PPS-GPIO (below).
I do see the ktimer come up when it’s configured in the kernel, and if I enable the PPS line discipline it is registered (below), but I don’t see any pulses captured in /sys/class/pps/pps0/assert
Sorry about the delay getting back to you. I’ve found out problem - it was my mistake. While rushing around before the holiday break I had reset the uboot environment variables to stop my M4 code from running and I forgot to set my own .dtb again. I just found this out this morning as I was booting up the system again.
Thanks you for the support, I think I’m all good to spin my own carrier board now.