iMX Clock Divider

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

iMX Clock Divider

818 Views
raajeshk88
Contributor III

I am trying to divide a clock (CLKO2) to 12MHz from its default value 24MHz. From imx6qclk.c there is function call to 

clk[IMX6QDL_CLK_CKO2_PODF]  = imx_clk_divider("cko2_podf", "cko2_sel", base + 0x60, 21, 3);

whatever i change in the bit values (3/4/5 ) the divider is still the same. can someone explain how this clock divider works. Thanks

Labels (2)
0 Kudos
3 Replies

748 Views
igorpadykov
NXP Employee
NXP Employee

Hi Raajesh

one can attach jtag and check CCM_CCOSR register, it is described in

sect.18.6.21 CCM Clock Output Source Register (CCM_CCOSR) i.MX6DQ Reference Manual.

Also necessary initialization can be done in uboot. As for dts clock settings may be useful to look on

Where pll4_bypass_src is set to choose osc 24MHz or CLK2_N/P as source in linux BSP code? 

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

748 Views
raajeshk88
Contributor III

Hi Igor,

         Thanks for the reply. Actually I am looking to use the clk_divider API to divide the clk. From the register settings it says the bits 21 to 23 is for divider (000-111) but i want ot knwo to set 101 for the bits 21-23 using this API. 

0 Kudos

748 Views
igorpadykov
NXP Employee
NXP Employee

Hi Raajesh

for example one can try to change "mclk" to necessary value

ov564x: ov564x@3c {..
clocks = <&clks IMX6QDL_CLK_CKO>;
..
mclk = <24000000>;

imx6qdl-sabresd.dtsi\dts\boot\arm\arch - linux-imx - i.MX Linux kernel 

Best regards
igor

0 Kudos