The board I use is the development board of the IMX6Q of NXP official website. The kernel version I am using is linux3.14.52. The problem I am having now is: I want to get the clock frequency of the EPIT, I want to calculate the time period of its counting according to its frequency. Currently, my epit timer 1 and epit timer 2 are working properly. But when I get the clock frequency of the timer, the value I get is 0. The way I get it is:
struct clk *timer_clk = NULL;
timer_clk = clk_get_sys("imx-epit.1", "per");
Printk("Get EPIT1 time_clk fail !\n");
clk_value = clk_get_rate(timer_clk);
Printk("epit1 timer_clk->rate = %d !kernel \n", clk_value);
The last print is: epit1 timer_clk->rate = 0 !kernel
How can I get the actual frequency of the clock?
Because I want to use epit to achieve precise timing.
For example, I want to interrupt once in 1ms. What should I set the EPITLR register to be correct? At the same time, I hope to have a calculation method!
I look forward to your help.
thank you very much.