toradex: apalis/colibri_imx6: Fix CLKO1/CLKO2 output
authorFrancesco Dolcini <francesco.dolcini@toradex.com>
Fri, 24 Jun 2022 09:52:19 +0000 (11:52 +0200)
committerStefano Babic <sbabic@denx.de>
Tue, 28 Jun 2022 13:24:31 +0000 (15:24 +0200)
commitd4cd19ded8a23fdc0d9c6499f82b3f7a596bc29d
treea7245ebfd684cdef09f387d557fc92ce7182824d
parentb70c34224e5a2af3c145bacca460806c293621a0
toradex: apalis/colibri_imx6: Fix CLKO1/CLKO2 output

Set CLK01 and CLK02 to 24MHz and enable it in CCM_CCOSR register.

This clock is used by both the audio codec (CLKO1) and by the CSI camera
(CLKO2) and is expected to be 24MHz.

Despite the wrong 16.5MHz there was no real issue because of the wrong
frequency since Linux reconfigures the clocks afterward, however this
was triggering an issue with noise coming from the SGTL5000 audio codec.

The problem is that the SGTL5000 does not have a reset pin and after it
is configured if the input MCLK clock is disabled it produces a constant
noise on its output, this was happening on software reboot.

Forcing the clock to be enabled in U-Boot prevent the problem by making
sure that the clock is always available, without this change as soon as
Linux was changing the clock tree (setting clk_out_sel=1 without setting
clko2_en=1) the noise would start till the actual clock was enabled
(clko2_en=1) during the SGTL5000 driver probe.

Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Fabio Estevam <festevam@denx.de>
board/toradex/apalis_imx6/apalis_imx6.c
board/toradex/colibri_imx6/colibri_imx6.c