iMX6 - how to change DDR PFD frequency

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

iMX6 - how to change DDR PFD frequency

跳至解决方案
2,305 次查看
nickbedbury
Contributor III

I'd like to change the frequency of the iMX6UL DDR clock via the PFD divider. 

I've been able to change register "CCM_ANALOG_PFD_528n" field "PFD2_FRAC" in uboot and see clock adjust accordingly.  However, after changing the fractional divider value, the "PFD2_STABLE" bit never shows stable (1), it stays (0).

What is the proper sequence of register writes so that the PFD is stable after editing?

I've read through EB790 (https://www.nxp.com/docs/en/engineering-bulletin/EB790.pdf ) but it does not seem to give an example of changing the frequency divider, just disabling or bypassing altogether.

标签 (2)
0 项奖励
回复
1 解答
1,959 次查看
nickbedbury
Contributor III

Upon further reading of the IMX6ULRM, I re-read this section:

pastedImage_1.png

This seems to imply that the PFD2_STABLE bit will merely invert when stable...so won't necessarily be (1).  So perhaps it is fine that the bit remains (0) after I adjust the divider, as it was (1) previously.

Is this is a correct interpretation?

在原帖中查看解决方案

0 项奖励
回复
5 回复数
1,960 次查看
nickbedbury
Contributor III

Upon further reading of the IMX6ULRM, I re-read this section:

pastedImage_1.png

This seems to imply that the PFD2_STABLE bit will merely invert when stable...so won't necessarily be (1).  So perhaps it is fine that the bit remains (0) after I adjust the divider, as it was (1) previously.

Is this is a correct interpretation?

0 项奖励
回复
1,959 次查看
igorpadykov
NXP Employee
NXP Employee

yes this is correct interpretation.

Best regards
igor

0 项奖励
回复
1,959 次查看
igorpadykov
NXP Employee
NXP Employee

Hi Nick

examples of changing ddr frequency can be found in

llinux..arm/mach-imx/busfreq_ddr3.c, ddr3_freq_imx6sx.S

mach-imx\arm\arch - linux-imx - i.MX Linux kernel 

and description in sect.2.5.4 Dynamic Bus Frequency attached Linux Manual.

Note ddr freqeuncy changing should be done from OCRAM, not by code running on ddr.

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励
回复
1,959 次查看
nickbedbury
Contributor III

Hi igor,

Is there an example of doing this in u-boot? I am using mainline u-boot based on the iMX6UL EVK board.

My initial inclination is to put a modification in the `imximage.cfg` DCD script, but it looks like there's some loops involved in the assembly code you linked...so that would be difficult with plain register writes that the DCD script allows.

Is there a u-boot C function that already exists for modifying DDR clock (and perhaps calls the underlying assembly code you mentioned)? 

0 项奖励
回复
1,959 次查看
igorpadykov
NXP Employee
NXP Employee

Hi Nick

nxp uboot does not support modifying ddr clock, in general one can look

at spl uboot:

ventana/bootloader – Gateworks 

Best regards
igor

0 项奖励
回复