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

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

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

Jump to solution
1,608 Views
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 Kudos
1 Solution
4 Replies
1,596 Views
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 Kudos
1,588 Views
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 Kudos
1,560 Views
wenfu
Contributor III

it works, thank you so much.

0 Kudos