Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c780c79f authored by David Collins's avatar David Collins
Browse files

ARM: dts: msm: use SW closed-loop voltage margins for VDD_APCC on msm8996v3



Change the VDD_APCC CPR open-loop and closed-loop voltage margins
in order to match the optimized values found via characterization
when using software closed-loop CPR.  Also switch from hardware
closed-loop to software closed-loop CPR operation.  This ensures
that software can recalibrate some of the HMSS hardware blocks
after each VDD_APCC CPR up or down voltage step.

Reduce the max floor-to-ceiling voltage range for the lowest
corner of the apc1_vreg regulator in order to guarantee stable
operation of the performance cluster when it resumes from power
collapse.

Characterization has found that VDD_APCC closed-loop CPR
behavior can be improved by using different CPR controller
parameters.  Change the CPR count mode from staggered to all-
at-once minimum with a repetition count of 25.  Also change
the up-threshold to 2 and the consecutive-down count to 3 for
both CPR hardware threads.

Change-Id: I8fe2220bb7976f9e373a93ab525eb6e75184dfe2
Signed-off-by: default avatarDavid Collins <collinsd@codeaurora.org>
parent ff7ec0d1
Loading
Loading
Loading
Loading
+75 −75
Original line number Diff line number Diff line
@@ -564,7 +564,8 @@
		qcom,cpr-up-down-delay-time = <3000>;
		qcom,cpr-step-quot-init-min = <11>;
		qcom,cpr-step-quot-init-max = <13>;
		qcom,cpr-count-mode = <2>;		/* Staggered */
		qcom,cpr-count-mode = <0>;		/* All-at-once min */
		qcom,cpr-count-repeat = <25>;

		qcom,apm-ctrl = <&apc_apm>;
		qcom,apm-threshold-voltage = <850000>;
@@ -579,14 +580,13 @@
		vdd-thread1-ldo-ret-supply = <&kryo1_retention_vreg>;

		qcom,cpr-enable;
		qcom,cpr-hw-closed-loop;
		qcom,cpr-clock-throttling = <0x20>;

		thread@0 {
			qcom,cpr-thread-id = <0>;
			qcom,cpr-consecutive-up = <0>;
			qcom,cpr-consecutive-down = <2>;
			qcom,cpr-up-threshold = <0>;
			qcom,cpr-consecutive-down = <3>;
			qcom,cpr-up-threshold = <2>;
			qcom,cpr-down-threshold = <2>;

			apc0_pwrcl_vreg: regulator-pwrcl {
@@ -641,37 +641,37 @@
				       2519 2257 2668 2372    0    0    0    0>;

				qcom,cpr-open-loop-voltage-fuse-adjustment =
					<25000 0 0 (-25000) (-25000)>,
					<25000 0 0 (-25000) (-25000)>,
					<25000 0 0 (-25000) (-25000)>,
					<25000 0 0 (-25000) (-25000)>,
					<25000 0 0 0 0>,
					<25000 0 0 0 0>,
					<25000 0 0 0 0>,
					<25000 0 0 0 0>;
					<45000     0 50000  20000   15000>,
					<45000     0 50000  20000   15000>,
					<45000     0 50000  20000   15000>,
					<45000     0 50000  20000   15000>,
					<45000     0 50000  20000   15000>,
					<45000     0 50000  20000   15000>,
					<45000     0 50000  20000   15000>,
					<45000     0 50000  20000   15000>;
				qcom,cpr-closed-loop-voltage-fuse-adjustment =
					<25000 10000 0 0 0>,
					<25000 10000 0 0 0>,
					<25000 10000 0 0 0>,
					<25000 10000 0 0 0>,
					<25000 10000 0 0 0>,
					<25000 10000 0 0 0>,
					<25000 10000 0 0 0>,
					<25000 10000 0 0 0>;
					<35000 35000 40000  40000   40000>,
					<20000 10000  5000 (-5000) (-5000)>,
					<20000 10000  5000 (-5000) (-5000)>,
					<20000 10000  5000 (-5000) (-5000)>,
					<20000 10000  5000 (-5000) (-5000)>,
					<20000 10000  5000 (-5000) (-5000)>,
					<20000 10000  5000 (-5000) (-5000)>,
					<20000 10000  5000 (-5000) (-5000)>;

				qcom,cpr-open-loop-voltage-adjustment =
					<(-15000) (-15000) (-15000) (-15000)
					 (-33000) (-34000) (-35000) (-38000)
					 (-40000) (-42000) (-44000) (-45000)
					 (-46000) (-47000) (-48000) (-50000)>;
					 (-13000) (-14000) (-15000) (-18000)
					 (-20000) (-22000) (-24000) (-25000)
					 (-26000) (-27000) (-28000) (-30000)>;
				qcom,cpr-open-loop-voltage-min-diff =
				       <0 0 0 0 (-50000) 0 0 0 0 0 0 0 0 0 0 0>;

				qcom,cpr-closed-loop-voltage-adjustment =
					<(-10000) (-10000) (-10000) (-10000)
						0        0        0        0
						0        0        0        0
						0        0        0        0>;
					<(-15000) (-15000) (-15000) (-15000)
					 (-13000) (-14000) (-15000) (-18000)
					 (-20000) (-22000) (-24000) (-25000)
					 (-26000) (-27000) (-28000) (-30000)>;

				qcom,allow-voltage-interpolation;
				qcom,allow-quotient-interpolation;
@@ -728,23 +728,23 @@
				       2519 2257 2668 2372    0    0    0    0>;

				qcom,cpr-open-loop-voltage-fuse-adjustment =
					<10000 5000 (-60000) (-35000) (-60000)>,
					<10000 5000 (-60000) (-35000) (-60000)>,
					<10000 5000 (-60000) (-35000) (-60000)>,
					<10000 5000 (-60000) (-35000) (-60000)>,
					<10000 5000 0 0 0>,
					<10000 5000 0 0 0>,
					<10000 5000 0 0 0>,
					<10000 5000 0 0 0>;
					<55000    0   15000    15000  (-15000)>,
					<55000    0   15000    15000  (-15000)>,
					<55000    0   15000    15000  (-15000)>,
					<55000    0   15000    15000  (-15000)>,
					<55000    0   15000    15000  (-15000)>,
					<55000    0   15000    15000  (-15000)>,
					<55000    0   15000    15000  (-15000)>,
					<55000    0   15000    15000  (-15000)>;
				qcom,cpr-closed-loop-voltage-fuse-adjustment =
					<10000 5000 (-10000) (-10000) (-10000)>,
					<10000 5000 (-10000) (-10000) (-10000)>,
					<10000 5000 (-10000) (-10000) (-10000)>,
					<10000 5000 (-10000) (-10000) (-10000)>,
					<10000 5000 0 0 0>,
					<10000 5000        0        0        0>,
					<10000 5000 0 0 0>,
					<10000 5000 0 0 0>;
					<10000 5000 (-20000)        0 (-35000)>,
					<10000 5000 (-20000)        0 (-35000)>,
					<10000 5000 (-20000)        0 (-35000)>,
					<10000 5000 (-20000)        0 (-35000)>,
					<10000 5000 (-20000)        0 (-35000)>,
					<10000 5000 (-20000)        0 (-35000)>,
					<10000 5000 (-20000)        0 (-35000)>;

				qcom,allow-voltage-interpolation;
				qcom,allow-quotient-interpolation;
@@ -755,8 +755,8 @@
		thread@1 {
			qcom,cpr-thread-id = <1>;
			qcom,cpr-consecutive-up = <0>;
			qcom,cpr-consecutive-down = <2>;
			qcom,cpr-up-threshold = <0>;
			qcom,cpr-consecutive-down = <3>;
			qcom,cpr-up-threshold = <2>;
			qcom,cpr-down-threshold = <2>;

			apc1_vreg: regulator {
@@ -787,7 +787,7 @@
					470000  470000  470000  470000  470000
					470000  470000  470000  470000  470000>;
				qcom,cpr-floor-to-ceiling-max-range =
					<80000   80000   80000   80000   80000
					<    0   80000   80000   80000   80000
					 80000   80000   80000   80000   80000
					 80000   80000   80000   80000   80000
					 80000   80000   80000   80000   80000
@@ -817,17 +817,17 @@
				       2519 2257 2668 2372    0    0    0    0>;

				qcom,cpr-open-loop-voltage-fuse-adjustment =
					<0 0 0 (-65000) (-20000)>,
					<0 0 0 (-65000) (-20000)>,
					<0 0 0 (-25000) (-20000)>,
					<0 0 0 (-25000) (-20000)>,
					<0 0 0 0 0>,
					<0 0 0 0 0>,
					<0 0 0 0 0>,
					<0 0 0 0 0>;
					<35000     0 40000 (-30000) 25000>,
					<35000     0 40000 (-30000) 25000>,
					<35000     0 40000   25000  25000>,
					<35000     0 40000   25000  25000>,
					<35000     0 40000   25000  25000>,
					<35000     0 40000   25000  25000>,
					<35000     0 40000   25000  25000>,
					<35000     0 40000   25000  25000>;
				qcom,cpr-closed-loop-voltage-fuse-adjustment =
					<0 0 0 0 0>,
					<0 0 0 0 0>,
					<35000 35000 40000 (-30000) 40000>,
					<    0     0     0 (-70000)     0>,
					<    0     0     0        0     0>,
					<    0     0     0        0     0>,
					<    0     0     0        0     0>,
@@ -837,24 +837,24 @@

				qcom,cpr-open-loop-voltage-adjustment =
					<(-15000) (-15000) (-15000) (-15000)
					 (-31000) (-32000) (-33000) (-34000)
					 (-35000) (-38000) (-41000) (-43000)
					 (-45000) (-45000) (-46000) (-46000)
					 (-47000) (-47000) (-48000) (-48000)
					 (-48000) (-49000) (-49000) (-50000)
					 (-50000)>;
					 (-11000) (-12000) (-13000) (-14000)
					 (-15000) (-18000) (-21000) (-23000)
					 (-25000) (-25000) (-26000) (-26000)
					 (-27000) (-27000) (-28000) (-28000)
					 (-28000) (-29000) (-29000) (-30000)
					 (-30000)>;
				qcom,cpr-open-loop-voltage-min-diff =
					<0 0 0 0 (-50000) 0 0 0 0 0 0 0 0 0 0 0
					 0 0 0 0 0 0 0 0 0>;

				qcom,cpr-closed-loop-voltage-adjustment =
					<(-10000) (-10000) (-10000) (-10000)
						0        0        0        0
						0        0        0        0
						0        0        0        0
						0        0        0        0
						0        0        0        0
						0>;
					<(-15000) (-15000) (-15000) (-15000)
					 (-11000) (-12000) (-13000) (-14000)
					 (-15000) (-18000) (-21000) (-23000)
					 (-25000) (-25000) (-26000) (-26000)
					 (-27000) (-27000) (-28000) (-28000)
					 (-28000) (-29000) (-29000) (-30000)
					 (-30000)>;

				qcom,allow-voltage-interpolation;
				qcom,allow-quotient-interpolation;
+14 −0
Original line number Diff line number Diff line
@@ -73,11 +73,25 @@
&apcc_cpr {
	compatible = "qcom,cpr3-msm8996-v2-hmss-regulator";

	qcom,cpr-count-mode = <2>;		/* Staggered */
	/delete-property/ qcom,cpr-count-repeat;

	qcom,apm-ctrl = <&apc_apm>;
	qcom,apm-threshold-voltage = <850000>;
	qcom,apm-hysteresis-voltage = <5000>;

	qcom,cpr-enable;
	qcom,cpr-hw-closed-loop;

	thread@0 {
		qcom,cpr-consecutive-down = <2>;
		qcom,cpr-up-threshold = <0>;
	};

	thread@1 {
		qcom,cpr-consecutive-down = <2>;
		qcom,cpr-up-threshold = <0>;
	};
};

&apc0_pwrcl_vreg {