[imx6] PLLv3 clock change

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

[imx6] PLLv3 clock change

跳至解决方案
2,686 次查看
jiadawang
Contributor IV

Hi

According to User manual

section 18.5.1.5.3 PLL clock change

- "Before changing the PLL setting, power it down. Power up the PLL after the change"


But currently neither 3.10 FSL BSP

http://git.freescale.com/git/cgit.cgi/imx/linux-2.6-imx.git/tree/arch/arm/mach-imx/clk-pllv3.c?h=imx...

nor 3.15 mainline kernel

https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/arch/arm/mach-imx/clk-pllv3.c?i...

is doing power down/up when changing of PLL clock rate in set_rate() interface.


I do find one patch from Russell King

[134/222] ARM: imx: keep PLLs in bypass while they're locking - Patchwork

in this patch PLL is set to bypass mode before change its rate

my question is:

what is the proper operation to change PLL rate? should pllv3 driver power down/up PLL clock just as user manual stated.

If pllv3 driver keeps current behavior (directly change clock rate with out power down/up or set it to bypass mode),

is there any potential problem, like clock glitch?

Thanks,

Jiada

1 解答
1,266 次查看
gusarambula
NXP TechSupport
NXP TechSupport

Yes, the answer applies to virtually all PLLs, except for the clocks that can’t be stopped, like the core clocks.

As for the sequence it is correct.

Regarding the i.MX linux tree mentioned, this is not the official BSP but rather a modified version so while it might work, it is recommended to use the original BSP configuration.

在原帖中查看解决方案

0 项奖励
6 回复数
1,266 次查看
norishinozaki
Contributor V

Hello,

I'd like to change PFD1_FRAC of the PLL3.

Do I need to follow the above sequence when just changing a PFD1 value?

BR.

N.S.

0 项奖励
1,266 次查看
gusarambula
NXP TechSupport
NXP TechSupport

Please follow the procedure as mentioned on the Reference Manual as this is the correct way in order to ensure a robust operation of the processor.

In the case of our BSP a software reset is required after setting the new PLL rate, that’s why a PLL power down/up does not appear in the code.

While bypassing the PLL is theoretically possible, behavior using this method cannot be guaranteed.

1,266 次查看
DirkBehme
Contributor III

First, many thanks for the quick answer!

As usual, I think it's essential to get the details correctly, so some more detailed questions:

1. While the question in this thread is specific to PLLv3, the answers apply to all PLLs, correct? I.e. we have to do the same for PLLv1, PLLv2 etc, correct?

2. I have some difficulty to match the section 18.5.1.5.3 PLL clock change - "Before changing the PLL setting, power it down. Power up the PLL after the change" to the register bits of the CCM_ANALOG_PLL_xxx registers. The CCM_ANALOG_PLL_xxx registers have 3 bits which seem to be involved in our discussion:


  • POWERDOWN
  • ENABLE
  • BYPASS

So the correct sequence to change the PLL rate is

a) Put the PLL in BYPASS by setting the BYPASS bit CCM_ANALOG_PLL_xxx[16] = 1 (or ensure in different way that the peripherals are not driven by the PLL clock we are switching, e.g. by disabling them or switching them to an other clock source)


b) Powerdown the PLL by setting the POWERDOWN bit CCM_ANALOG_PLL_xxx[12] = 1


c) Change the dividers


d) Powerup the PLL by setting the POWERDOWN bit CCM_ANALOG_PLL_xxx[12] = 0


e) Wait for lock (then the clock is stable)


f) Remove the BYPASS by setting the BYPASS bit CCM_ANALOG_PLL_xxx[16] = 0 (feed the peripherals with the new clock)


And while doing this, don't touch the ENABLE bit, i.e. keep the PLL enabled by CCM_ANALOG_PLL_xxx[13] = 1


Is this sequence correct?

3. In the recent FSL BSP the before changing the clock, the bypass is explicitly removed:

linux-2.6-imx.git - Freescale i.MX Linux Tree

Wouldn't this result in any clock glitch? Even if you reset afterwards?

0 项奖励
1,267 次查看
gusarambula
NXP TechSupport
NXP TechSupport

Yes, the answer applies to virtually all PLLs, except for the clocks that can’t be stopped, like the core clocks.

As for the sequence it is correct.

Regarding the i.MX linux tree mentioned, this is not the official BSP but rather a modified version so while it might work, it is recommended to use the original BSP configuration.

0 项奖励
1,266 次查看
DirkBehme
Contributor III
0 项奖励
1,266 次查看
karina_valencia
NXP Apps Support
NXP Apps Support

gusarambula can you continue with the follow up please?

0 项奖励