Using GPT capture functionality on Verdin

Hello Everyone,

I would like to use the GPT on the IMX8MM to capture pulse width from and external device.

While searching the internet I found following post in the NXP forums where something similar is tried

I want to know if it is possible to access the GPT capture pin in Linux on the Verdin? If yes can someone guide me to what would be the changes required in the existing configurations?

I believe I would need to

  • Update the devicetree to include the GPT device as this is not present
  • Compile the GPT clocksource module which uses the timer-imx-gpt.c

Regards,
Gaurav

Greetings @gauravks,

Honestly I can’t say for certain whether this is possible. We’ve never messed around with this system before on our hardware & software. I did some research and we do have the timer-imx-gpt driver in our kernel: timer-imx-gpt.c « clocksource « drivers - linux-toradex.git - Linux kernel for Apalis, Colibri and Verdin modules

Though it’s not being complied in since we don’t enable CONFIG_CLKSRC_IMX_GPT presently. Also concerning is that when looking though the source code of this driver I see many specifics for all the various i.MX SoCs. However I don’t see anything for any of the i.MX8*s. I’m not sure if a patch is required or maybe the driver “just works”. Honestly it might just be a case of try and see. Sorry I couldn’t provide further details than this.

Best Regards,
Jeremias