当前位置: 代码迷 >> 综合 >> [RK3288][Android7.1] 调试笔记 --- 固定CPU频率
  详细解决方案

[RK3288][Android7.1] 调试笔记 --- 固定CPU频率

热度:82   发布时间:2023-10-09 13:40:43.0

Platform: RK3288
OS: Android 7.1.2
Kernel: v4.4.143

需求:

固定CPU频率

方法:

路径:/kernel/arch/arm/boot/dts/rk3288.dtsi

CPU默认为变频,代码如下;

cpu0_opp_table: opp_table0 {compatible = "operating-points-v2";opp-shared;clocks = <&cru PLL_APLL>;rockchip,avs-scale = <17>;rockchip,max-volt = <1350000>;nvmem-cells = <&cpu_leakage>, <&special_function>,<&performance>, <&process_version>,<&performance_w>;nvmem-cell-names = "leakage", "special","performance", "process","performance-w";rockchip,bin-scaling-sel = <0               171               252               273               31>;rockchip,pvtm-voltage-sel = <0        14300   014301    15000   115001    16000   216001    99999   3>;rockchip,pvtm-freq = <408000>;rockchip,pvtm-volt = <1000000>;rockchip,pvtm-ch = <0 0>;rockchip,pvtm-sample-time = <1000>;rockchip,pvtm-number = <10>;rockchip,pvtm-error = <1000>;rockchip,pvtm-ref-temp = <35>;rockchip,pvtm-temp-prop = <(-18) (-18)>;rockchip,thermal-zone = "soc-thermal";opp-126000000 {opp-hz = /bits/ 64 <126000000>;opp-microvolt = <950000 950000 1350000>;opp-microvolt-L0 = <950000 950000 1350000>;opp-microvolt-L1 = <950000 950000 1350000>;opp-microvolt-L2 = <950000 950000 1350000>;opp-microvolt-L3 = <950000 950000 1350000>;clock-latency-ns = <40000>;};opp-216000000 {opp-hz = /bits/ 64 <216000000>;opp-microvolt = <950000 950000 1350000>;opp-microvolt-L0 = <950000 950000 1350000>;opp-microvolt-L1 = <950000 950000 1350000>;opp-microvolt-L2 = <950000 950000 1350000>;opp-microvolt-L3 = <950000 950000 1350000>;clock-latency-ns = <40000>;};opp-408000000 {opp-hz = /bits/ 64 <408000000>;opp-microvolt = <975000 975000 1350000>;opp-microvolt-L0 = <975000 975000 1350000>;opp-microvolt-L1 = <950000 950000 1350000>;opp-microvolt-L2 = <950000 950000 1350000>;opp-microvolt-L3 = <950000 950000 1350000>;clock-latency-ns = <40000>;};opp-600000000 {opp-hz = /bits/ 64 <600000000>;opp-microvolt = <975000 975000 1350000>;opp-microvolt-L0 = <975000 975000 1350000>;opp-microvolt-L1 = <950000 950000 1350000>;opp-microvolt-L2 = <950000 950000 1350000>;opp-microvolt-L3 = <950000 950000 1350000>;clock-latency-ns = <40000>;};opp-696000000 {opp-hz = /bits/ 64 <696000000>;opp-microvolt = <975000 975000 1350000>;opp-microvolt-L0 = <975000 975000 1350000>;opp-microvolt-L1 = <950000 950000 1350000>;opp-microvolt-L2 = <950000 950000 1350000>;opp-microvolt-L3 = <950000 950000 1350000>;clock-latency-ns = <40000>;};opp-816000000 {opp-hz = /bits/ 64 <816000000>;opp-microvolt = <1075000 1075000 1350000>;opp-microvolt-L0 = <1075000 1075000 1350000>;opp-microvolt-L1 = <1050000 1050000 1350000>;opp-microvolt-L2 = <1000000 1000000 1350000>;opp-microvolt-L3 = <950000 950000 1350000>;clock-latency-ns = <40000>;opp-suspend;};opp-1008000000 {opp-hz = /bits/ 64 <1008000000>;opp-microvolt = <1150000 1150000 1350000>;opp-microvolt-L0 = <1150000 1150000 1350000>;opp-microvolt-L1 = <1100000 1100000 1350000>;opp-microvolt-L2 = <1050000 1050000 1350000>;opp-microvolt-L3 = <1000000 1000000 1350000>;clock-latency-ns = <40000>;};opp-1200000000 {opp-hz = /bits/ 64 <1200000000>;opp-microvolt = <1200000 1200000 1350000>;opp-microvolt-L0 = <1200000 1200000 1350000>;opp-microvolt-L1 = <1150000 1150000 1350000>;opp-microvolt-L2 = <1100000 1100000 1350000>;opp-microvolt-L3 = <1050000 1050000 1350000>;clock-latency-ns = <40000>;};opp-1416000000 {opp-hz = /bits/ 64 <1416000000>;opp-microvolt = <1300000 1300000 1350000>;opp-microvolt-L0 = <1300000 1300000 1350000>;opp-microvolt-L1 = <1250000 1250000 1350000>;opp-microvolt-L2 = <1200000 1200000 1350000>;opp-microvolt-L3 = <1150000 1150000 1350000>;clock-latency-ns = <40000>;};opp-1512000000 {opp-hz = /bits/ 64 <1512000000>;opp-microvolt = <1350000 1350000 1350000>;opp-microvolt-L0 = <1350000 1350000 1350000>;opp-microvolt-L1 = <1300000 1300000 1350000>;opp-microvolt-L2 = <1250000 1250000 1350000>;opp-microvolt-L3 = <1200000 1200000 1350000>;clock-latency-ns = <40000>;};opp-1608000000 {opp-hz = /bits/ 64 <1608000000>;opp-microvolt = <1350000 1350000 1350000>;opp-microvolt-L0 = <1350000 1350000 1350000>;opp-microvolt-L1 = <1350000 1350000 1350000>;opp-microvolt-L2 = <1300000 1300000 1350000>;opp-microvolt-L3 = <1250000 1250000 1350000>;clock-latency-ns = <40000>;};};

例如:固定频率两个频率,注释掉其他即可

cpu0_opp_table: opp_table0 {compatible = "operating-points-v2";opp-shared;clocks = <&cru PLL_APLL>;rockchip,avs-scale = <17>;rockchip,max-volt = <1350000>;nvmem-cells = <&cpu_leakage>, <&special_function>,<&performance>, <&process_version>,<&performance_w>;nvmem-cell-names = "leakage", "special","performance", "process","performance-w";rockchip,bin-scaling-sel = <0               171               252               273               31>;rockchip,pvtm-voltage-sel = <0        14300   014301    15000   115001    16000   216001    99999   3>;rockchip,pvtm-freq = <408000>;rockchip,pvtm-volt = <1000000>;rockchip,pvtm-ch = <0 0>;rockchip,pvtm-sample-time = <1000>;rockchip,pvtm-number = <10>;rockchip,pvtm-error = <1000>;rockchip,pvtm-ref-temp = <35>;rockchip,pvtm-temp-prop = <(-18) (-18)>;rockchip,thermal-zone = "soc-thermal";/*opp-126000000 {opp-hz = /bits/ 64 <126000000>;opp-microvolt = <950000 950000 1350000>;opp-microvolt-L0 = <950000 950000 1350000>;opp-microvolt-L1 = <950000 950000 1350000>;opp-microvolt-L2 = <950000 950000 1350000>;opp-microvolt-L3 = <950000 950000 1350000>;clock-latency-ns = <40000>;};opp-216000000 {opp-hz = /bits/ 64 <216000000>;opp-microvolt = <950000 950000 1350000>;opp-microvolt-L0 = <950000 950000 1350000>;opp-microvolt-L1 = <950000 950000 1350000>;opp-microvolt-L2 = <950000 950000 1350000>;opp-microvolt-L3 = <950000 950000 1350000>;clock-latency-ns = <40000>;};opp-408000000 {opp-hz = /bits/ 64 <408000000>;opp-microvolt = <975000 975000 1350000>;opp-microvolt-L0 = <975000 975000 1350000>;opp-microvolt-L1 = <950000 950000 1350000>;opp-microvolt-L2 = <950000 950000 1350000>;opp-microvolt-L3 = <950000 950000 1350000>;clock-latency-ns = <40000>;};opp-600000000 {opp-hz = /bits/ 64 <600000000>;opp-microvolt = <975000 975000 1350000>;opp-microvolt-L0 = <975000 975000 1350000>;opp-microvolt-L1 = <950000 950000 1350000>;opp-microvolt-L2 = <950000 950000 1350000>;opp-microvolt-L3 = <950000 950000 1350000>;clock-latency-ns = <40000>;};opp-696000000 {opp-hz = /bits/ 64 <696000000>;opp-microvolt = <975000 975000 1350000>;opp-microvolt-L0 = <975000 975000 1350000>;opp-microvolt-L1 = <950000 950000 1350000>;opp-microvolt-L2 = <950000 950000 1350000>;opp-microvolt-L3 = <950000 950000 1350000>;clock-latency-ns = <40000>;};opp-816000000 {opp-hz = /bits/ 64 <816000000>;opp-microvolt = <1075000 1075000 1350000>;opp-microvolt-L0 = <1075000 1075000 1350000>;opp-microvolt-L1 = <1050000 1050000 1350000>;opp-microvolt-L2 = <1000000 1000000 1350000>;opp-microvolt-L3 = <950000 950000 1350000>;clock-latency-ns = <40000>;opp-suspend;};opp-1008000000 {opp-hz = /bits/ 64 <1008000000>;opp-microvolt = <1150000 1150000 1350000>;opp-microvolt-L0 = <1150000 1150000 1350000>;opp-microvolt-L1 = <1100000 1100000 1350000>;opp-microvolt-L2 = <1050000 1050000 1350000>;opp-microvolt-L3 = <1000000 1000000 1350000>;clock-latency-ns = <40000>;};opp-1200000000 {opp-hz = /bits/ 64 <1200000000>;opp-microvolt = <1200000 1200000 1350000>;opp-microvolt-L0 = <1200000 1200000 1350000>;opp-microvolt-L1 = <1150000 1150000 1350000>;opp-microvolt-L2 = <1100000 1100000 1350000>;opp-microvolt-L3 = <1050000 1050000 1350000>;clock-latency-ns = <40000>;};*/opp-1416000000 {opp-hz = /bits/ 64 <1416000000>;opp-microvolt = <1300000 1300000 1350000>;opp-microvolt-L0 = <1300000 1300000 1350000>;opp-microvolt-L1 = <1250000 1250000 1350000>;opp-microvolt-L2 = <1200000 1200000 1350000>;opp-microvolt-L3 = <1150000 1150000 1350000>;clock-latency-ns = <40000>;};opp-1512000000 {opp-hz = /bits/ 64 <1512000000>;opp-microvolt = <1350000 1350000 1350000>;opp-microvolt-L0 = <1350000 1350000 1350000>;opp-microvolt-L1 = <1300000 1300000 1350000>;opp-microvolt-L2 = <1250000 1250000 1350000>;opp-microvolt-L3 = <1200000 1200000 1350000>;clock-latency-ns = <40000>;};/*opp-1608000000 {opp-hz = /bits/ 64 <1608000000>;opp-microvolt = <1350000 1350000 1350000>;opp-microvolt-L0 = <1350000 1350000 1350000>;opp-microvolt-L1 = <1350000 1350000 1350000>;opp-microvolt-L2 = <1300000 1300000 1350000>;opp-microvolt-L3 = <1250000 1250000 1350000>;clock-latency-ns = <40000>;};*/};

调试方法:

参看文档:[RK3288][Android6.0] CPU频率调度策略小结

  相关解决方案