RT5350 软件切换240Mhz低速模式

查RT5350的手册,找到一个寄存器位, 可以把RT5350从360Mhz降低到240Mhz, 写了2个补丁, 一个是uboot的,增加一个环境变量

 cpu_240mhz=y

 就可以让RT5350跑在240Mhz模式,

 cpu_240mhz=n 或者没有这个 变量, cpu会运行在360Mhz

另一个补丁是针对linux kernel的,让linux可以识别出运行在240Mhz模式, 否则,时钟会不准。

##### The CPU freq = 360 MHZ ####                                             
 estimate memory size =32 Mbytes                                               
                                
Please choose the operation:                                                   
   1: Load system code to SDRAM via TFTP.                                      
   2: Load system code then write to Flash via TFTP.                           
   3: Boot system code via Flash (default).                                    
   4: Entr boot command line interface.                                        
   7: Load Boot Loader code then write to Flash via Serial.                    
   9: Load Boot Loader code then write to Flash via TFTP.                      
                                                                               
You choosed 4
RT5350 # setenv cpu_240mhz   y                                                   
RT5350 # printenv cpu_240mhz                                                   
cpu_240mhz=y
RT5350 # reset
 ##### The CPU freq = 240 MHZ ####                                             
 estimate memory size =32 Mbytes                                               
                                                                               
Please choose the operation:                                                   
   1: Load system code to SDRAM via TFTP.                                      
   2: Load system code then write to Flash via TFTP.                           
   3: Boot system code via Flash (default).                                    
   4: Entr boot command line interface.                                        
   7: Load Boot Loader code then write to Flash via Serial.                    
   9: Load Boot Loader code then write to Flash via TFTP.

进入openwrt系统:
root@OpenWrt:/# dmesg |grep 240                                                
[    0.000000] CPU Clock: 240MHz

附件大小
ram_8m.img104.45 千字节
ram_16m.img104.45 千字节
ram_32m.img104.48 千字节
ram_64m.img104.45 千字节
openwrt.img3.75 兆字节
RT5350_240mhz_kernel.patch1.24 千字节
RT5350_240mhz_uboot.patch739 字节