请教T113运行主频的设置问题
-
使用芒果派小麻雀板的T113做测试,CPU运行主频高于800MHz,切换时就跑飞。测试代码如下,请求大佬们支招:
#define CPU_RUN_FREQ 1200000000 #define SYS_XTOSC_CLK 24000000 static void set_pll_cpux_axi(void) { uint32_t val; int n = (CPU_RUN_FREQ / SYS_XTOSC_CLK -1 ) & 0xFF; /* Switch to PLL_PERI(1X) clock while changing cpu pll (600MHz) */ CCU_CPU_AXI_CFG = (4<<24) ; sdelay(10000); /* cpu pll rate = 24000000 * n */ val = PLL_CPU_CTRL_REG & (~((0xff << 8) | (1 << 27))); val |= (n << 8); PLL_CPU_CTRL_REG = val; PLL_CPU_CTRL_REG &= ~(1 << 29); sdelay(5); PLL_CPU_CTRL_REG |= (1 << 29); sdelay(1000); while( (PLL_CPU_CTRL_REG &(1 << 28)) == 0 ); /* wait for pll lock */ PLL_CPU_CTRL_REG |= (1 << 27); /* open pll out gate */ sdelay(10000); /* Switch clock source */ CCU_CPU_AXI_CFG = (3 << 24); sdelay(10000); }
这一句CCU_CPU_AXI_CFG = (3 << 24)一执行,CPU就跑飞了.
请求支援。期待中。 -
Copyright © 2024 深圳全志在线有限公司 粤ICP备2021084185号 粤公网安备44030502007680号