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!
you can find the cpu frequency settings in the dtsi file as below:
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?
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:
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