summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2016-12-31 02:17:47 -0800
committerGerrit - the friendly Code Review server <code-review@localhost>2016-12-31 02:17:46 -0800
commit89c77097ad8679e1424797a6f6755328da7aed0a (patch)
tree010f6eb9cfc012407c8498e8116bf4805d39ce5d
parent0d0e807793f1d4bb2308498dc03319ff1d611c95 (diff)
parent421bb324499eb26609215b413248b9ea7149f9cd (diff)
Merge "ARM: dts: msm: Add GFX CPR device configuration for sdm660"
-rw-r--r--arch/arm/boot/dts/qcom/msm8998-interposer-pm660.dtsi6
-rw-r--r--arch/arm/boot/dts/qcom/sdm660-regulator.dtsi144
-rw-r--r--drivers/regulator/cpr4-mmss-ldo-regulator.c12
3 files changed, 153 insertions, 9 deletions
diff --git a/arch/arm/boot/dts/qcom/msm8998-interposer-pm660.dtsi b/arch/arm/boot/dts/qcom/msm8998-interposer-pm660.dtsi
index d29faacab5ee..a13475085e58 100644
--- a/arch/arm/boot/dts/qcom/msm8998-interposer-pm660.dtsi
+++ b/arch/arm/boot/dts/qcom/msm8998-interposer-pm660.dtsi
@@ -239,3 +239,9 @@
#include "msm-pm660-rpm-regulator.dtsi"
#include "msm-pm660l-rpm-regulator.dtsi"
#include "sdm660-regulator.dtsi"
+
+&soc {
+ /* remove sdm660 MMSS CPR Controller node */
+ /delete-node/cpr4-ctrl@05061000;
+ /delete-node/regulator@01fcf004;
+};
diff --git a/arch/arm/boot/dts/qcom/sdm660-regulator.dtsi b/arch/arm/boot/dts/qcom/sdm660-regulator.dtsi
index 4869a8af08d6..fc88c324e5e2 100644
--- a/arch/arm/boot/dts/qcom/sdm660-regulator.dtsi
+++ b/arch/arm/boot/dts/qcom/sdm660-regulator.dtsi
@@ -10,6 +10,10 @@
* GNU General Public License for more details.
*/
+#include <dt-bindings/clock/qcom,gpu-sdm660.h>
+#include <dt-bindings/clock/qcom,rpmcc.h>
+#include <dt-bindings/interrupt-controller/arm-gic.h>
+
&rpm_bus {
rpm-regulator-smpa4 {
status = "okay";
@@ -489,10 +493,144 @@
/* Stub regulators */
/ {
/* GFX Supply */
- gfx_vreg_corner: regulator-gfx-corner {
+ gfx_stub_vreg: regulator-gfx-stub {
compatible = "qcom,stub-regulator";
- regulator-name = "gfx_corner";
+ regulator-name = "gfx_stub_corner";
+ regulator-min-microvolt = <400000>;
+ regulator-max-microvolt = <1070000>;
+ };
+};
+
+&soc {
+ /* MEM ACC regulators */
+ gfx_mem_acc_vreg: regulator@01fcf004 {
+ compatible = "qcom,mem-acc-regulator";
+ reg = <0x01fcf004 0x4>;
+ reg-names = "acc-sel-l1";
+ regulator-name = "gfx_mem_acc_corner";
regulator-min-microvolt = <1>;
- regulator-max-microvolt = <7>;
+ regulator-max-microvolt = <2>;
+
+ qcom,corner-acc-map = <0x1 0x0>;
+ qcom,acc-sel-l1-bit-pos = <0>;
+ qcom,acc-sel-l1-bit-size = <1>;
+ };
+
+ gfx_ldo_vreg: ldo@0506e000 {
+ compatible = "qcom,sdm660-gfx-ldo";
+ reg = <0x0506e000 0x34>;
+ reg-names = "ldo_addr";
+ regulator-name = "msm_gfx_ldo";
+ regulator-min-microvolt = <400000>;
+ regulator-max-microvolt = <925000>;
+ };
+
+/* CPR controller regulators */
+ /* MMSS CPR Controller node */
+ gfx_cpr: cpr4-ctrl@05061000 {
+ compatible = "qcom,cpr4-sdm660-mmss-ldo-regulator";
+ reg = <0x05061000 0x4000>, <0x00784000 0x1000>;
+ reg-names = "cpr_ctrl", "fuse_base";
+ clocks = <&clock_gfx GPUCC_RBCPR_CLK>,
+ <&clock_rpmcc RPM_CNOC_CLK>;
+ clock-names = "core_clk", "bus_clk";
+ interrupts = <GIC_SPI 285 IRQ_TYPE_EDGE_RISING>;
+ interrupt-names = "cpr";
+ qcom,cpr-ctrl-name = "gfx";
+
+
+ qcom,cpr-sensor-time = <1000>;
+ qcom,cpr-loop-time = <5000000>;
+ qcom,cpr-idle-cycles = <15>;
+ qcom,cpr-step-quot-init-min = <12>;
+ qcom,cpr-step-quot-init-max = <14>;
+ qcom,cpr-count-mode = <0>; /* All at once */
+ qcom,cpr-count-repeat = <14>;
+
+ vdd-supply = <&gfx_stub_vreg>;
+ mem-acc-supply = <&gfx_mem_acc_vreg>;
+ system-supply = <&pm660l_s3_level>; /* vdd_cx */
+ qcom,voltage-step = <5000>;
+ vdd-thread0-ldo-supply = <&gfx_ldo_vreg>;
+
+ thread@0 {
+ qcom,cpr-thread-id = <0>;
+ qcom,cpr-consecutive-up = <0>;
+ qcom,cpr-consecutive-down = <2>;
+ qcom,cpr-up-threshold = <2>;
+ qcom,cpr-down-threshold = <2>;
+
+ gfx_vreg_corner: regulator {
+ regulator-name = "gfx_corner";
+ regulator-min-microvolt = <1>;
+ regulator-max-microvolt = <7>;
+
+ qcom,cpr-fuse-corners = <6>;
+ qcom,cpr-fuse-combos = <8>;
+ qcom,cpr-corners = <7>;
+
+ qcom,cpr-corner-fmax-map = <1 2 3 4 5 6>;
+
+ qcom,cpr-voltage-ceiling =
+ <585000 645000 725000 790000
+ 870000 925000 1070000>;
+ qcom,cpr-voltage-floor =
+ <504000 504000 596000 652000
+ 712000 744000 1070000>;
+
+ qcom,mem-acc-voltage = <1 1 1 2 2 2 2>;
+ qcom,system-voltage =
+ <RPM_SMD_REGULATOR_LEVEL_LOW_SVS>,
+ <RPM_SMD_REGULATOR_LEVEL_LOW_SVS>,
+ <RPM_SMD_REGULATOR_LEVEL_SVS>,
+ <RPM_SMD_REGULATOR_LEVEL_SVS_PLUS>,
+ <RPM_SMD_REGULATOR_LEVEL_NOM>,
+ <RPM_SMD_REGULATOR_LEVEL_NOM_PLUS>,
+ <RPM_SMD_REGULATOR_LEVEL_TURBO>;
+
+ qcom,corner-frequencies =
+ <160000000 266000000 370000000
+ 465000000 588000000 647000000
+ 800000000>;
+
+ qcom,cpr-target-quotients =
+ <0 0 0 0 0 0 202 193
+ 331 326 337 345 0 0 0 0>,
+ <0 0 0 0 0 0 202 193
+ 331 326 337 345 0 0 0 0>,
+ <0 0 0 0 0 0 317 300
+ 476 463 489 489 0 0 0 0>,
+ <0 0 0 0 0 0 411 387
+ 595 572 611 602 0 0 0 0>,
+ <0 0 0 0 0 0 522 489
+ 727 696 748 732 0 0 0 0>,
+ <0 0 0 0 0 0 606 568
+ 818 786 848 826 0 0 0 0>,
+ <0 0 0 0 0 0 0 0
+ 0 0 0 0 0 0 0 0>;
+
+ qcom,cpr-ro-scaling-factor =
+ < 0 0 0 0 0 0 1740 1620
+ 2040 1960 2160 2040 0 0 0 0>,
+ < 0 0 0 0 0 0 1740 1620
+ 2040 1960 2160 2040 0 0 0 0>,
+ < 0 0 0 0 0 0 1740 1620
+ 2040 1960 2160 2040 0 0 0 0>,
+ < 0 0 0 0 0 0 1740 1620
+ 2040 1960 2160 2040 0 0 0 0>,
+ < 0 0 0 0 0 0 1740 1620
+ 2040 1960 2160 2040 0 0 0 0>,
+ < 0 0 0 0 0 0 1740 1620
+ 2040 1960 2160 2040 0 0 0 0>,
+ < 0 0 0 0 0 0 0 0
+ 0 0 0 0 0 0 0 0>;
+
+ qcom,cpr-scaled-open-loop-voltage-as-ceiling;
+ qcom,cpr-corner-allow-ldo-mode =
+ <0 0 0 0 0 0 0>;
+ qcom,cpr-corner-allow-closed-loop =
+ <0 0 0 0 0 0 0>;
+ };
+ };
};
};
diff --git a/drivers/regulator/cpr4-mmss-ldo-regulator.c b/drivers/regulator/cpr4-mmss-ldo-regulator.c
index 69c11a9e5da2..2843f71745fc 100644
--- a/drivers/regulator/cpr4-mmss-ldo-regulator.c
+++ b/drivers/regulator/cpr4-mmss-ldo-regulator.c
@@ -122,12 +122,12 @@ static const struct cpr3_fuse_param sdm660_ldo_cpr_cl_enable_param[] = {
/* Open loop voltage fuse reference voltages in microvolts */
static const int sdm660_mmss_fuse_ref_volt[SDM660_MMSS_FUSE_CORNERS] = {
- 584000,
- 644000,
- 724000,
- 788000,
- 868000,
- 924000,
+ 585000,
+ 645000,
+ 725000,
+ 790000,
+ 870000,
+ 925000,
};
#define SDM660_MMSS_FUSE_STEP_VOLT 10000