Issue in configuration of GPIO1_IO14 as CLKO1 20 MHZ clock source

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

Issue in configuration of GPIO1_IO14 as CLKO1 20 MHZ clock source

1,017 Views
parth_modi
Contributor I

Hi,

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.

Thanks,

Parth  

0 Kudos
2 Replies

782 Views
weidong_sun
NXP TechSupport
NXP TechSupport

Hello parth,

    CLKO1's setting is controlled by CCM_TARGET_ROOT116, it's clock source has been listed in reference manual:

CCM_TARGET_ROOT116[MUX]

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

0 Kudos

782 Views
parth_modi
Contributor I

Hi TIC weidong sun,

 

we appreciated your quick support.

We have identify one other pin(GPIO1_IO6) which we can use for clock source.So we have configured it as following.

 

pinctrl_csi2: csi2grp { 
fsl,pins = < 
MX8MQ_IOMUXC_GPIO1_IO05_GPIO1_IO5 0x19
MX8MQ_IOMUXC_GPIO1_IO06_CCMSRCGPCMIX_EXT_CLK3 0x59

>; 
}; 

&i2c2 { 
ov5640_mipi: ov5640_mipi@3c { 
compatible = "ovti,ov5640_mipi"; 
reg = <0x3c>; 
status = "okay"; 
pinctrl-names = "default"; 
pinctrl-0 = <&pinctrl_csi2>; 
clocks = <&clk IMX8MQ_CLK_EXT3>; 
clock-names = "csi_mclk"; 
assigned-clock-rates = <0>, <20000000>; 
csi_id = <0>; 
pwn-gpios = <&gpio1 5 GPIO_ACTIVE_HIGH>; 
rst-gpios = <&gpio3 13 GPIO_ACTIVE_LOW>; 
mclk = <20000000>; 
mclk_source = <0>; 
port { 
ov5640_mipi2_ep: endpoint { 
remote-endpoint = <&mipi2_sensor_ep>; 
}; 
}; 
}; 
};

But we can't get the clock on GPIO1_IO06. 

Can you please help us to work this clock for me?

 

Please let me know if you need further information.

Thanks,

Parth

0 Kudos