aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladimir Zapolskiy <vladimir.zapolskiy@linaro.org>2021-11-01 13:44:22 +0200
committerVladimir Zapolskiy <vladimir.zapolskiy@linaro.org>2021-11-08 01:20:31 +0200
commitd5fc770ffe4adcc0ecb8ad7e35230ecc24e43ab9 (patch)
tree9c0c8e51a125d891d1bdcd04843508e718b1b8a4
parent2796d3adeff42ab3f4ed429f41adba553b441a17 (diff)
soc: qcom: cpr3: Add CPR3 MMSS changes for msm8996msm8996-cpr3-wip
Signed-off-by: Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>
-rw-r--r--drivers/soc/qcom/cpr3.c137
1 files changed, 137 insertions, 0 deletions
diff --git a/drivers/soc/qcom/cpr3.c b/drivers/soc/qcom/cpr3.c
index 93abc94bef48..81822a26ddd4 100644
--- a/drivers/soc/qcom/cpr3.c
+++ b/drivers/soc/qcom/cpr3.c
@@ -2001,6 +2001,142 @@ static const struct cpr_acc_desc msm8996_hmss_cpr_acc_desc = {
.cpr_desc = &msm8996_hmss_cpr_desc,
};
+static const int msm8996_mmss_scaling_factor[][CPR3_RO_COUNT] = {
+ /* Fuse Corner 0 */
+ {
+ 0, 0, 0, 0, 0, 0, 2035, 1917,
+ 1959, 2131, 2246, 2253, 0, 0, 0, 0,
+ },
+ /* Fuse Corner 1 */
+ {
+ 0, 0, 0, 0, 0, 0, 2035, 1917,
+ 1959, 2131, 2246, 2253, 0, 0, 0, 0,
+ },
+ /* Fuse Corner 2 */
+ {
+ 0, 0, 0, 0, 0, 0, 2035, 1917,
+ 1959, 2131, 2246, 2253, 0, 0, 0, 0,
+ },
+ /* Fuse Corner 3 */
+ {
+ 0, 0, 0, 0, 0, 0, 2035, 1917,
+ 1959, 2131, 2246, 2253, 0, 0, 0, 0,
+ },
+};
+
+static const struct cpr_thread_desc msm8996_mmss_thread = {
+ .controller_id = 0,
+ .hw_tid = 0,
+ .ro_scaling_factor = msm8996_mmss_scaling_factor,
+ .ro_avail_corners = ARRAY_SIZE(msm8996_mmss_scaling_factor),
+ .sensor_range_start = 0,
+ .sensor_range_end = 35,
+ .init_voltage_step = 5000,
+ .init_voltage_width = 5,
+ .step_quot_init_min = 10,
+ .step_quot_init_max = 13,
+ .num_fuse_corners = 4,
+ .fuse_corner_data = (struct fuse_corner_data[]){
+ /* fuse corner 0 */
+ {
+ .ref_uV = 670000,
+ .max_uV = 670000,
+ .min_uV = 400000,
+ .range_uV = 32000,
+ .volt_cloop_adjust = 0,
+ .volt_oloop_adjust = 8000,
+ .max_volt_scale = 4,
+ .max_quot_scale = 10,
+ .quot_offset = 0,
+ .quot_scale = 1,
+ .quot_adjust = 0,
+ .quot_offset_scale = 5,
+ .quot_offset_adjust = 0,
+ },
+ /* fuse corner 1 */
+ {
+ .ref_uV = 745000,
+ .max_uV = 745000,
+ .min_uV = 624000,
+ .range_uV = 32000,
+ .volt_cloop_adjust = 0,
+ .volt_oloop_adjust = 0,
+ .max_volt_scale = 320,
+ .max_quot_scale = 350,
+ .quot_offset = 0,
+ .quot_scale = 1,
+ .quot_adjust = 0,
+ .quot_offset_scale = 5,
+ .quot_offset_adjust = 0,
+ },
+ /* fuse corner 2 */
+ {
+ .ref_uV = 905000,
+ .max_uV = 905000,
+ .min_uV = 632000,
+ .range_uV = 32000,
+ .volt_cloop_adjust = 12000,
+ .volt_oloop_adjust = 12000,
+ .max_volt_scale = 620,
+ .max_quot_scale = 750,
+ .quot_offset = 0,
+ .quot_scale = 1,
+ .quot_adjust = 0,
+ .quot_offset_scale = 5,
+ .quot_offset_adjust = 0,
+ },
+ /* fuse corner 3 */
+ {
+ .ref_uV = 1015000,
+ .max_uV = 1015000,
+ .min_uV = 772000,
+ .range_uV = 40000,
+ .volt_cloop_adjust = 50000,
+ .volt_oloop_adjust = 52000,
+ .max_volt_scale = 580,
+ .max_quot_scale = 1040,
+ .quot_offset = 0,
+ .quot_scale = 1,
+ .quot_adjust = 0,
+ .quot_offset_scale = 5,
+ .quot_offset_adjust = 0,
+ },
+ },
+};
+
+static const struct cpr_desc msm8996_mmss_cpr_desc = {
+ .cpr_type = CTRL_TYPE_CPR3,
+ .num_threads = 1,
+ .mem_acc_threshold = 700000,
+ .apm_threshold = 850000,
+ .apm_hysteresis = 5000,
+ .cpr_base_voltage = 470000,
+ .cpr_max_voltage = 1140000,
+ .timer_delay_us = 3000,
+ .timer_cons_up = 0,
+ .timer_cons_down = 2,
+ .up_threshold = 2,
+ .down_threshold = 2,
+ .idle_clocks = 15,
+ .count_mode = CPR3_CPR_CTL_COUNT_MODE_ALL_AT_ONCE_MIN,
+ .count_repeat = 25,
+ .gcnt_us = 1,
+ .vreg_step_fixed = 5000,
+ .vreg_step_up_limit = 1,
+ .vreg_step_down_limit = 1,
+ .vdd_settle_time_us = 34,
+ .corner_settle_time_us = 6,
+ .reduce_to_corner_uV = true,
+ .hw_closed_loop_en = true,
+ .threads = (const struct cpr_thread_desc *[]) {
+ &msm8996_mmss_thread,
+ },
+};
+
+static const struct cpr_acc_desc msm8996_mmss_cpr_acc_desc = {
+ .cpr_desc = &msm8996_mmss_cpr_desc,
+};
+
static const int msm8998_gold_scaling_factor[][CPR3_RO_COUNT] = {
/* Fuse Corner 0 */
{
@@ -3039,6 +3175,7 @@ static int cpr_remove(struct platform_device *pdev)
static const struct of_device_id cpr3_match_table[] = {
{ .compatible = "qcom,msm8996-cpr3-hmss", .data = &msm8996_hmss_cpr_acc_desc },
+ { .compatible = "qcom,msm8996-cpr3-mmss", .data = &msm8996_mmss_cpr_acc_desc },
{ .compatible = "qcom,msm8998-cprh", .data = &msm8998_cpr_acc_desc },
{ .compatible = "qcom,sdm630-cprh", .data = &sdm630_cpr_acc_desc },
{ }