How to set CPU frequency on u-boot?

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

How to set CPU frequency on u-boot?

3,727 次查看
LiLinfei
Contributor I

Hi,

How to set CPU frequency on u-boot?

Our machine must keep working at 800Mhz.But I see the frequency under U-boot is 396Mhz.

U-boot version : 2016.03

SOC:IMX6ULL 

Thanks!

标签 (1)
0 项奖励
回复
3 回复数

3,698 次查看
joanxie
NXP TechSupport
NXP TechSupport

you can find the cpu frequency settings in the dtsi file as below:

"https://source.codeaurora.org/external/imx/uboot-imx/tree/arch/arm/dts/imx6ull.dtsi?h=imx_v2019.04_4..."

0 项奖励
回复

3,564 次查看
avijitnsec
Contributor III

How to change the default frequency in the dts file? If I set it in the uboot, does it persist when kernel boots up? Or kernel overwrite the value? 

0 项奖励
回复

2,358 次查看
AlfTeleco
Contributor III

On the U-boot version U-Boot 2021.04-lf_v2021.04 write the CCM Arm Clock Root Register (CCM_CACRR) at the function get_mcu_main_clk() on the file /arch/arm/mach-imx/mx6/clock.c. The content of the function must be like this:

=====================================================================

u32 reg, freq;

reg = __raw_readl(&imx_ccm->cacrr);
reg &= ~MXC_CCM_CACRR_ARM_PODF_MASK;
__raw_writel(reg, &imx_ccm->cacrr);

reg = __raw_readl(&imx_ccm->cacrr);
reg &= MXC_CCM_CACRR_ARM_PODF_MASK;
reg >>= MXC_CCM_CACRR_ARM_PODF_OFFSET;
freq = decode_pll(PLL_SYS, MXC_HCLK);

return freq / (reg + 1);

=====================================================================

We are setting the register CCM_CACRR to have NO divider, like it is said in the datasheet:

AlfTeleco_0-1707405319109.png

Also boost the LDO_SOC voltage from 1.175 to 1.225 at the function /arch/arm/mach-imx/mx6/soc.c: board_postclk_init()

set_ldo_voltage(LDO_SOC, 1225); /* Set VDDSOC to 1.225V */

 

BR

0 项奖励
回复