AnsweredAssumed Answered

How to read GPT1 CAPTURE1?

Question asked by jun heo on May 11, 2020
Latest reply on May 12, 2020 by jun heo

Hi,

I am working on I.MX8M mini(A53) using linux kernel 4.14.78(debian).

I want to find out the motor speed with the GPT CAPTURE function by connecting a motor encoder to SAI3_RXFS.

 

This is my device tree.

 

- fsl-imx8mm.dtsi

 

gpt1: gpt@302d0000 {
compatible = "fsl,imx8mm-gpt", "fsl,imx7d-gpt";
reg = <0x0 0x302d0000 0x0 0x10000>;
interrupts = <GIC_SPI 55 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&clk IMX8MM_CLK_GPT1_ROOT>,
<&clk IMX8MM_CLK_GPT1_ROOT>,
<&clk IMX8MM_CLK_GPT_3M>;
clock-names = "ipg", "per", "osc_per";
status = "okay";
};

 

system_counter: timer@306a0000 {
compatible = "nxp,sysctr-timer";
reg = <0x0 0x306a0000 0x0 0x10000>, /* system-counter-rd base */
<0x0 0x306b0000 0x0 0x10000>, /* system-counter-cmp base */
<0x0 0x306c0000 0x0 0x10000>; /* system-counter-ctrl base */
clock-frequency = <8000000>;
interrupts = <GIC_SPI 47 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 48 IRQ_TYPE_LEVEL_HIGH>;
};

 

...

 

sai3: sai@30030000 {
compatible = "fsl,imx8mm-sai", "fsl,imx8mq-sai", "fsl,imx6sx-sai";
reg = <0x0 0x30030000 0x0 0x10000>;
interrupts = <GIC_SPI 50 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&clk IMX8MM_CLK_SAI3_IPG>,
<&clk IMX8MM_CLK_DUMMY>,
<&clk IMX8MM_CLK_SAI3_ROOT>,
<&clk IMX8MM_CLK_DUMMY>, <&clk IMX8MM_CLK_DUMMY>;
clock-names = "bus", "mclk0", "mclk1", "mclk2", "mclk3";
dmas = <&sdma2 4 2 0>, <&sdma2 5 2 0>;
dma-names = "rx", "tx";
status = "disabled";
};

 

However, in the "I.MX_Reference_Manual.pdf", I.MX8M use the System Counter Timer instead of GPT.

 

IMX8MMRM.pdf is written for the GPT CAPTURE register, is this not available?

 

How to enable timer Interrupt in iMX8MQ EVK 

In this question, I use IMX8MQ, can I apply this to my board?

Outcomes