rk3368 dvfs 相关的一些理解

dts 文件
&clk_core_b_dvfs_table {
	operating-points = <
		/* KHz    uV */
		216000 950000
		312000 950000
		408000 950000
		600000 950000
		696000 950000
		816000 975000
		1008000 1050000
		//1200000 1150000
		//1296000 1225000
		>;
	status = "okay";
};

&clk_core_l_dvfs_table {
	operating-points = <
		/* KHz    uV */
		216000 950000
		312000 950000
		408000 950000
		600000 950000
		696000 975000
		816000 1025000
		1008000 1050000
		//1200000 1225000
		>;
	status = "okay";
};

rk3368 有8个 cpu , 4个大 A53 4个小 A53

clk_core_b_dvfs_table 为 大A53 的频率电压表   clk_core_l_dvfs_table 为小A53 的频率电压表。


在降频调试的过程中,我把 


		rk818_dcdc2_reg: regulator@1 {
			regulator-name= "vdd_arm";/*vcc arm*/
			regulator-min-microvolt = <700000>;
			regulator-max-microvolt = <1500000>;
			regulator-initial-mode = <0x2>;
			regulator-initial-state = <3>; 
			regulator-state-mem {
				regulator-state-mode = <0x2>;
				regulator-state-enabled;
				regulator-state-uv = <900000>;
			};
		};

中的 regulator-max-microvolt = <1500000>;  降低到 1050000,开机的时候始终报 找不 1075000 的错误。

[    5.353620]  [1:  cfinteractive:   88] DVFS DBG:     dvfs_target:clk_core_b new rate=1008000000(was=816000000),new volt=1075000,(was=1000000)
[    5.353704]  [1:  cfinteractive:   88] DVFS DBG:     dvfs_scale_volt_direct: volt=1075000(old=1000000)
[    5.353785]  [1:  cfinteractive:   88] vdd_arm: unsupportable voltage range: 1075000-1050000uV
[    5.353860]  [1:  cfinteractive:   88] DVFS ERR:     dvfs_regulator_set_voltage_readback: now read back to check voltage


怀疑代码自己内部写,而没有用到 dts 的表。

把代码里所有含1075000 和 1075 * 1000 的地方全改了,仍然有 1075000 不能设置的错误。

查了两天跟踪代码,发现是在 

arch/arm/mach-rockchip/dvfs.c 里的adjust_table_by_leakage 做了手脚:即电压被调整了 2500mV ,如 1050000 + 2500 = 1075000.

在 dts 里面有配置(rk3368.dtsi)

                                        lkg_adjust_volt_en = <1>;
					channel = <0>;
					tsadc-ch = <0>;
					def_table_lkg = <25>;
					min_adjust_freq = <216000>;
					lkg_adjust_volt_table = <
						/*lkg(mA)  volt(uV)*/
						0         25000
						>;

pmu 的限制电压 改成 regulator-max-microvolt = <1075000> 之后就不会报错了,电压降下去了。


你可能感兴趣的:(android)