What is required to output a clock e.g. on the `SAI2_MCLK` pin?
With iMX8MM, the clock started immediately after iomux have been configured. E.g. in barebox bootloader I see the signal after
mw 0x303301c8 0
But on iMX8MP the signal stays static
mw 0x303a00d8 32 ## power up audio block
mw 0x303301b4 0 ## ALT0_AUDIOMIX_SAI2_MCLK
and can be toggled by changing pull up/down settings
mw 0x30330414 0x140 ## signal becomes high
mw 0x30330414 0x100 ## signal becomes low
Clocks are enabled, audio_blk_ctrl controller is having power-on settings and I enabled MOE in SAI MCTL:
md 0x30384650
30384650: 00000003 00000003 00000003 00000003 ................
:/ md 0x30e20000+8
30e20000: ff777777 0000003f www.?...
:/ md 0x30e20300+0x20
30e20300: 00000000 00000000 00000000 00000000 ................
30e20310: 00000000 00000000 00000000 00000000 ................
:/ md 0x30c20100
30c20100: 80000000 00000000 xxxxxxxx xxxxxxxx ................
What has to be configured else to output the MCLK signal? I require it for using an SGTL5000 which needs MCLK for its i2c communication.
`FSL_SAI_MCTL_MCLK_EN` + `FSL_SAI_CSR_TERE` must be enabled to generate the clock.
I solved it by making SAI a clock provider and enable MCLK in sgtl5000 when needed.
It is racy like hell but works for now. Future hardware will probably replace the SGTL5000
Hi @ensc,
I think there is no dependency of MCLK on I2C to work.
Could you please confirm at your end if there is something that you are missing related to any pins/GPIOs or SGTL5000?
Best Regards,
Dhruvit.
I think there is no dependency of MCLK on I2C to work.
MCLK is required; see Table 7 "Dynamic Electrical Characteristics", note 1
The SGTL5000 has an internal reset that is deasserted 8 SYS_MCLK cycles after all power rails have been brought up. After this time, communication can start.
and figure 4 "Power Up Timing"
But this question is about the iMX8MP; I want to know how to generate SAI MCLK there.
Hi @ensc,
Could you please try playing/recording something first to make SAI work?
For example, with default i.MX8MP evk, when I use the wm8960 for playback, SAI3 will be used, then I can read the register like,
ot@imx8mpevk:~# /unit_tests/memtool 30e20000 1
E
Reading 0x1 count starting at address 0x30E20000
0x30E20000: 04000300
Best Regards,
Dhruvit.
Could you please try playing/recording something first to make SAI work?
The problem is, that I can not play or record anything because I can not initialize the SGTL5000 due to the missing SAI_MCLK.
With iMX8MM on a similar hardware, this clock was easy to generate just by setting iomux. This does not work anymore with iMX8MP.
What have I to do for generating SAI_MCLK?
For example, with default i.MX8MP evk, when I use the wm8960 for playback
I do not know the wm8960; perhaps its I2C works without the global mclk.