We are working on imx8mq evk board and Linux 4.14 kernel distro. We want to configure GPIO1_IO14 pin as CLKO1 pin.We want to generate 20 MHz from this pin for ov5640 camera.In imx8mq-evk.dts file for OV5640 camera you have used CLKO2 pin as clock source.
But we want to change it from CLKO2 to CLKO1. We found there is no clock implementation for CLKO1 clock in imx8mq-clock.h and clk-imx8mq.c.
When i probed this pin it is always give 25 Mhz clock.
How to configure CLKO1 pin for imx8mq-evk board?
Is there any patches related to clock source CLKO1.
Please let us know if you need further information.
CLKO1's setting is controlled by CCM_TARGET_ROOT116, it's clock source has been listed in reference manual:
000 - 25M_REF_CLK
001 - SYSTEM_PLL1_CLK
010 - 27M_REF_CLK
011 - SYSTEM_PLL1_DIV4
100 - AUDIO_PLL2_CLK
101 - SYSTEM_PLL2_DIV2
110 - VPU_PLL_CLK
111 - SYSTEM_PLL1_DIV10
You refer to source code of CLKO2 to add CLKO1 to clk-imx8mq.c
then using: clk_set_parent() & clk_set_rate() in imx8mq_clocks_init() to set clock frequency you want.
Have a nice day!
TIC weidong sun