qualcommax: add ipq60xx support
[openwrt/staging/robimarko.git] / target / linux / qualcommax / files / arch / arm64 / boot / dts / qcom / ipq6018-cpr-regulator.dtsi
1 /*
2 * Copyright (c) 2019-2020 The Linux Foundation. All rights reserved.
3 *
4 * Permission to use, copy, modify, and/or distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 */
16
17 &soc {
18 apc_apm: apm@b111000 {
19 compatible = "qcom,ipq807x-apm";
20 reg = <0x0 0xb111000 0x0 0x1000>;
21 reg-names = "pm-apcc-glb";
22 qcom,apm-post-halt-delay = <0x2>;
23 qcom,apm-halt-clk-delay = <0x11>;
24 qcom,apm-resume-clk-delay = <0x10>;
25 qcom,apm-sel-switch-delay = <0x01>;
26 };
27
28 apc_cpr: cpr4-ctrl@b018000 {
29 compatible = "qcom,cpr4-ipq6018-apss-regulator";
30 reg = <0x0 0xb018000 0x0 0x4000>, <0x0 0xa4000 0x0 0x1000>, <0x0 0x0193d008 0x0 0x4>;
31 reg-names = "cpr_ctrl", "fuse_base", "cpr_tcsr_reg";
32 interrupts = <GIC_SPI 15 IRQ_TYPE_EDGE_RISING>;
33 interrupt-names = "cpr";
34 qcom,cpr-ctrl-name = "apc";
35 qcom,cpr-sensor-time = <1000>;
36 qcom,cpr-loop-time = <5000000>;
37 qcom,cpr-idle-cycles = <15>;
38 qcom,cpr-step-quot-init-min = <0>;
39 qcom,cpr-step-quot-init-max = <15>;
40 qcom,cpr-count-mode = <0>; /* All-at-once */
41 qcom,cpr-count-repeat = <1>;
42 qcom,cpr-down-error-step-limit = <1>;
43 qcom,cpr-up-error-step-limit = <1>;
44 qcom,apm-ctrl = <&apc_apm>;
45 qcom,apm-threshold-voltage = <850000>;
46 vdd-supply = <&ipq6018_s2>;
47 qcom,voltage-step = <12500>;
48
49 thread@0 {
50 qcom,cpr-thread-id = <0>;
51 qcom,cpr-consecutive-up = <2>;
52 qcom,cpr-consecutive-down = <2>;
53 qcom,cpr-up-threshold = <2>;
54 qcom,cpr-down-threshold = <2>;
55
56 apc_vreg: regulator {
57 regulator-name = "apc_corner";
58 regulator-min-microvolt = <1>;
59 regulator-max-microvolt = <6>;
60 qcom,cpr-fuse-corners = <4>;
61 qcom,cpr-fuse-combos = <8>;
62 qcom,cpr-corners = <6>;
63 qcom,cpr-speed-bins = <1>;
64 qcom,cpr-speed-bin-corners = <6>;
65 qcom,cpr-corner-fmax-map = <1 3 5 6>;
66 qcom,allow-voltage-interpolation;
67 qcom,allow-quotient-interpolation;
68 qcom,cpr-voltage-ceiling =
69 <725000 787500 862500
70 925000 987500 1062500>;
71 qcom,cpr-voltage-floor =
72 <587500 650000 712500
73 750000 787500 850000>;
74 qcom,corner-frequencies =
75 <864000000 1056000000 1320000000
76 1440000000 1608000000 1800000000>;
77 qcom,cpr-ro-sel =
78 /* Speed bin 0; CPR rev 0..7 */
79 < 0 0 0 0>,
80 < 7 7 7 7>,
81 < 0 0 0 0>,
82 < 0 0 0 0>,
83 < 0 0 0 0>,
84 < 0 0 0 0>,
85 < 0 0 0 0>,
86 < 0 0 0 0>;
87
88 qcom,cpr-open-loop-voltage-fuse-adjustment =
89 /* Speed bin 0; CPR rev 0..7 */
90 /* SVS Nominal Turbo Turbo_L1 */
91 < 0 0 0 0>,
92 < 0 0 15000 0>,
93 < 0 0 15000 0>,
94 < 0 0 0 0>,
95 < 0 0 0 0>,
96 < 0 0 0 0>,
97 < 0 0 0 0>,
98 < 0 0 0 0>;
99
100 qcom,cpr-closed-loop-voltage-fuse-adjustment =
101 /* Speed bin 0; CPR rev 0..7 */
102 < 0 0 0 0>,
103 < 13000 0 13000 13000>,
104 < 13000 0 13000 13000>,
105 < 0 0 0 0>,
106 < 0 0 0 0>,
107 < 0 0 0 0>,
108 < 0 0 0 0>,
109 < 0 0 0 0>;
110
111 qcom,cpr-ro-scaling-factor =
112 < 2000 1770 1900 1670 1930 1770 1910 1800
113 1870 1730 2000 1840 1800 2030 1700 1890 >,
114 < 2000 1770 1900 1670 1930 1770 1910 1800
115 1870 1730 2000 1840 1800 2030 1700 1890 >,
116 < 2000 1770 1900 1670 1930 1770 1910 1800
117 1870 1730 2000 1840 1800 2030 1700 1890 >,
118 < 2000 1770 1900 1670 1930 1770 1910 1800
119 1870 1730 2000 1840 1800 2030 1700 1890 >;
120 regulator-always-on;
121 };
122 };
123 };
124 };