i.mx8 generate a clock for outside on-board device

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

i.mx8 generate a clock for outside on-board device

跳至解决方案
1,711 次查看
wenfu
Contributor III

I want to generate a 24Mhz clock for a audio codec on my board. Can any one show me a dts example or some guidance. Which pins should I use?

Thank you.

0 项奖励
1 解答
4 回复数
1,699 次查看
igorpadykov
NXP Employee
NXP Employee

Hi wenfu

 

what processor used in the case, one can look for example at

MX8MM_IOMUXC_GPIO1_IO14_CCMSRCGPCMIX_CLKO1 :

https://source.codeaurora.org/external/imx/linux-imx/tree/arch/arm64/boot/dts/freescale/imx8mm-evk.d...

 

Best regards
igor

0 项奖励
1,691 次查看
wenfu
Contributor III

The processor is i.mx8mq, it seems different from i.mx8mm. see fsl_sai.txt:

Optional properties (for mx6ul):

- fsl,sai-mclk-direction-output: This is a boolean property. If present,
indicates that SAI will output the SAI MCLK clock.

and fsl_sai.c:

if (of_find_property(np, "fsl,sai-mclk-direction-output", NULL) &&
of_device_is_compatible(np, "fsl,imx6ul-sai")) {
gpr = syscon_regmap_lookup_by_compatible("fsl,imx6ul-iomuxc-gpr");
if (IS_ERR(gpr)) {
dev_err(&pdev->dev, "cannot find iomuxc registers\n");
return PTR_ERR(gpr);
}

index = of_alias_get_id(np, "sai");
if (index < 0)
return index;

regmap_update_bits(gpr, IOMUXC_GPR1, MCLK_DIR(index),
MCLK_DIR(index));
}

I wonder if it's possible to obtain a 512k-50M clock signal on MX8MQ_IOMUXC_SAI2_MCLK_SAI2_MCLK?  This in is currnet used in our PCB. Or if we can obtain a proper clock from other pins, then we have to change the PCB next time.

Now we can run the codec well by feeding it's MCLK pin an external active crystal oscillator . The codec driver is simple-card and it act as DAI master.

 

B.R.

wen

 

 

0 项奖励
1,689 次查看
igorpadykov
NXP Employee
NXP Employee
1,663 次查看
wenfu
Contributor III

it works, thank you so much.

0 项奖励